Best AI Model for Coding in 2026 (Ranked by SWE-bench and Price)

GPT-5.5, Claude Opus 4.8 and Gemini 3.1 Pro tie on the old benchmark. The harder one, and the price, decide which model to code with.

Published Updated

Best AI Model for Coding in 2026 (Ranked by SWE-bench and Price)

The best AI model for coding in 2026 is Claude Sonnet 5.5 for daily coding and review in Claude Code, or GPT-6.2 Sol for everyday work in Codex. Use Claude Opus 5.5 or GPT-6.2 Astra for harder work in their respective tools, and evaluate Kimi K3.1 Pro for long runs on a daily-driver budget. Gemini 4 Neon is the Google coding pick to try first. Gemini 4 Carbon is available on the paid Gemini API and eligible Google plans for longer, harder jobs.

Verified November 20, 2026. API prices, model limits, availability and benchmark results were checked against the makers' pages and benchmark sources.

Since the October 29 check, Anthropic released Claude Fable 5.2 on November 9, Google opened paid access to Gemini 4 Carbon on November 10, OpenAI released GPT-6.2 Astra and Sol on November 17, and Google launched Gemini 4 Neon on November 18. If you already use Codex or Antigravity, those releases give you new daily and escalation options in the tools you already use.

A model is the intelligence that generates the answer. A coding tool or agent, such as Claude Code, Cursor or Codex, supplies the repository, runs commands and returns test results. Choose a tool that supports your workflow, then select the model it actually exposes.

Best AI Model for Coding in 2026: The Verdict, in One Table

The first six rows are the buying shortlist. Start with the model your coding tool supports, then compare the cost of accepted work, including retries and review. The remaining rows cover premium escalations, budget models, existing integrations and self-hosted options.

Prices are USD per million tokens, input then output, at the published Standard API rate. The agent day assumes 2 million base-rate input tokens and 200,000 billable output tokens, spread across short requests. The sources are the Anthropic API pricing catalog, OpenAI API pricing, Google API pricing, Kimi API rates and caching rules and Z.ai API pricing.

ModelBest forAPI input / output per 1MIllustrative agent day
1. Claude Sonnet 5.5Daily coding and routine code review$2 / $10$6.00
2. GPT-6.2 SolDaily coding and multistep work in Codex$2 / $10$6.00
3. Claude Opus 5.5Difficult long runs and high-risk reviews$4 / $20$12.00
4. Kimi K3.1 ProHosted long runs at daily-driver rates$2 / $10$6.00
5. Gemini 4 NeonRecurring complex coding in Google's tools$3 / $15$9.00
6. GPT-6.2 AstraThe hardest OpenAI coding tasks$8 / $40$24.00
Claude Fable 5.2Escalation when Opus falls short$8 / $40$24.00
Gemini 4 CarbonLonger, harder Google agent runs$2 / $10 through Nov 30, 2026, then $4 / $20 from Dec 1, 2026$6.00 introductory, $12.00 after
Gemini 4 ArgonExisting Google frontier workflows$2 / $10 through Nov 30, 2026, then $4 / $20 from Dec 1, 2026$6.00 introductory, $12.00 after
GPT-6.1 TerraLower-cost screenshot-led UI fixes and bounded tasks$1 / $5$3.00
GPT-6 LunaCheap, focused bulk edits$0.10 / $0.50$0.30
Claude Haiku 5.5Cheap Claude subagents and bounded tasks$0.10 / $0.50 at or below 100K prompt tokens, $0.50 / $2.50 above$0.30 at short-prompt rates
Claude Haiku 4.5Existing Haiku integrations$1 / $5$3.00
Gemini 3.8 FlashBudget Google coding workflows$0.75 / $3.75 through Dec 31, 2026, then $1.50 / $7.50 from Jan 1, 2027$2.25 introductory, $4.50 after
Gemini 3.5 Flash-LiteLow-cost parsing and simple subagents$0.30 / $2.50$1.10
Gemini 3.1 Pro PreviewExisting Pro workflows that pass your checks$2 / $12 at or below 200K prompt tokens, $4 / $18 above$6.40 at short-prompt rates
GLM-5.3Self-hosted terminal coding or hosted evaluationHosted API $1.40 / $4.40$3.68 hosted
Kimi K3Self-hosted coding with image inputHosted API $3 / $15$9.00 hosted

Where These Models Are Available

Codex: OpenAI documents native access to GPT-6.2 Sol, GPT-6.2 Astra, GPT-6.1 Terra and GPT-6 Luna on supported plans and clients. Kimi K3 and K3.1 Pro have a documented custom-provider route in Codex CLI and desktop, using separate Kimi credentials. Codex model guidance, Kimi's Codex setup.

Claude Code: Sonnet 5.5, Opus 5.5, Fable 5.2 and Haiku 5.5 are documented choices. Pin the full model name when aliases vary by provider. Z.ai documents how to use its GLM-5.3 model through its endpoint, and Moonshot documents its custom-provider route for Kimi K3 and K3.1 Pro. Each uses the outside provider's access and billing. Claude Code configuration, Z.ai integration, Kimi integration.

Cursor: Its model catalog lists Sonnet 5.5, Opus 5.5, Fable 5.2, Haiku 5.5, Gemini 4 Neon, Carbon and Argon, Gemini 3.8 Flash and Gemini 3.1 Pro. Check your plan and picker before budgeting for a model. Cursor models and pricing.

GitHub Copilot: Its supported-model list includes GPT-6.2 Astra and Sol, Terra and Luna, the Claude models in the verdict table, Gemini 4 Neon, Carbon and Argon, Gemini 3.8 Flash and Kimi K3. Check the plan, client and administrator requirements for each. To let Copilot route between eligible models, select Copilot Fusion in the model picker and choose an effort level. Supported models, Copilot Fusion announcement.

Why "Best on SWE-bench" Does Not Settle the Decision

An agent benchmark measures a model inside a specific tool setup, with a particular effort setting and task budget. SWE-bench Verified uses a human-filtered set of 500 repository issues. Terminal-Bench evaluates agents working through terminal tasks. SWE-bench Verified methodology.

The table uses the Terminal-Bench 4.1 public leaderboard as read on November 20, 2026, with Google's own Neon launch result labeled separately. A dash indicates that the cited sources did not establish a score for that model and benchmark. The agent column identifies the tool that ran each terminal evaluation. Official Terminal-Bench leaderboard.

ModelSWE-bench VerifiedTerminal-Bench 4.1Agent and effort for terminal result
Claude Sonnet 5.5—63.9%Claude Code, max
GPT-6.2 Sol—61.5%Codex, max
Claude Opus 5.5—65.8%Claude Code, max
Kimi K3.1 Pro—59.7%Claude Code, max
Gemini 4 Neon—65.2%, Google's launch resultGoogle reports this separately from the leaderboard runs
GPT-6.2 Astra—62.1%Codex, max
Claude Fable 5.2—65.8%Claude Code, max
Gemini 4 Carbon—64.5%Antigravity CLI, high
Gemini 4 Argon—55.5%Antigravity CLI, high
GPT-6.1 Terra—53.3%Codex, max
GPT-6 Luna—15.2%Codex, max
Claude Haiku 5.5—40.0%Claude Code, max
Claude Haiku 4.573.3%, Anthropic's test setup——
Gemini 3.8 Flash—18.2%mini-SWE-agent, high
Gemini 3.5 Flash-Lite———
Gemini 3.1 Pro Preview80.6%, single attempt in Google's model card——
GLM-5.3—41.2%Claude Code, max
Kimi K3—23.0%Claude Code, max

Sonnet's launch reported 70.6% on Terminal-Bench 4.0. Anthropic reported 66.4% for Opus on that version, with documented fallbacks. In the 4.1 leaderboard above, Opus scores higher. Start with the cheaper Sonnet on routine tickets and reserve Opus for work where it earns its price in accepted changes or reduced review time. Sonnet launch evaluation, Opus launch evaluation.

Claude Opus 5.5: The Escalation for Long Agent Runs

Claude Opus 5.5 is the starting escalation for a migration, an ambiguous bug across services, or an audit where the agent must keep checking its own assumptions. The recommendation follows Anthropic's stated intended use and published evaluations.

Anthropic Claude product page
Anthropic Claude

Its 1M-token context and 128K maximum output support larger work, but they do not make filling the window a good default. Give an overnight agent a defined change, acceptance tests and a spend limit. Model limits.

The practical migration limit matters: Opus 5.5's thinking cannot be disabled, and integrations that force a particular tool must follow the new tool-choice rules. Update the client before switching an automated job's model string. Opus migration behavior.

For code review, use Sonnet first on ordinary pull requests and Opus when a change crosses service boundaries or touches authorization, billing or data integrity. Ask for the affected code path and the behavior a regression test should cover.

Claude Fable 5.2 is the escalation when demanding work still defeats Opus at higher effort. Anthropic reports 49.1% on FrontierCode 2.0 at xhigh effort. Its Standard API rate dropped from $10 / $50 to $8 / $40 per million tokens with the November 9 release. Use claude-fable-5-2 on the Claude Platform and reserve it for jobs where the accepted work earns the premium. Anthropic's release and evaluation, Fable 5.2 guide.

Claude Sonnet 5.5 and Haiku: Daily Coding and Cheap Claude Tasks

Claude Sonnet 5.5 is the default to evaluate for routine features, refactors and reviews in a Claude workflow. Its 1M-token context can hold substantial repository material. Start with a clear change request and the files the task actually needs.

For a CTO choosing a default, the important question is whether Sonnet finishes the ticket with acceptable review effort. Escalate an unresolved failure to Opus after preserving the failing test and a clear explanation. Repeatedly asking the cheaper model to retry can erase its price advantage; repeated blind escalation can waste the premium.

Claude Haiku 5.5 is the current Claude option for high-volume, latency-sensitive work such as extraction, routing and subagents. It ties Luna for the lowest base input and output prices in the table at short prompt lengths. Haiku's price rises above its short-prompt band. Evaluate it for mechanical edits with tests; do not infer long-agent performance from its low rate. Haiku specifications and intended use.

Claude Haiku 4.5 remains a legacy option for existing integrations. Keep it where an existing integration depends on it.

GPT-6.2 Sol and Astra: The OpenAI Daily Driver and Escalation

GPT-6.2 Sol is the practical first pick for recurring coding work in Codex. OpenAI reports that on FrontierCode 2.0, which assesses whether patches meet the standard for merging, Sol came within 0.5 percentage points of GPT-6.2 Astra at about one-fifth of the cost per task, with both at max effort. Start with Sol for features and routine refactors. Try Astra when a migration spans services or Sol keeps missing an acceptance test. OpenAI's GPT-6.2 release and coding evaluation, Astra vs Sol comparison.

OpenAI API platform page
OpenAI API

Since November 17, 2026, both models are available in ChatGPT Work and Codex on supported plans and clients, and in the OpenAI API as gpt-6.2-sol and gpt-6.2-astra. Check Work and Codex access for your plan. Both API models have a 1,050,000-token context window, with 922,000 maximum input tokens and 128,000 maximum output tokens. Use the Responses API for tool calling. OpenAI's release changelog, Astra API model limits, GPT-6.2 access guide.

Sol keeps its predecessor's base prices of $2 / $10. Astra drops from $10 / $50 to $8 / $40, with cached input falling from $1 to $0.40. Those are API rates per million tokens. Compare the accepted-patch bill before making the premium model your default.

GPT-6.1 Terra still has a role as a lower-cost specialist for screenshot-led layouts and tightly scoped fixes. For general coding, start with Sol. GPT-6 Luna is the volume option for bounded jobs such as drafting commit messages or making mechanical edits checked by tests. OpenAI reports 66.6% on DeepSWE v1.1 at max effort for Luna. OpenAI's Luna coding evaluation.

Gemini 4 Neon, Carbon and Argon: Pick by Workload and Access

Gemini 4 Neon is the first Google model to evaluate for recurring complex coding, especially multi-file debugging and refactoring in Antigravity. Google released it on November 18, 2026. The paid Gemini API model is gemini-4-neon, with a unified 1,048,576-token context window shared by input and output. Standard rates are $3 input, $0.15 cached input and $15 output per million tokens. Neon API specifications, Gemini 4 Neon guide.

Google AI for Developers Gemini page
Google Gemini

Google lists Neon in the paid Gemini API, including Google AI Studio and Android Studio, and in Gemini for business through its API and model dropdown. In Antigravity, Google lists paid Google AI Pro, eligible premium-device trials, Ultra and Enterprise. The Gemini app rollout covers Google AI Pro and Ultra. Antigravity model access.

In the launch results cited in the benchmark table, Google reports 58.6 on the Artificial Analysis Coding Agent Index, 65.2% on Terminal-Bench 4.1, and 46.2% on FrontierCode 2.0 at its default high setting. On SWE-sweep, Google reports 12.8% with the mini-SWE agent and 39.0% in Antigravity. That spread gives you a reason to evaluate Neon in the tool you plan to use. Google's Neon model card.

Gemini 4 Carbon moved from limited early access to a broader paid rollout on November 10, 2026. Google lists it as gemini-4-carbon in the paid Gemini API, with access through AI Studio, Android Studio and Gemini for business. Google AI Ultra includes Carbon in Antigravity, the Gemini app and AI Mode in Search. Antigravity also lists Carbon in Enterprise. Evaluate Carbon for a migration or debugging job that needs sustained work across services. Include the December rate change in the cost comparison. Google's Carbon availability announcement, Carbon API model page.

Gemini 4 Argon remains a paid API option as gemini-4-argon and is available on eligible Antigravity plans. Google's card reports 77.9% on DeepSWE v1.1, 55.0% on FrontierSWE v2 and 91.9% on Vibe Code Bench. Google ran its DeepSWE evaluation with a mini-SWE agent and drew the other two figures from the benchmarks' leaderboards. Keep Argon in the trial if it already works in your stack, and compare it with Neon using the same tests and budget. Argon model card, Google's Argon evaluation methodology.

Gemini 3.8 Flash is Google's budget coding candidate. Its 1,048,576-token input limit lets it take large inputs. For predictable patches with good tests, compare what you spend per accepted patch. For open-ended migrations, start the comparison with Neon, Carbon, Opus or Astra. Flash model limits.

Gemini 3.5 Flash-Lite is a separate candidate for parsing and simple subagent work. Gemini 3.1 Pro Preview remains an API option with a long-prompt price band. Keep it where an existing workflow produces better accepted outcomes with it. Flash-Lite intended use, Pro Preview API availability.

Kimi K3.1 Pro: A Hosted Challenger for Long Agent Work

Kimi K3.1 Pro ranks fourth in the buying shortlist because it makes a serious long-run evaluation affordable at daily-driver token rates. Moonshot reported 65.7% on Terminal-Bench 4.0 in Claude Code. The public 4.1 run above uses the newer test. The price puts Kimi alongside Sonnet and Sol, so try it when you have a migration to run and want a hosted option at those rates. Moonshot's release evaluation.

Give it an ambiguous bug with acceptance tests or a multi-file refactor that currently needs escalation. Compare completed work, review effort and retries against Opus. For routine code review, Sonnet remains the first recommendation; the sources checked do not establish a separate K3.1 Pro review advantage.

The API model is kimi-k3.1-pro and supports a 1M-token context. Kimi Code uses the distinct k3.1-pro identifier. It is available from Plus, with the full 1,048,576-token window from Pro. Pay-as-you-go API billing is separate. API specifications, Kimi Code model configuration.

Keep thinking enabled and start a fresh session when switching. Kimi's configuration docs say a mistyped coding-plan model ID can route to K2.8 Preview without thinking. Record the resolved model before comparing results. For a self-hosted trial, use the released weights linked below.

The Open-Weight Models Worth Self-Hosting

GLM-5.3 is the self-host starting point here for terminal-heavy coding. Z.ai's own model card documents local serving through vLLM and SGLang, and its official terminal result is listed above. Evaluate it on a repository where commands, test runs and multi-step fixes dominate the work. Maker model card.

DeepSeek model page
DeepSeek

If your existing stack uses DeepSeek, compare its accepted results before replacing it. Kimi K3, the older released model, is also a candidate when your coding workflow needs image input. Moonshot releases its weights under the Kimi K3 License and documents local deployment. Its published results use different evaluations, so this page does not declare a universal open-weight winner. Moonshot's own card.

Moonshot has also released Kimi K3.1 Pro's weights under the Kimi K3.1 Pro License, with deployment instructions for vLLM and SGLang. Compare it with GLM-5.3 and Kimi K3 if you have the infrastructure to serve it. Moonshot's K3.1 Pro weights and license.

Self-hosting means serving the weights on infrastructure you control. That can suit a privacy-bound operator, but it does not mean free inference. Calculate allocated GPU-hours × your GPU-hour cost, then add storage, power and operations. The hosted prices in the table let you budget an API evaluation; they do not price your own fleet.

For a team that already operates inference, compare cost per accepted ticket and the capacity needed at peak load. For a solo builder without that infrastructure, start with the hosted daily driver. The ownership decision should precede the benchmark decision.

Which Model Should You Actually Pick

Long agent runs: Start with Opus 5.5 in Claude Code or Astra in Codex for complex, open-ended work. Evaluate K3.1 Pro as the lower-priced hosted challenger. Keep Fable 5.2 available when Opus still falls short.

Code review: Start with Sonnet 5.5 for ordinary pull requests, or Sol if Codex is already your review environment. For high-risk, cross-service changes, escalate to Opus or Astra. Require concrete evidence for findings.

Daily driver: Choose Sonnet 5.5 in Claude Code or GPT-6.2 Sol in Codex. Try Terra for a tightly scoped job where a screenshot is central to the fix. Keep the candidate that produces more accepted patches with less review and retry work.

Google frontier coding: Start with Neon for recurring multi-file work. Use Carbon as the escalation for longer projects, and keep Argon in the trial if it already works for you. Budget for the scheduled rate change on Carbon and Argon.

Cheap high volume: Compare GPT-6 Luna and Haiku 5.5 for short, focused jobs. Try Flash-Lite if you use Google's stack. Use automated checks to decide which tasks can stay on the cheap tier.

Self-host: Evaluate GLM-5.3 for terminal work or Kimi K3 when you need image input. K3.1 Pro's weights are available if you can serve them. Check the license, memory capacity and actual serving performance before substituting an infrastructure estimate for the API bill.

GPT-5.5 retired from Codex with ChatGPT sign-in on October 14, 2026. API access and Codex sessions using an API key are unaffected. OpenAI retirement guidance.

OpenRouter model marketplace
OpenRouter

OpenRouter offers a common API endpoint and model catalog. If you use it for the comparison, confirm the exact model is listed and record any fallback route; do not assume every fresh release is available through the same provider. OpenRouter documentation.

Take a bug fix, a feature and a refactor from your backlog. Give each candidate the same acceptance tests and spend limit. Record accepted patches, total token charges, retries and human review time. Change the default on those results, and remove the retired model from saved configurations that use ChatGPT sign-in.

The tool still controls how the model sees your repository and which commands it can run. Use the guide to the best AI coding agents, the Codex vs Claude Code vs Cursor comparison, and the Grok Build, Claude Code and Codex comparison when choosing that layer.

Is ChatGPT or Claude better at coding in 2026?

For daily coding, compare Claude Sonnet 5.5 with GPT-6.2 Sol in Codex or ChatGPT Work. For difficult long runs, try Opus 5.5 in Claude Code or GPT-6.2 Astra in Codex. Check access to the model in the tool and plan you use.

What is the best AI model for coding right now?

Start with Sonnet 5.5 or GPT-6.2 Sol for everyday coding. Escalate to Opus 5.5 or GPT-6.2 Astra for hard jobs, or evaluate Kimi K3.1 Pro if you want lower hosted rates. For a Google workflow, start with Gemini 4 Neon and try Carbon for longer, harder jobs.

What is the best free or open-source model for coding?

Start with GLM-5.3 for self-hosted terminal coding and consider Kimi K3 when image input matters. K3.1 Pro's weights are also available. Check each model's license and budget for the hardware and operating costs.

Which model is cheapest for coding?

GPT-6 Luna and short-prompt Claude Haiku 5.5 tie for the lowest base text-token rates in this lineup. Haiku's rate rises above its short-prompt band. Use the pricing table for the exact rates and thresholds; the cheapest accepted patch can differ if a model needs more retries or review.

Does the model or the coding tool matter more?

Choose the tool first, then a model it supports. Claude Code, Cursor and Codex determine the repository context, tool permissions and testing loop; the model determines how it reasons within that setup. Native model-picker access and a custom provider configuration are different routes. Compare the complete setup on your own tickets rather than buying a model solely for a leaderboard number.

Want the current model-and-tool picks without re-reading a leaderboard every month? Join the newsletter and get the shortlist, with prices and benchmarks, the week they change.

Last Updated
Category
AI
Related Articles
Best AI Apps in 2026: ChatGPT, Claude, Gemini and 9 More by Job

Best AI Apps in 2026: ChatGPT, Claude, Gemini and 9 More by Job

Choose an AI app for writing, research, meetings, email or media. Compare 12 picks by job and phone support, with starter sets for solo work and teams of ten.Nov 22, 2026AI
Fish Audio Explained: How to Make Your First Voice-Over

Fish Audio Explained: How to Make Your First Voice-Over

What Fish Audio makes, which voice model to use, what the free plan allows, and how to turn a script into a voice-over.Nov 22, 2026AI
Muse Email Address: How to Set Up and Use Muse Mail

Muse Email Address: How to Set Up and Use Muse Mail

Set up your Muse Mail address, forward one email, and review what your agent sends. If you received an @muse.ai message, here’s who can see your reply.Nov 22, 2026AI
Inkling 2 Mini: Can Your Laptop Run It?

Inkling 2 Mini: Can Your Laptop Run It?

Check Inkling 2 Mini’s memory requirements for your Mac or GPU, see how its looped layers work, and start with Hugging Face, Ollama, llama.cpp or Tinker.Nov 22, 2026AI
ChatGPT Space for Plus: What It Is, Who Gets It and How to Start

ChatGPT Space for Plus: What It Is, Who Gets It and How to Start

Find your files after Space replaces Library, create a page with ChatGPT, and check who can open the brief or presentation you share.Nov 21, 2026AI
Claude Computer Use

Claude Computer Use

See how owners enable Claude computer use, what members approve, and which desktop tasks make a good first pilot for a Team or Enterprise organization.Nov 21, 2026AI
Best AI Personal Assistant in 2026: Fyxer, Reclaim, Lindy and 5 More Compared

Best AI Personal Assistant in 2026: Fyxer, Reclaim, Lindy and 5 More Compared

Compare eight AI personal assistants for email, scheduling and meeting follow-ups. See what each costs, what it handles and where you still step in.Nov 21, 2026AI
Claude in Chrome: What It Is, What It Costs, and How to Start

Claude in Chrome: What It Is, What It Costs, and How to Start

Use Anthropic’s extension in the Chrome side panel, Claude Cowork, or Claude Code. See who gets access and when a browser task needs you.Nov 21, 2026AI
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.