Best LLMs for Code Generation (2026)

As of 2026-11-13, LLM Reference's top pick for code generation is Gemini 4 Carbon by Google DeepMind (CursorBench v4.0 (highest effort) 60.4%, $10.00/1M output tokens), chosen from models that meet the podium eligibility rules. Second pick: Claude Fable 5.2 by Anthropic.

Last refreshed 2026-11-13. Next refresh: weekly.

Coding LLMs in 2026, ranked by CursorBench v4.0. Includes API pricing and context window for each pick, updated daily.

Verdict

Use Gemini 4 Carbon for code generation today.

Claude Fable 5.2 is the runner-up, 0.4 points back on CursorBench v4.0 (highest effort).

Researched 4d agoWhy this pickMethodology

How we rank

Coding models rank first on CursorBench v4.0. Models without a CursorBench score follow on SWE-bench Verified, then HumanEval, then SWE-bench Pro, with newer release as the last tie-break.

  1. Eligibility — Chat models tied to code work with current public or self-serve availability: code specialization, listed code-execution support, a place in a known coding model family, or scores on CursorBench v4.0, FrontierCode, SWE-bench Verified, SWE-bench Pro, HumanEval, LiveCodeBench, Aider Polyglot, or BigCodeBench.
  2. Primary ranking — Models with a CursorBench v4.0 score rank first, by that score at each model's highest reported effort setting. Others follow by SWE-bench Verified, then HumanEval, then SWE-bench Pro. Scores from different benchmarks are never mixed. CursorBench 3.x scores and lower-effort CursorBench scores are not used.
  3. Benchmark variants — Independent standardized scores such as Vals.ai, Scale AI SWE-bench Pro, and Nebius/OpenHands SWE-bench Verified stay separate from vendor-reported variants. Vendor-only orchestration claims do not promote a model on this page without a comparable public harness score.
  4. Tie-breaks — Newer `release` date when benchmark scores match.
  5. Variant collapse — We keep one row per model family (`familySlug` + parameter tier). When headline scores tie within ±0.5 pt (±10 Elo on Chatbot Arena), we pick the canonical SKU by lowest tracked input price, then GA over preview or limited access, then newest `release`. A folded sibling within the benchmark noise band can show a "Tied within margin" chip on that score cell.
  6. Podium eligibility — Preview, restricted, retired and retiring models never fill a podium slot. Preview means preview or invite-only access, or a model that is announced or pre-release. Restricted means restricted, partner, private or otherwise unavailable access. Retired means the model is past its retirement date or every provider route is retired. Retiring means the model, or any one of its provider routes, has a retirement date within the next 60 days. These models can still appear in the table below the podium.
  7. Pricing column — Input/output prices are the lowest tracked public commercial rate cards in seed data; partner-only pricing is kept out of the default ranking.

New models awaiting benchmark coverage

These source-backed rows qualify for this task page, but they are not scored leaderboard picks until the category benchmark data exists.
ModelWhy it is listedStatusListed price
Gemini 4 Hydrogen
ToolsCode execution
Gemini 4 Hydrogen is a newly researched coding-capable model; keep it on the watchlist until category scores land.Benchmark pending

No CursorBench v4.0, SWE-bench Verified, HumanEval, or SWE-bench Pro score listed.

In $1.50 / Out $7.50
GPT-6.1 Terra
ToolsCode execution
GPT-6.1 Terra is a newly researched coding-capable model; keep it on the watchlist until category scores land.Benchmark pending

No CursorBench v4.0, SWE-bench Verified, HumanEval, or SWE-bench Pro score listed.

In $1.00 / Out $5.00
Kimi K3.1 Pro
Tools
Kimi K3.1 Pro is a newly researched coding-capable model; keep it on the watchlist until category scores land.Benchmark pending

No CursorBench v4.0, SWE-bench Verified, HumanEval, or SWE-bench Pro score listed.

In $2.00 / Out $10.00
DeepSeek V4.1 Flash 1017
Tools
DeepSeek V4.1 Flash 1017 is a newly researched coding-capable model; keep it on the watchlist until category scores land.Benchmark pending

No CursorBench v4.0, SWE-bench Verified, HumanEval, or SWE-bench Pro score listed.

In $0.20 / Out $0.60
#ModelInput $/1MOutput $/1M
1Gemini 4 Carbon
ReasoningVisionTools

CursorBench v4.0 (highest effort): 60.4%

$2.00$10.00
2Claude Fable 5.2
ReasoningVisionTools

CursorBench v4.0 (highest effort): 60%

$8.00$40.00
3Claude Opus 5.5
ReasoningVisionTools

CursorBench v4.0 (highest effort): 57.8%

$4.00$20.00
4Claude Sonnet 5.5
ReasoningVisionTools

CursorBench v4.0 (highest effort): 55.5%

$2.00$10.00
5Claude Fable 5.1
ReasoningVisionToolsVerify pricing

CursorBench v4.0 (highest effort): 51.8%

$10.00$50.00
6Claude Opus 5
ReasoningVisionTools

CursorBench v4.0 (highest effort): 46.6%

$5.00$25.00
7Grok 4.7
ReasoningVisionToolsVerify pricing

CursorBench v4.0 (highest effort): 46.3%

$2.00$6.00
8GPT-5.6 Sol
ReasoningVisionTools

CursorBench v4.0 (highest effort): 41.7%

$4.00$20.00
9Muse Spark 1.3
ReasoningVisionTools

CursorBench v4.0 (highest effort): 41.6%

$1.25$4.25
10Grok 4.6
ReasoningVisionTools

CursorBench v4.0 (highest effort): 41.4%

$2.00$6.00
11GPT-5.6 Terra
ReasoningVisionToolsVerify pricing

CursorBench v4.0 (highest effort): 41.3%

$2.00$12.00
12Gemini 3.8 Flash
ReasoningVisionToolsVerify pricing

CursorBench v4.0 (highest effort): 39.6%

$0.75$3.75
13GPT-5.6 Luna
ReasoningVisionTools

CursorBench v4.0 (highest effort): 35.9%

$0.20$1.20
14Claude Sonnet 5
ReasoningVisionTools

CursorBench v4.0 (highest effort): 34.1%

$2.00$10.00
15Composer 2.5
ToolsVerify pricing

CursorBench v4.0 (highest effort): 27.7%

$0.50$2.50
16Claude Fable 5
ReasoningVisionTools

SWE-bench Verified: 96%

$10.00$50.00
17Claude Opus 4.8
ReasoningVisionTools

SWE-bench Verified: 88.6%

$5.00$25.00
18Claude Opus 4.7
ReasoningVisionTools

SWE-bench Verified: 87.6%

$5.00$25.00
19GPT-5.3-Codex
ReasoningVisionTools

SWE-bench Verified: 85%

$1.75$14.00
20GPT-5.5
ReasoningVisionToolsVerify pricing

SWE-bench Verified: 82.6%

$5.00$30.00

Honorable mentions

Next seats in this ranking. Lines below are from each model's stored description in LLMReference seed data—spot-check the model page before relying on a capability claim.
  • Anthropic's Claude Sonnet 5.5, second model in the Claude 5.5 family, released September 28, 2026. First-party positioning: faster, lower-cost complement to Claude Opus 5.5; strongest at well-scoped everyday tasks, bug fixes, and polished documents/slides/spreadsheets; clear upgrade over Claude Sonnet 5 (30%+ faster output; up to 30% less cost per task via fewer tokens — list price unchanged vs Sonnet 5). Claude API id claude-sonnet-5-5. List price $2 per 1M input and $10 per 1M output; cache reads $0.10 / MTok; 5m cache writes $2.50; 1h cache writes $4; Batch API 50% off ($1/$5). 1M-token context, 128K max output (Batch API beta up to 300K), adaptive thinking (default effort high; between_tools turns off up-front thinking), text and image input to text output, vision, tool use. Available on Claude apps and on Claude API, Amazon Bedrock, Google Cloud, Microsoft Foundry, and Claude Platform on AWS. Reliable knowledge cutoff June 2026.

    55.5%

    CursorBench v4.0 (highest effort)

  • #5Claude Fable 5.1Verify pricing

    Anthropic's generally available Mythos-class model for demanding reasoning, long-horizon agents, and ambitious coding, released September 1, 2026. Same underlying model as Claude Mythos 5.1 with cybersecurity and biology safeguards (flagged queries route to Opus 4.8 for cyber and Opus 5 for biology; those reroutes are not billed at Fable prices). Claude API id claude-fable-5-1. List price $10 per 1M input tokens and $50 per 1M output tokens; cache reads $0.25 per 1M (0.025x base input, 75% less than Fable 5's $1.00). 1M-token context, 128K max output, adaptive thinking always on (default effort high), text and image input to text output, vision, tool use. Available to Pro, Max, Team, and Enterprise users and on the Claude Platform natively, Amazon Bedrock, Google Cloud, Microsoft Foundry, and Claude Platform on AWS. Reliable knowledge cutoff June 2026.

    51.8%

    CursorBench v4.0 (highest effort)

  • Claude Opus 5 is Anthropic's July 2026 flagship Opus model for complex agentic coding, enterprise work, long-horizon reasoning, computer use, and professional analysis. It accepts text and image input and returns text, with adaptive thinking enabled by default and five request-level effort settings from low through max that control thinking depth and token use rather than visible response length. It also supports tool use, structured outputs, prompt caching, Batch API, a 1M-token context window, and up to 128K synchronous output tokens. Anthropic lists standard Claude API pricing at $5 per million input tokens and $25 per million output tokens, with Fast mode at $10/$50. It is available through the Claude API and hosted provider routes.

    46.6%

    CursorBench v4.0 (highest effort)

Compare Top Picks

Side-by-side comparison of the top picks by price, benchmark, and API access.

Frequently asked questions

What is the best LLM for code generation?

LLM Reference's top pick for code generation as of 2026-11-13 is Gemini 4 Carbon by Google DeepMind, with CursorBench v4.0 (highest effort) 60.4%. Picks come from models that meet the podium eligibility rules, so the top pick may not lead the full table. Second pick: Claude Fable 5.2 by Anthropic (CursorBench v4.0 (highest effort) 60%).

Which ranked LLM for code generation has the lowest output price?

Among the ranked models shown on this page, GPT-5.6 Luna by OpenAI has the lowest listed output price: $1.20/1M output tokens, at rank 13.

How is the code generation ranking calculated?

Coding models rank first on CursorBench v4.0. Models without a CursorBench score follow on SWE-bench Verified, then HumanEval, then SWE-bench Pro, with newer release as the last tie-break. Preview, restricted, retired and retiring models never fill a podium slot. Preview means preview or invite-only access, or a model that is announced or pre-release. Restricted means restricted, partner, private or otherwise unavailable access. Retired means the model is past its retirement date or every provider route is retired. Retiring means the model, or any one of its provider routes, has a retirement date within the next 60 days. These models can still appear in the table below the podium.

How often is this page updated?

Weekly. Last refreshed 2026-11-13.