Published 07 Aug 202611 min read

The Cheapest Coding Model Is the One That Gets the Change Accepted

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:

  1. Inference cost: what the provider charges for input, cached input, and output.
  2. Task success: what the model-plus-agent system resolves on relevant software benchmarks.
  3. 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

NeedMy defaultWhy
Best temporary price-performanceGPT-5.6 Terra through OpenRouterThe 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 defaultClaude Sonnet 5 direct from AnthropicIts 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 setClaude Opus 5It reports the highest SWE-bench Verified, Pro, Multilingual, and Multimodal results in this comparison.
Best open-weight frontier optionKimi K3 direct from MoonshotIt combines open weights, a one-million-token context, provider choice, and strong long-horizon coding scores.
Best current OpenAI coding capabilityGPT-5.6 Sol direct from OpenAIIt leads the reported DeepSWE and Terminal-Bench results in this set, but it carries a frontier price.
Cheapest narrow OpenAI helperGPT-5.6 Luna direct from OpenAIAt $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.

ModelInput / cached / outputContextReference workloadCheapest practical provider checked
Kimi K3Moonshot: $3.00 / $0.30 / $15.00; OpenRouter: $2.50 / — / $14.001.048MMoonshot: $30.00; OpenRouter: $27.96 including its 5.5% funded-account feeOpenRouter is cheapest; Moonshot is canonical
Claude Opus 5$5.00 / $0.50 / $25.001M$50.00Anthropic 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.001M$20.00 now; $30.00 standardAnthropic direct, AWS, and Bedrock tie at list price
GPT-5.6 Sol$5.00 / $0.50 / $30.001.05M$55.00OpenAI direct; Azure ties at list price
GPT-5.6 TerraOpenAI: $2.00 / $0.20 / $12.00; OpenRouter promotion: $1.00 / — / $6.001.05MOpenAI: $22.00; OpenRouter: $11.61 including its 5.5% funded-account feeOpenRouter while the displayed promotion lasts
GPT-5.6 Luna$0.20 / $0.02 / $1.201.05M$2.20OpenAI direct; its reduced first-party rate is below OpenRouter's displayed promotion
GPT-5.4 mini$0.75 / $0.075 / $4.50400K$8.25OpenAI direct; Azure ties at list price
GPT-5.4 nano$0.20 / $0.02 / $1.25400K$2.25OpenAI 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.

ModelReference workloadSWE-bench VerifiedSWE-bench ProMultilingualMultimodal
Kimi K3$27.96 through OpenRouterNRNRNRNR
Claude Opus 5$50.0096.079.289.559.4
Claude Sonnet 5$20.00 current85.263.278.328.1
GPT-5.6 Sol$55.00NR64.6NRNR
GPT-5.6 Terra$11.61 promotionalNR63.4NRNR
GPT-5.6 Luna$2.20 directNR62.7NRNR
GPT-5.4 mini$8.25NR54.4NRNR
GPT-5.4 nano$2.25NR52.4NRNR

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:

BenchmarkWhat it testsHow I use it
SWE-bench Verified500 human-verified GitHub issuesA familiar baseline, now close to saturation for frontier systems
SWE-bench ProHarder tasks, larger multi-file changes, and less public answer leakageMy primary current SWE-bench signal
SWE-bench Multilingual300 tasks across nine programming languagesA better signal for estates that are not mostly Python
SWE-bench MultimodalIssues that include screenshots and design mock-upsRelevant 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.

ModelDeepSWE v1.1FrontierSWESWE-MarathonFrontierCodeTerminal-Bench 2.1
Kimi K367.5 with Kimi Code81.242.0NR88.3
Claude Opus 568.8NRNR53.4NR
Claude Sonnet 5NRNRNR38.880.4
GPT-5.6 Sol72.771.339.047.588.8
GPT-5.6 Terra69.6NRNRNR87.4
GPT-5.6 Luna67.2NRNRNR84.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

ModelCheapest conclusionMy route
Kimi K3OpenRouter 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 5Anthropic, 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 5Anthropic, AWS, and Bedrock tie at the current promotional rate.Anthropic direct through 31 August, then re-evaluate.
GPT-5.6 SolOpenAI and Azure tie at list price.OpenAI direct, unless Azure controls are the requirement.
GPT-5.6 TerraOpenRouter currently undercuts OpenAI even after its funded-account fee.OpenRouter promotion, with an automatic price check and first-party fallback.
GPT-5.6 LunaOpenAI's current $0.20 / $1.20 first-party rate undercuts OpenRouter's displayed $0.50 / $3 promotion.OpenAI direct.
GPT-5.4 mini / nanoOpenAI 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

TaskDefaultEscalationCheap supporting model
Small, explicit editGPT-5.6 Luna direct or GPT-5.4 miniSonnet 5GPT-5.4 nano
Normal feature or bugGPT-5.6 Terra promotion or Sonnet 5Opus 5 or GPT-5.6 SolGPT-5.4 mini
Ambiguous root-cause workOpus 5GPT-5.6 Sol as an independent attemptTerra or Sonnet 5 for review
Very long context or open-weight requirementKimi K3Opus 5A smaller local or hosted model after evaluation
Parallel mechanical reviewGPT-5.4 nano or miniTerra 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.