Cheapest AI API for coding in 2026, by quality level
Updated 2026-11-14. Direct list prices from official pages, ranks from LMArena Code Arena.
The cheapest AI API for coding is MiMo-V2.6 Flash at $0.17 per 1M tokens blended, and it ranks #20 of 53 on Code Arena. DeepSeek V4.1 Flash is the best coder under $1 (#15, $0.53). For a top 10 model, GPT-6.1 Terra is cheapest at $2; for a top 3 model, Claude Sonnet 5.5 at $4. Claude Fable 5.2 leads the board at $16.
Cheapest coding model at each quality level
| Quality you want | Cheapest model | Input / output per 1M | Blended per 1M | One agent task (estimate) |
|---|---|---|---|---|
| Top 3 on Code Arena | Claude Sonnet 5.5 #3 | $2 / $10 | $4 | $0.79 |
| Top 5 on Code Arena | Claude Sonnet 5.5 #3 or Gemini 4 Carbon #4 | $2 / $10 | $4 | $0.79 |
| Top 10 on Code Arena | Gemini 4 Hydrogen #8 | $1.50 / $7.50 | $3 | $0.59 |
| Top 15 on Code Arena | DeepSeek V4.1 Flash #15 | $0.30 / $1.20 | $0.53 | $0.095 |
| Top 20 to 30 on Code Arena | MiMo-V2.6 Flash #20 | $0.14 / $0.28 | $0.17 | $0.031 |
Rank is the model's place among the 53 models we price on LMArena's Code Arena (published 2026-11-11). Blended is (3 x input + output) / 4. "One agent task" is our estimate, explained below. * Price not re-verified on the official page today.
What one coding agent task costs (our estimate)
Coding agents resend your files and the conversation on every step, so most of what you pay for is input, and most of that input repeats. Providers charge far less for repeated input that hits their prompt cache. That makes the cached-input price the number to watch for agent work, more than the headline input price.
To compare like for like, we priced one long agent task: 100K fresh input tokens, 900K cached input tokens and 50K output tokens. These inputs are our assumption, not a measurement, and real tasks vary a lot. Cache-write fees are left out: Anthropic charges more than the normal input price to write its cache (Kimi does for its 1-hour cache), so those models cost a little more than shown.
On those inputs, MiMo-V2.6 Flash is cheapest at about $0.031 per task, and Claude Fable 5.2, the top model on Code Arena, costs about $2.98. That is roughly 98x more for the best score on the board.
Qwen3.8 Max and Qwen3.8 27B have no public cache-hit price, so their estimate assumes no cache discount.
Which cheap coding API should you pick?
- Lowest bill that still codes well: MiMo-V2.6 Flash is #20 on Code Arena at $0.17 per 1M tokens blended. Good for bulk edits, tests and quick fixes.
- Best quality under $1: DeepSeek V4.1 Flash is #15 at $0.53 blended, with a cached-input price of $0.006. DeepSeek says off-peak use is half price, see DeepSeek off-peak hours.
- Cheapest top 10 model: GPT-6.1 Terra is #12 at $2 blended. A sensible default if you want a frontier lab model without frontier prices.
- Cheapest top 3 model: Claude Sonnet 5.5 is #3 at $4 blended, against $16 for Claude Fable 5.2, the top of the board.
Our take: run routine work on a cheap model and switch to a top 5 model only for the hard bugs and big refactors. If your coding tool lets you change models, that split alone can cut the bill by several times.
Is a subscription cheaper than the API for coding?
Often, if you code every day. Claude Code, Codex and Cursor plans bundle a lot of usage for a flat monthly price, while the API bills every token. Run your own numbers in the plan vs API calculator, or read Claude Pro vs API cost. If you already have a plan and hit its weekly cap, the cheapest way to keep going is in Claude weekly limit: cheapest API fallback and Codex weekly limit: cheapest API fallback.
Head to head: DeepSeek V4.1 Flash vs Claude Haiku 5.5, GPT-6.1 Terra vs DeepSeek V4.1 Flash, GPT-6.1 Sol vs Claude Sonnet 5.5. Want it on your own machine instead? See the best local LLM for coding.
Prices that change soon
- Gemini 4 Carbon: Launch price through Nov 30, 2026. From Dec 1: $4 in, $20 out. Implicit caching only. Not on the Free tier. Public API from Nov 10, 2026. (per Google's pricing page)
- Gemini 4 Argon: Launch price through Nov 30, 2026. From Dec 1: $4 in, $20 out. (per Google's pricing page)
- Gemini 3.8 Flash: Through Dec 31, 2026. From Jan 1, 2027: $1.50 in, $7.50 out. (per Google's pricing page)
Every Code Arena model we price, cheapest first
| Model | Code Arena | Input | Cached input | Output | Blended | Agent task |
|---|---|---|---|---|---|---|
| MiMo-V2.6 Flash Xiaomi MiMo | #20 | $0.14 | $0.0028 | $0.28 | $0.17 | $0.031 |
| Claude Haiku 5.5 Anthropic | #26 | $0.10 | $0.01 | $0.50 | $0.20 | $0.044 |
| GPT-6 Luna OpenAI | #30 | $0.10 | $0.01 | $0.50 | $0.20 | $0.044 |
| GLM-5.3 Flash GLM (Z.ai) | #24 | $0.15 | $0.03 | $0.50 | $0.24 | $0.067 |
| MiniMax-M3.1 Flash MiniMax | #28 | $0.15 | $0.015 | $0.60 | $0.26 | $0.058 |
| DeepSeek V4.1 Flash DeepSeek | #15 | $0.30 | $0.006 | $1.20 | $0.53 | $0.095 |
| MiMo-V2.6 Pro Xiaomi MiMo | #22 | $0.43 | $0.0036 | $0.87 | $0.54 | $0.09 |
| Mistral Large 4 Mistral | #32 | $0.70 | $0.07 | $2.10 | $1.05 | $0.24 |
| Qwen3.8 27B Qwen | #27 | $0.50 | n/a | $3 | $1.12 | $0.65 |
| Hunyuan Hy4 Preview Tencent Hunyuan | #21 | $0.83 | $0.042 | $2.50 | $1.25 | $0.25 |
| Step 5 Preview StepFun | #31 | $1 | $0.10 | $2.70 | $1.43 | $0.33 |
| Gemini 3.8 Flash | #29 | $0.75 | $0.075 | $3.75 | $1.50 | $0.33 |
| GPT-6.1 Terra OpenAI | #12 | $1 | $0.05 | $5 | $2 | $0.40 |
| Muse Spark 1.3 Meta | #17 | $1.25 | $0.15 | $4.25 | $2 | $0.47 |
| GLM-5.3 GLM (Z.ai) | #23 | $1.40 | $0.26 | $4.40 | $2.15 | $0.59 |
| GLM-5.2 GLM (Z.ai) | #25 | $1.40 | $0.26 | $4.40 | $2.15 | $0.59 |
| Gemini 4 Hydrogen | #8 | $1.50 | $0.075 | $7.50 | $3 | $0.59 |
| Qwen3.8 Max Qwen | #13 | $2 | n/a | $6 | $3 | $2.30 |
| Grok 4.7 xAI | #19 | $2 | $0.50 | $6 | $3 | $0.95 |
| Claude Sonnet 5.5 Anthropic | #3 | $2 | $0.10 | $10 | $4 | $0.79 |
| Gemini 4 Carbon | #4 | $2 | $0.10 | $10 | $4 | $0.79 |
| GPT-6.1 Sol OpenAI | #6 | $2 | $0.10 | $10 | $4 | $0.79 |
| Kimi K3.1 Pro Kimi | #10 | $2 | $0.20 | $10 | $4 | $0.88 |
| Gemini 4 Argon | #11 | $2 | $0.10 | $10 | $4 | $0.79 |
| GPT-6 Sol OpenAI | #14 | $2 | $0.20 | $10 | $4 | $0.88 |
| Kimi K3 Kimi | #16 | $3 | $0.30 | $15 | $6 | $1.32 |
| Claude Opus 5.5 Anthropic | #2 | $4 | $0.20 | $20 | $8 | $1.58 |
| Muse Wonder 1.0 Meta | #18 | $4 | $0.20 | $20 | $8 | $1.58 |
| Claude Opus 5 Anthropic | #9 | $5 | $0.50 | $25 | $10 | $2.20 |
| Claude Fable 5.2 Anthropic | #1 | $8 | $0.20 | $40 | $16 | $2.98 |
| GPT-6 Astra OpenAI | #5 | $10 | $1 | $50 | $20 | $4.40 |
| Claude Fable 5.1 Anthropic | #7 | $10 | $0.25 | $50 | $20 | $3.73 |
USD per 1M tokens, standard tier, direct list price from each provider's official pricing page (see our API prices table for sources and check dates). Models ranked below the 50th place on the full board are left out. n/a means the provider doesn't publish a cache-hit price, so the estimate uses the full input price. Some models charge more per token once a single prompt passes a size limit (for example 272K tokens on GPT-6 Astra and GPT-6.1 Sol, 100K on Claude Haiku 5.5); the table uses the short-prompt rate.
How we rank
Quality is each model's Code Arena score from LMArena, built from blind side by side votes on real web app and agentic coding tasks. Where a model is listed at several effort levels we use its best one, which can cost more tokens than the default. Close ranks are often inside the margin of error. Prices are direct list prices; resellers and routers may charge differently. Our best model for coding page shows the same scores as a 0 to 100 relative score.
Sources
- LMArena Code Arena leaderboard (CC BY 4.0), published 2026-11-11
- Anthropic API pricing (official)
- DeepSeek API pricing (official)
- GLM (Z.ai) API pricing (official)
- Google API pricing (official)
- Kimi API pricing (official)
- Meta API pricing (official)
- MiniMax API pricing (official)
- Mistral API pricing (official)
- OpenAI API pricing (official)
- Qwen API pricing (official)
- StepFun API pricing (official)
- Tencent Hunyuan API pricing (official)
- xAI API pricing (official)
- Xiaomi MiMo API pricing (official)
FAQ
What is the cheapest AI API for coding?
MiMo-V2.6 Flash, at $0.14 input and $0.28 output per 1M tokens. It ranks #20 of 53 models we price on Code Arena.
What is the cheapest good model for coding?
DeepSeek V4.1 Flash is the best Code Arena model under $1 per 1M tokens blended (#15, $0.53). GPT-6.1 Terra is the cheapest top 10 model at $2.
Is Claude too expensive for coding on the API?
Not always. Claude Sonnet 5.5 is #3 on Code Arena at $4 blended, the cheapest top 3 model. Claude Fable 5.2 is the top model but costs $16 blended, so save it for the hardest work.
Why does the cached input price matter for coding?
Coding agents resend the same files and history on every step, so most input repeats. Cache hits are billed at a fraction of the normal input price, which cuts an agent bill sharply.
Is the API cheaper than Claude Code or Codex plans?
For light or bursty use, usually yes. For daily heavy coding a flat plan often costs less. Our plan vs API calculator shows the break-even for your usage.
Where do these rankings come from?
LMArena's Code Arena leaderboard, published 2026-11-11, which ranks models by blind human votes on coding tasks. Prices come from each provider's official pricing page.
Related
- DeepSeek OCR, TTS and ASR API pricing
- Hunyuan Hy4 vs DeepSeek V4 Pro: API price and quality
- Muse Ember vs Claude Haiku 5.5: API price and quality
- Gemini 4 Hydrogen limits and pricing
- Best model for coding
- Cheapest LLM API, all models
- API prices for every model
- Plan vs API calculator
- Best local LLM for coding
- DeepSeek off-peak hours
- Best Chinese LLM API
- Claude weekly limit: cheapest API fallback
- Codex weekly limit: cheapest API fallback
- Claude Code plans and limits
More guides
- DeepSeek vs Claude API cost
- Grok API pricing explained
- Kimi API pricing explained
- MiniMax API pricing explained
- OpenAI vs Anthropic API pricing
- OpenAI vs Gemini API pricing
Not sure a plan beats the API for you? Try the plan vs API cost calculator.