Overview
The cheapest coding model is not the one with the cheapest tokens. It is the one that produces an accepted change with the least total waste.
That distinction matters. A model can be cheap per million tokens and expensive per finished task. It can loop, miss the root cause, break tests, and hand the cleanup back to me. Another model can cost five times more per token and still be cheaper because it gets the change right once.
I compare models through three numbers:
- Inference cost: what the provider charges for input, cached input, and output.
- Task success: what the model-plus-agent system resolves on relevant software benchmarks.
- Acceptance cost: model spend plus review time, repair time, regressions, and retries.
The first two are public. The third is the decision.
Prices and provider offers below were checked on 7 August 2026. They will move. The decision method should not.
The answer first
| Need | My default | Why |
|---|---|---|
| Best temporary price-performance | GPT-5.6 Terra through OpenRouter | The current promotion is below first-party list price, while reported SWE-bench Pro and terminal results remain close to the frontier. I treat the offer as temporary. |
| Best cheap first-party default | Claude Sonnet 5 direct from Anthropic | Its introductory price runs through 31 August 2026. It combines strong software results with a lower current task cost than Kimi K3. |
| Best hard-task model in this set | Claude Opus 5 | It reports the highest SWE-bench Verified, Pro, Multilingual, and Multimodal results in this comparison. |
| Best open-weight frontier option | Kimi K3 direct from Moonshot | It combines open weights, a one-million-token context, provider choice, and strong long-horizon coding scores. |
| Best current OpenAI coding capability | GPT-5.6 Sol direct from OpenAI | It leads the reported DeepSWE and Terminal-Bench results in this set, but it carries a frontier price. |
| Cheapest narrow OpenAI helper | GPT-5.6 Luna direct from OpenAI | At $0.20 input and $1.20 output, it is now cheaper than GPT-5.4 nano. I use it for mechanical edits, extraction, and triage, not as the owner of ambiguous work. |
My routing rule is simple: use the cheapest model that consistently clears the quality floor. Escalate when ambiguity and failure cost rise.
Current API price
All prices are USD per one million tokens. The reference workload is 5 million uncached input tokens plus 1 million output tokens. That is an intentionally input-heavy agent workload, not a universal coding task.
| Model | Input / cached / output | Context | Reference workload | Cheapest practical provider checked |
|---|---|---|---|---|
| Kimi K3 | Moonshot: $3.00 / $0.30 / $15.00; OpenRouter: $2.50 / — / $14.00 | 1.048M | Moonshot: $30.00; OpenRouter: $27.96 including its 5.5% funded-account fee | OpenRouter is cheapest; Moonshot is canonical |
| Claude Opus 5 | $5.00 / $0.50 / $25.00 | 1M | $50.00 | Anthropic direct, AWS, and Bedrock tie at list price |
| Claude Sonnet 5 | $2.00 / $0.20 / $10.00 through 31 Aug; then $3.00 / $0.30 / $15.00 | 1M | $20.00 now; $30.00 standard | Anthropic direct, AWS, and Bedrock tie at list price |
| GPT-5.6 Sol | $5.00 / $0.50 / $30.00 | 1.05M | $55.00 | OpenAI direct; Azure ties at list price |
| GPT-5.6 Terra | OpenAI: $2.00 / $0.20 / $12.00; OpenRouter promotion: $1.00 / — / $6.00 | 1.05M | OpenAI: $22.00; OpenRouter: $11.61 including its 5.5% funded-account fee | OpenRouter while the displayed promotion lasts |
| GPT-5.6 Luna | $0.20 / $0.02 / $1.20 | 1.05M | $2.20 | OpenAI direct; its reduced first-party rate is below OpenRouter's displayed promotion |
| GPT-5.4 mini | $0.75 / $0.075 / $4.50 | 400K | $8.25 | OpenAI direct; Azure ties at list price |
| GPT-5.4 nano | $0.20 / $0.02 / $1.25 | 400K | $2.25 | OpenAI direct; Azure ties at list price |
The primary price references are Moonshot's Kimi K3 pricing, Anthropic's API pricing, and OpenAI's current model pages for Sol, Terra, and Luna. Provider comparisons use Fireworks, Together, Baseten, OpenRouter's Kimi K3 page, and OpenRouter's fee policy.
The table does not include taxes, subscriptions, enterprise discounts, batch discounts, or premium-speed tiers. Those are different purchasing decisions.
Price beside SWE-bench score
The next table puts the same reference workload beside four SWE-bench variants. Higher scores are better. NR means the cited release did not report the result. It does not mean zero.
| Model | Reference workload | SWE-bench Verified | SWE-bench Pro | Multilingual | Multimodal |
|---|---|---|---|---|---|
| Kimi K3 | $27.96 through OpenRouter | NR | NR | NR | NR |
| Claude Opus 5 | $50.00 | 96.0 | 79.2 | 89.5 | 59.4 |
| Claude Sonnet 5 | $20.00 current | 85.2 | 63.2 | 78.3 | 28.1 |
| GPT-5.6 Sol | $55.00 | NR | 64.6 | NR | NR |
| GPT-5.6 Terra | $11.61 promotional | NR | 63.4 | NR | NR |
| GPT-5.6 Luna | $2.20 direct | NR | 62.7 | NR | NR |
| GPT-5.4 mini | $8.25 | NR | 54.4 | NR | NR |
| GPT-5.4 nano | $2.25 | NR | 52.4 | NR | NR |
Sources: Moonshot's Kimi K3 report, Claude Opus 5 system card, Claude Sonnet 5 system card, OpenAI GPT-5.6 evaluations, and OpenAI GPT-5.4 mini and nano evaluations.
The benchmark names look similar. The work is not identical:
| Benchmark | What it tests | How I use it |
|---|---|---|
| SWE-bench Verified | 500 human-verified GitHub issues | A familiar baseline, now close to saturation for frontier systems |
| SWE-bench Pro | Harder tasks, larger multi-file changes, and less public answer leakage | My primary current SWE-bench signal |
| SWE-bench Multilingual | 300 tasks across nine programming languages | A better signal for estates that are not mostly Python |
| SWE-bench Multimodal | Issues that include screenshots and design mock-ups | Relevant to frontend and visually specified work |
A one-point difference across vendors is not a one-point product advantage. Anthropic and OpenAI use different agent harnesses, tool settings, reasoning budgets, and trial aggregation. OpenAI now says Verified is contaminated and no longer meaningful, and its audit found about 30% of SWE-bench Pro tasks broken. The measured unit is the model plus harness, not the weights alone. I use the scores as directional evidence, not clean model rankings. See OpenAI's Verified warning and SWE-bench Pro audit.
Long-horizon coding changes the ranking
SWE-bench usually ends with one repository patch. Real agents also have to navigate terminals, recover from failed commands, maintain state, and work for longer. That is why I also look at newer agent evaluations.
| Model | DeepSWE v1.1 | FrontierSWE | SWE-Marathon | FrontierCode | Terminal-Bench 2.1 |
|---|---|---|---|---|---|
| Kimi K3 | 67.5 with Kimi Code | 81.2 | 42.0 | NR | 88.3 |
| Claude Opus 5 | 68.8 | NR | NR | 53.4 | NR |
| Claude Sonnet 5 | NR | NR | NR | 38.8 | 80.4 |
| GPT-5.6 Sol | 72.7 | 71.3 | 39.0 | 47.5 | 88.8 |
| GPT-5.6 Terra | 69.6 | NR | NR | NR | 87.4 |
| GPT-5.6 Luna | 67.2 | NR | NR | NR | 84.7 |
Sources: Moonshot's Kimi K3 model report, the two Anthropic system cards above, and OpenAI's GPT-5.6 evaluation report.
I do not average these columns. FrontierSWE, SWE-Marathon, FrontierCode, DeepSWE, and Terminal-Bench measure different task distributions. An average would look precise and mean very little.
The cheapest provider for each model
| Model | Cheapest conclusion | My route |
|---|---|---|
| Kimi K3 | OpenRouter lists $2.50 / $14 before its funded-account fee, below Moonshot's $3 / $15. | OpenRouter for minimum price; Moonshot direct when canonical behaviour is worth the small premium. |
| Claude Opus 5 | Anthropic, AWS, and Bedrock tie at $5 / $25. Google's multi-region endpoint is higher. | Anthropic direct, unless cloud controls, credits, or residency justify another route. |
| Claude Sonnet 5 | Anthropic, AWS, and Bedrock tie at the current promotional rate. | Anthropic direct through 31 August, then re-evaluate. |
| GPT-5.6 Sol | OpenAI and Azure tie at list price. | OpenAI direct, unless Azure controls are the requirement. |
| GPT-5.6 Terra | OpenRouter currently undercuts OpenAI even after its funded-account fee. | OpenRouter promotion, with an automatic price check and first-party fallback. |
| GPT-5.6 Luna | OpenAI's current $0.20 / $1.20 first-party rate undercuts OpenRouter's displayed $0.50 / $3 promotion. | OpenAI direct. |
| GPT-5.4 mini / nano | OpenAI and Azure tie at global list price. | OpenAI direct. |
Provider choice is not only billing. An open-weight model can change with quantization, inference engine, context implementation, and tool-call support. Moonshot's vendor verifier reports 67.5 on DeepSWE for Moonshot and 66.4 for Fireworks in its current K3 table. The difference is small. When price is tied, small is enough.
The cost traps
The headline rate hides the bill.
- Reasoning tokens are output tokens. High-effort runs can multiply the expensive side of the workload.
- Cache price is not cache value. It helps only when the agent preserves reusable prefixes and the provider records real hits.
- Promotions are routing inputs, not architecture. Sonnet 5's introductory rate has an end date. OpenRouter's Terra discount has no public expiry. I build a fallback before I build a dependency.
- Tokenizers differ. Equal text does not mean equal token count across model families.
- Retries compound. A model that fails after a long reasoning trace pays the output bill and still leaves the task unfinished.
- The provider is part of the system. Rate limits, cold starts, tool schemas, context truncation, and model substitutions affect delivered quality.
This is why price-per-token is the beginning of the calculation, not the end.
My routing policy
| Task | Default | Escalation | Cheap supporting model |
|---|---|---|---|
| Small, explicit edit | GPT-5.6 Luna direct or GPT-5.4 mini | Sonnet 5 | GPT-5.4 nano |
| Normal feature or bug | GPT-5.6 Terra promotion or Sonnet 5 | Opus 5 or GPT-5.6 Sol | GPT-5.4 mini |
| Ambiguous root-cause work | Opus 5 | GPT-5.6 Sol as an independent attempt | Terra or Sonnet 5 for review |
| Very long context or open-weight requirement | Kimi K3 | Opus 5 | A smaller local or hosted model after evaluation |
| Parallel mechanical review | GPT-5.4 nano or mini | Terra or Sonnet 5 for judgement | — |
The policy has one failure mode: keeping a cheap model in a loop after it has demonstrated that it does not understand the task. Cheap retries feel prudent. They are usually denial.
I escalate when any of these appears:
- the task crosses several subsystems;
- the failure is nondeterministic;
- the repository has weak tests;
- the change is security-sensitive;
- the first attempt fixes a symptom instead of the cause;
- reviewer time costs more than the model difference.
Measure accepted changes, not benchmark theatre
Public benchmarks narrow the search. A private evaluation makes the decision.
I would take 30–100 representative tasks and record:
- first-pass task success;
- human cleanup minutes;
- regressions introduced;
- tool-call and schema failures;
- wall-clock time;
- uncached input, cached input, reasoning, and final-output tokens;
- provider cost;
- whether the final change was accepted.
Then I would calculate:
cost per accepted change
= model spend
+ reviewer time
+ repair time
+ regression cost
+ failed-run cost
That number can reverse the public ranking. It should. My repository, agent scaffold, tests, and definition of “done” are not a vendor benchmark.
The decision rule is direct: route by the lowest cost per accepted change at the required risk level. Cheapest tokens are not cheapest engineering.