Model Comparison
Claude vs GPT-6 vs Gemini 3 vs DeepSeek V4 for coding tasks — benchmarks, cost, and when to use each
title: "Model Comparison" description: "Claude vs GPT-6 vs Gemini 3 vs DeepSeek V4 for coding tasks — benchmarks, cost, and when to use each" section: "Ecosystem" readTime: "14 min" badge: "Updated Oct 2026"
Model Comparison for Coding
Choosing the right model for a task has a significant impact on output quality, speed, and cost. This guide focuses on practical coding performance — not academic benchmarks.
Quick Reference
| Model | Best For | Context | Speed | Cost |
|---|---|---|---|---|
| Claude Fable 5.1 | Hardest reasoning, long-horizon agentic work | 1M | Slower | $$$$ |
| Claude Opus 5.5 | Default for most coding and agentic work | 1M | Moderate | $$$ |
| Claude Sonnet 5.5 | Everyday coding, speed/intelligence balance | 1M | Fast | $$ |
| Claude Haiku 5.5 | High-volume, latency-sensitive tasks (routing, classification) | 1M | Fastest | $ |
| GPT-6 Astra | OpenAI flagship for complex reasoning and coding | 1.05M | Slower | $$$$ |
| GPT-6.1 Sol | OpenAI balance of intelligence and cost | 1.05M | Moderate | $$ |
| GPT-6 Luna | High-volume, focused tasks | 1.05M | Fast | $ |
| Gemini 3.1 Pro (preview) | Very large codebases, long documents | 1M | Moderate | $$$ |
| Gemini 3.8 Flash | Agentic coding at Flash prices | 1M | Fast | $$ |
| DeepSeek V4 (Pro / Flash) | Cost-efficient coding | 1M | Fast | $ |
Retired / deprecated models: Claude Opus 4, Opus 4.1, Sonnet 4, and Haiku 3.5 are retired on the Claude API (some remain on Amazon Bedrock or Google Cloud), and Claude Sonnet 4.5 is deprecated. In GitHub Copilot, Claude Sonnet 4 (May 6, 2026), Grok Code Fast 1 (May 15), GPT-4.1 (June 1), GPT-5.2 and GPT-5.2-Codex (June 5), Gemini 2.5 Pro (July 31), Gemini 3.1 Pro, Claude Opus 4.5/4.6, Sonnet 4.5/4.6 (September 1), and Gemini 3.5/3.6 Flash and Claude Opus 4.7 (October 2) were deprecated; GPT-5.5, GPT-5.4, GPT-5.4 mini, GPT-5 mini, Gemini 3.7 Flash, and Grok 4.5 follow on October 19, 2026. Remove these from any model-selection configs.
Claude Models (Anthropic)
When Claude Excels
- Following complex, multi-part instructions — Claude rarely misses constraints buried in long prompts
- Agentic tasks — Claude's tool use and multi-step reasoning are best-in-class for Claude Code workflows
- Security-conscious code — tends to include validation and error handling unprompted
- Long refactoring sessions — every current Claude model has a 1M-token context window and up to 128K output tokens
The Claude 5 Family
| Model | API ID | Context | Max output | Input / Output (per MTok) | Default effort (API) |
|---|---|---|---|---|---|
| Claude Fable 5.1 | claude-fable-5-1 | 1M | 128K | $10 / $50 | high |
| Claude Opus 5.5 | claude-opus-5-5 | 1M | 128K | $4 / $20 | medium |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | 1M | 128K | $2 / $10 | high |
| Claude Haiku 5.5 | claude-haiku-5-5 | 1M | 128K | $0.10 / $0.50 (prompts up to 100K tokens); $0.50 / $2.50 above | medium |
All four use adaptive thinking (always on for Fable 5.1 and Opus 5.5), accept text and image input, and have a June 2026 knowledge cutoff. The Batch API is 50% off, and prompt-cache reads cost a fraction of base input ($0.25/MTok on Fable 5.1, $0.20 on Opus 5.5, $0.10 on Sonnet 5.5). Model IDs are dateless pinned snapshots; on Amazon Bedrock prefix them with anthropic. (for example anthropic.claude-opus-5-5).
Legacy models still available: Claude Fable 5, Opus 5, Opus 4.8, Opus 4.7, Opus 4.6, Opus 4.5, Sonnet 5, Sonnet 4.6, and Haiku 4.5.
Choosing Within Claude Code
Opus 5.5 is the default model in Claude Code on Pro, Max, Team, Enterprise, and the Anthropic API. Use it for:
- Feature implementation
- Bug fixes
- Code review
- Test generation
- Day-to-day pair programming
Switch to Fable 5.1 (alias fable, or best) for:
- System architecture design where depth matters more than speed
- Long-horizon agentic tasks
- Problems where Opus 5.5 at higher effort still falls short
Use Sonnet 5.5 when you want faster turns at lower cost, and Haiku 5.5 for subagents, routing, and bulk scripted jobs.
# Override model in Claude Code (aliases: default, best, fable, opus, sonnet, haiku, opusplan)
claude --model fable "Design the database schema for a multi-tenant SaaS application..."
# Or mid-session
/model sonnetThe opusplan alias uses Opus in plan mode and Sonnet for execution. Alias resolution differs by provider (on Amazon Bedrock and Google Cloud, sonnet still resolves to Sonnet 4.5), so pin a full model ID when you need consistency. Precedence is: /model in-session, then --model, then ANTHROPIC_MODEL, then the model key in settings.
Effort Levels
Effort controls how much the model thinks. Current Claude models accept low, medium, high, xhigh, and max. Set it with /effort, --effort, the CLAUDE_CODE_EFFORT_LEVEL env var, or effortLevel in settings; skills and subagents can set effort in frontmatter.
claude --model opus --effort xhigh "Find the race condition in the job scheduler"GPT-6 (OpenAI)
The GPT-6 Family
| Model | API ID | Context | Max output | Input / Output (per MTok) |
|---|---|---|---|---|
| GPT-6 Astra | gpt-6-astra | 1.05M | 128K | $10 / $50 |
| GPT-6.1 Sol | gpt-6.1-sol | 1.05M | 128K | $2 / $10 |
| GPT-6 Luna | gpt-6-luna | 1.05M | 128K | $0.10 / $0.50 |
All three accept text and image input (maximum input 922K tokens). Prompts over 272K input tokens cost 2x input and 1.5x output for the whole request; Batch and Flex are 50% off.
- Astra: OpenAI's flagship for complex reasoning and coding
- Sol: the middle tier, balancing intelligence and cost
- Luna: the most efficient tier, for focused, high-volume tasks
Via Claude Code
Claude Code is built for Claude models and officially supports the Claude API, Amazon Bedrock, Google Cloud, Microsoft Foundry, and Claude Platform on AWS. Routing it to non-Claude models requires a third-party gateway that translates the Anthropic Messages API and is not officially supported, so use GPT models in their native tools instead.
In Copilot
Copilot offers Claude, GPT, Gemini, Grok, Kimi, and MAI models, and the roster changes often. Switch models:
- VS Code → Copilot Chat → model picker
- Completions: run GitHub Copilot: Change Completions Model from the command palette
Bring Your Own Key (BYOK): Local BYOK lets you add your own provider keys (for example Anthropic, OpenAI, Azure OpenAI, Google AI Studio, Amazon Bedrock, Ollama, or any OpenAI-compatible endpoint) in VS Code, JetBrains IDEs, Xcode, Copilot CLI, the Copilot app, and the Copilot SDK. Business and Enterprise organizations can disable it by policy, and enterprise BYOK (keys set by owners for all users) is in public preview. BYOK usage is billed by your provider, so it is a way to use models Copilot does not list.
Gemini 3 (Google)
| Model | API ID | Context | Max output | Input / Output (per MTok) |
|---|---|---|---|---|
| Gemini 3.1 Pro (preview) | gemini-3.1-pro-preview | 1M | 64K | $2 / $12 (prompts up to 200K); $4 / $18 above |
| Gemini 3.8 Flash | gemini-3.8-flash | 1M | 64K | $0.75 / $3.75 (rising to $1.50 / $7.50 on Jan 1, 2027) |
Gemini 2.5 models are still served but only to existing users; Google recommends Gemini 3.8 Flash or 3.5 Flash-Lite for new projects.
When Gemini Excels
- Massive codebase analysis: 1M-token context window — fit a large monorepo in one prompt
- Long document analysis: Analyze full spec documents and code together
- Mixed media input: Gemini 3.8 Flash accepts text, images, video, audio, and PDF
In Cursor
Cursor's model picker includes Gemini 3.8 Flash and Gemini 3.1 Pro, alongside Claude, GPT, Grok, and its own Composer models. Non-Cursor models are billed at API rates, and Auto mode routes each request for cost, balance, or intelligence.
# Gemini CLI use case — full codebase architecture review
# Concatenate entire src/ into one input
find src/ -name "*.ts" -exec cat {} \; | \
gemini -p "Identify all circular dependencies and suggest how to break each cycle"Model Selection by Task Type
| Task | Recommended | Why |
|---|---|---|
| Autocomplete / ghost text | Copilot (default completion model) | Latency matters |
| Bug fix in 1-3 files | Claude Sonnet 5.5 or GPT-6.1 Sol | Both excel; pick your default |
| Feature from scratch | Claude Opus 5.5 | Best instruction following |
| Architecture design | Claude Fable 5.1 | Deepest reasoning |
| Screenshot → code | Claude Opus 5.5 or GPT-6 Astra | Both accept image input |
| Whole-repo refactor | Claude Opus 5.5 or Gemini 3.1 Pro | Both have a 1M-token context |
| Security audit | Claude Opus 5.5 | Best at compliance and caution |
| High-volume automation | Claude Haiku 5.5, GPT-6 Luna, or DeepSeek Flash | Cost efficiency |
| Offline/private code | Local model (Ollama) | No data leaves machine |
Cost Optimization
Token Management
# Claude Code has no --max-tokens flag. In print mode, cap turns and spend instead
claude -p --max-turns 5 --max-budget-usd 2.00 "Review this function for security issues"
# Use lower effort (or a smaller model) for routine work
claude -p --model haiku --effort low "Summarize the changes in CHANGELOG.md"
# Use -p (non-interactive) for batch jobs — no conversation overhead
for f in src/api/*.ts; do
claude -p "Review $f for security issues" >> review.log
doneModel Router Strategy
Use a cheap model for screening, expensive model for execution:
NEEDS_COMPLEX=$(claude -p --model haiku "Does this task require deep reasoning? Answer YES or NO only: $TASK")
if [ "$NEEDS_COMPLEX" = "YES" ]; then
claude --model fable "$TASK"
else
claude --model sonnet "$TASK"
fiLocal / Private Models
For code that can't leave your infrastructure:
| Tool | Models | Notes |
|---|---|---|
| Ollama | Qwen3-Coder, Devstral, gpt-oss | Free; serves an Anthropic-compatible /v1/messages API |
| Continue | Any Ollama model | VS Code and JetBrains extensions, plus a CLI |
| LM Studio | Any GGUF model | GUI + API server; Anthropic-compatible /v1/messages (0.4.1+) |
Ollama and LM Studio both document running Claude Code against a local model. This is their setup, not one Anthropic supports:
# Ollama (default port 11434); the token is a placeholder
ollama pull qwen3-coder
ANTHROPIC_AUTH_TOKEN=ollama ANTHROPIC_BASE_URL=http://localhost:11434 claude --model qwen3-coder
# LM Studio (default port 1234)
ANTHROPIC_AUTH_TOKEN=lmstudio ANTHROPIC_BASE_URL=http://localhost:1234 claude --model openai/gpt-oss-20bLocal models are significantly behind frontier models for complex agentic tasks. Use them for completions and simple edits; use cloud models for multi-step agent workflows.
Benchmarks
Published scores (SWE-bench Verified, Terminal-Bench, LiveCodeBench, and others) change with every model release, so static comparison tables go stale quickly. Check each model's official launch page for current numbers.
Benchmarks measure narrow capabilities. Real-world agentic coding performance depends heavily on instruction following, tool use quality, and context management — evaluate on your actual tasks.