Skip to main content

Best LLMs for Coding Agents

Start with the tier each vendor recommends for software work, then step down to a cheaper model wherever your own tests still pass.

A coding agent calls the model once per step, often hundreds of times per task, and resends the conversation each time. Price per token, cached-input price and context limits decide what a task costs. This page compares the current models from Anthropic, OpenAI and Google with the leading open-weight models. Figures were checked against each provider's official model and pricing pages in November 2026 and will change, so confirm them before you commit.

Frontier Models at a Glance​

Prices are standard API list prices in US dollars per million tokens.

ModelVendorReleasedInputOutputContext windowMax output
Claude Fable 5.2AnthropicNov 9, 2026$8$401M128K
Claude Opus 5.5AnthropicSep 22, 2026$4$201M128K
Claude Sonnet 5.5AnthropicSep 28, 2026$2$101M128K
Claude Haiku 5.5AnthropicOct 7, 2026$0.10$0.501M128K
GPT-6 AstraOpenAISep 3, 2026$10$501.05M128K
GPT-6.1 SolOpenAISep 29, 2026$2$101.05M128K
GPT-6.1 TerraOpenAIOct 26, 2026$1$51.05M128K
GPT-6 LunaOpenAISep 22, 2026$0.10$0.501.05M128K
Gemini 4 CarbonGoogleNov 10, 2026$2, then $4$10, then $201M64K, up to 1M
Gemini 4 ArgonGoogleOct 13, 2026$2, then $4$10, then $201M64K, up to 1M
Gemini 4 HydrogenGoogleNov 12, 2026$1.50$7.501M64K, up to 1M

Several prices carry conditions. Claude Haiku 5.5 costs $0.50 and $2.50 once a prompt passes 100,000 tokens. OpenAI charges 2x input and 1.5x output for the whole request once a prompt passes 272K tokens, and caps input at 922,000 tokens. Gemini 4 Carbon and Argon are on introductory pricing through November 30, 2026, and the higher price applies from December 1.

Gemini 4 models share one 1,048,576-token window between input, thinking and output. A response stops at 65,536 tokens by default and can run up to the full window with Google's long decode feature.

Open-Weight Models at a Glance​

Open-weight models publish their weights, so you can run them on your own GPUs or call the vendor's hosted API. The prices below are for the vendor's own API.

ModelVendorLicenseInputOutputContext window
Kimi K3.1 ProMoonshot AIKimi K3.1 Pro License$2$101M
DeepSeek-V4-Pro-0813DeepSeekMIT$1.32$3.961M
DeepSeek-V4.1-Flash-1017DeepSeekMIT$0.30$1.201M
GLM-5.3Z.aiGLM-5.3 License$1.40$4.401M
GLM-5.3-FlashZ.aiMIT$0.15$0.501M
Qwen3.8-MaxQwenQwen3.8-Max License$2$61M hosted, 262K native
MiniMax-M3.1-FlashMiniMaxMiniMax Community License$0.15$0.601M

DeepSeek prices are peak rates. Off-peak rates are half. The MIT models carry the standard MIT terms. The other licenses add revenue thresholds, attribution or a separate agreement for some businesses. Best Open-Weight Coding Models covers each license and the vendors' own benchmark claims.

Cached Input Decides the Bill​

An agent's request repeats everything from earlier turns: the system prompt, tool definitions, files it read and its own past tool calls. Providers bill a repeated prefix at a cache rate far below the normal input price. On a long session the cached-input price matters as much as the headline input price.

ModelCached input per 1M tokens
Claude Fable 5.2$0.20
Claude Opus 5.5$0.20
Claude Sonnet 5.5$0.10
GPT-6 Astra$1
GPT-6.1 Sol$0.10
Gemini 4 Carbon and Argon$0.10, then $0.20
Kimi K3.1 Pro$0.20
DeepSeek-V4.1-Flash-1017$0.006 peak

Cache writes cost extra on most of these APIs. Anthropic charges 1.25x the input price for a 5-minute cache write and 2x for a 1-hour write. OpenAI charges 1.25x for its standard cache write. Gemini 4 models support only implicit caching, so you cannot pin a prefix in the cache yourself.

Reasoning Effort Changes the Price Too​

Every current frontier model exposes an effort or thinking-level setting. Higher effort spends more tokens per step and takes longer. The default differs by model, so the same prompt can cost more on one model only because of its default.

ModelDefault effort
Claude Fable 5.2high
Claude Opus 5.5medium
Claude Sonnet 5.5high
GPT-6.1 Solmedium
Gemini 4 Carbon and Argonmedium
Gemini 4 Hydrogenhigh

Set effort explicitly in your agent configuration, then compare models at matched settings. Google states that Gemini 4 output prices include thinking tokens.

Where Each Model Runs​

Most teams pick a model through a coding tool, the program that runs the agent loop. Claude Code, Codex and GitHub Copilot are the common ones.

Coding toolModels it documents
Claude CodeAnthropic models. On the Anthropic API its opus alias resolves to Claude Opus 5.5, and /model fable selects Fable 5.2.
CodexThe GPT-6 family, for example codex -m gpt-6.1-sol.
GitHub CopilotClaude Fable 5.2, Opus 5.5, Sonnet 5.5, GPT-6 Astra, GPT-6.1 Sol, all three Gemini 4 models and the open-weight Kimi K3, all generally available.
Antigravity agentGemini 4 Hydrogen by default, in Gemini Managed Agents.

Open-weight vendors work with these tools too. Moonshot AI, DeepSeek and MiniMax accept Anthropic-format requests, and Moonshot and DeepSeek document Claude Code setup. Z.ai sells a coding plan for Claude Code, Cline, OpenCode and Kilo Code.

On cloud platforms, Claude models run on Amazon Bedrock, Google Cloud and Microsoft Foundry. GPT-6 models run on Amazon Bedrock, and on Google Cloud in private preview.

How to Choose​

The right model depends on the task, so treat vendor tiers as starting points. Anthropic's docs tell you to start with Claude Opus 5.5 and move to Fable 5.2 only when evals at higher effort still fall short. OpenAI's docs start you on GPT-6 Astra and offer GPT-6.1 Sol to cut cost. Google's docs point most software engineering to Gemini 4 Argon and the hardest debugging and design work to Carbon.

WorkModels to try first
Long autonomous runs on hard problemsClaude Fable 5.2, GPT-6 Astra or Gemini 4 Carbon. These cost the most, so keep them for tasks where cheaper models fail.
Everyday agent loopsClaude Opus 5.5, Claude Sonnet 5.5, GPT-6.1 Sol or Gemini 4 Argon, at $2 to $4 per million input tokens.
Subagents and bulk work such as search, log summaries and simple editsClaude Haiku 5.5, GPT-6 Luna, Gemini 4 Hydrogen, GLM-5.3-Flash or DeepSeek's deepseek-flash endpoint.
Self-hosting or strict data controlAn open-weight model whose license fits your business.

Benchmark tables from vendors use different agent setups and settings, so they do not rank models for your repository. Build a small eval instead: 20 to 50 closed issues from your own codebase, each with a test that fails before the fix. Run every candidate at matched effort and compare cost per passing task.

If you are new to agent workflows, start with what coding agents are and how quality gates decide whether an agent's change passes. Running coding agents in parallel multiplies model cost, so price per task matters more as you scale.

Next Steps​