Skip to content

COMPARISONS

Best AI Model for Coding: What the Price Cards Say

The best AI model for coding cannot be ranked from here, but one real turn priced on nine cards can. The spread is 10.5x, and one vendor's own tool disagrees with its card.

The best AI model for coding is not something this site can rank, and the reason is that nobody publishes the thing you would need to rank it. What is measurable, and what this article does, is take one real agentic turn — 2 uncached input tokens, 11,054 cache writes, 20,933 cache reads, 4 output — and price it on nine published cards read on 2026-08-17. The spread is 10.5x. Along the way two of the three vendors turn out to publish no context window on the page their prices come from, and one vendor's own tool bills a model at 1.5x its published rate.

Key takeaways

  • On identical work, the cheapest and most expensive current models differ by 10.5x — $0.023067 against $0.242233 for the same request.
  • The $/MTok column is not comparable across vendors. Anthropic publishes a cache-write multiplier, OpenAI publishes one for part of its lineup, and Google bills cache as storage per token-hour and tiers by prompt length.
  • Claude Code's reported cost for Claude Sonnet 5 reproduces at $3/$15, not the $2/$10 on Anthropic's card. Every Sonnet cost the tool prints is 1.5x the published rate.
  • The flagship context window no longer separates anything — Fable 5, Opus 5 and Sonnet 5 all publish 1M tokens and a 128k output ceiling.
  • Every figure here carries the date it was read, and npm run check:cards fails the build once any of them is 90 days old.

The short answer

Pick the price tier by task class, not the model by leaderboard, and then measure your own turns — because the tier is a flat multiplier and everything else about your bill is your harness. If your work is mechanical and well-scoped, the cheap tier lands $0.0012 from the cheapest thing on the market. If it is multi-file reasoning you cannot check quickly, the expensive tier costs 10x and that is the whole downside.

For the whole-category decision — tools, not models — the best AI coding assistants comparison is the pillar this sits under. For why the model matters less than the thing wrapped around it, Claude vs GPT for coding measured the request itself: 2 of 32,005 input tokens were typed by a person.

What best AI model for coding usually measures

Ask for the best LLM for programming and you get four different questions answered as if they were one:

  • A benchmark score, which is a model plus a scaffold plus a task set. You can buy the model.
  • A price, quoted as input dollars per million tokens, which on an agentic workload is the smallest line on the bill.
  • A specification — context window, output ceiling — which has converged at the top of every vendor's lineup.
  • An impression from using one tool for a week, which is a real signal and is not transferable, because the tool was doing most of the work.

Only two of those four are published facts. This article does those two properly and says so about the other two.

One real turn, priced on every card

The measurement is a committed probe of a single headless turn, priced through each vendor's published rates. The request is held constant; only the card varies.

Terminal
npm run check:cards
Output, 2026-08-17
  Token shape held constant across every card: 2 in, 11,054 cache write,
  20,933 cache read, 4 out — one headless turn, measured 2026-08-17.

  MODEL                   VENDOR     IN /MTok   OUT /MTok   COST         READ ON
  gpt-5.3-codex           OpenAI     $1.75      $14         $0.023067 ~  2026-08-17
  claude-haiku-4-5        Anthropic  $1         $5          $0.024223    2026-08-17
  gpt-5.6-terra           OpenAI     $2         $12         $0.031874    2026-08-17
  claude-sonnet-5         Anthropic  $2         $10         $0.048447    2026-08-17
  gpt-5.6-sol             OpenAI     $5         $30         $0.079684    2026-08-17
  claude-opus-5           Anthropic  $5         $25         $0.121117    2026-08-17
  claude-fable-5          Anthropic  $10        $50         $0.242233    2026-08-17

Three things in that table are worth more than the ordering.

The ranking is not the input-price ranking. claude-haiku-4-5 has the lowest input rate on the list at $1 and lands second, because on this shape the cache-write term dominates and Anthropic bills a one-hour cache write at 2x input while OpenAI's published cache handling for gpt-5.3-codex does not separate writes at all.

The top two are $0.0012 apart — $0.023067 against $0.024223, across two vendors and two model families. Any roundup that ranks those two confidently is ranking noise.

The arithmetic is checked, not asserted. The claude-opus-5 row is computed from the published card and then compared against the figure Claude Code reported for the same turn: $0.121117 against $0.121117, to six decimal places. That is why the other rows are worth reading — the method reproduces a vendor-reported number exactly for at least one vendor.

Where the columns stop being comparable

The single-price column that every "top coding models" table uses hides three different billing models, and the script refuses to fill it in where the vendor has not published enough to fill it honestly.

Output, 2026-08-17
  Not priced, because the vendor does not price this shape:

  gemini-3.1-pro-preview  Google     tiered at 200k tokens, and cache is billed per
                                     token-hour of storage ($4.50/1M/hr) rather than per write
  gemini-3.7-flash        Google     promotional rate through 2026-12-31, doubling after;
                                     cache billed per token-hour of storage

  Marked ~ above:

  gpt-5.3-codex           no cache-write rate published; writes priced at the input rate

Google's cards price cached context as storage rented by the token-hour, which is a function of how long your session lives rather than how many tokens it moves. There is no honest way to express that as a per-request figure without knowing session duration, so the script leaves the cell empty instead of guessing. Two of Google's current models are also on promotional rates that double on 2026-12-31, which makes today's number a poor guide to next quarter's.

Put a duration on it and the empty cell fills in. Priced against Anthropic's one-time cache write on a single measured session, Google's rent overtakes Anthropic's fee after 53 minutes — which is why a per-request column could never have held both.

The ~ on gpt-5.3-codex is a real caveat inherited from earlier work on this site. OpenAI publishes an explicit cache-write rate for the gpt-5.6 family — $6.25 for sol, $2.50 for terra, $0.25 for luna — and does not publish one for gpt-5.3-codex, so its writes are priced at the full input rate here. If writes are cheaper for that model, its already-first position widens.

The specification columns are worse. Only one of the three pricing pages carries them at all:

Output, 2026-08-17
  MODEL                   CONTEXT         MAX OUTPUT
  claude-opus-5           1,000,000       128,000
  claude-sonnet-5         1,000,000       128,000
  claude-fable-5          1,000,000       128,000
  claude-haiku-4-5        200,000         64,000
  gpt-5.3-codex           not published   not published
  gpt-5.6-sol             not published   not published
  gemini-3.1-pro-preview  not published   not published

Anthropic's overview publishes both. OpenAI's pricing page and Google's publish neither. Any comparison table filling those columns for all nine models took them from somewhere else — and the honest version of that table says where.

Note what the published half shows: Fable 5, Opus 5 and Sonnet 5 are identical on both spec columns. The window is not a differentiator inside a vendor's flagship tier any more, which is worth knowing before paying 5x for one.

When the tool disagrees with the price card

The most useful figure on this page is the one that should not exist.

Claude Code reports a per-model costUSD on every headless turn. Anthropic's cache multipliers are fixed — reads at 0.1x input, one-hour writes at 2x, output at 5x — so exactly one input rate reproduces a reported cost, and solving for it is arithmetic rather than estimation. Run that on two probes taken minutes apart:

npm run check:split, 2026-08-17
  MODEL             CONTEXT     MAX OUT    PUBLISHED  IMPLIED $/MTok IN
  claude-sonnet-5   1,000,000   64,000     128,000    $3.00  MISMATCH — card says $2.00
  claude-opus-5     1,000,000   64,000     128,000    $5.00  (card: $5.00)

Opus reproduces its card exactly. Sonnet reproduces at $3 in and $15 out — the published Claude Sonnet 4.6 rate — against the $2 and $10 that Anthropic's models overview publishes for Claude Sonnet 5 as of 2026-08-17. Every Sonnet cost figure the tool prints is therefore 1.5x the card, which matters most to exactly the people who are trying to be careful: anyone comparing tiers by reading --output-format json totals rather than an invoice.

Both models also report a 64,000-token output ceiling against a published 128k, which is the second corroboration on this site of Claude Code setting its own cap at roughly half the API maximum — the same thing what model Claude Code actually uses found on the account default in August. The full Sonnet-versus-Opus decomposition is in Claude Sonnet vs Opus for coding.

What a benchmark score is evidence of

Every model launch quotes SWE-bench, and it is a real benchmark built with care. It is also narrower than the sentence it gets used in.

SWE-bench instances are constructed by a three-stage filter: scrape pull requests, keep the ones that resolve a GitHub issue and modify the repository's test files, then keep only those where at least one test flips from fail to pass. The paper reports roughly 90,000 pull requests entering that pipeline across 12 Python repositories and 2,294 instances leaving it.

That filter is doing something specific: it selects for work that arrives with a failing test attached. A score is strong evidence about that kind of work and weak evidence about everything else — and "everything else" is most repositories. Running the same filter over this one produced zero instances from 40 commits, for reasons covered in full in SWE-bench explained.

It is also narrower by language than "coding" suggests. Counting the Verified set file by file, 622 of the 623 files its solutions edit are .py — so a headline coding score is evidence about Python and about very little else.

Use published scores the way you would use a compiler benchmark: as a floor on capability, not as a ranking of the thing you are about to buy. And when you do compare vendors, price a real session rather than a rate card: the same session across all three ranks differently depending on how long you hold the cache.

Picking a model as a decision rule

"It depends" is only useful with the what attached, so here is the rule this article commits to, in the order the decisions actually bind:

  • Pick the harness first. It writes almost the entire request; the model reads what it is handed. This is settled on the site's own numbers and is not close.
  • Then pick a price tier by whether you check the output. Work you review line by line — renames, mechanical refactors, test scaffolding — belongs on the cheap tier, where the two leaders are $0.0012 apart. Work you cannot cheaply verify belongs on the expensive tier, and the premium is what you pay to reduce a review you would otherwise have to do.
  • Do not pick on context window inside a tier. It has converged at 1M across the current flagships.
  • Then measure. One headless turn with JSON output tells you your own shape, and your own shape is what the bill is made of.
  • Re-check the figures quarterly, mechanically. Not as a habit — as a check that fails.

That last one is the part this site can enforce rather than promise. Every card in the table carries the URL it came from and the date a human read it, and the script exits non-zero once any of them ages past the threshold:

Terminal
npm run check:cards -- --max-age=30
Output
  ok      claude-opus-5           0 days  https://platform.claude.com/docs/en/about-claude/models/overview
  ok      gpt-5.3-codex           0 days  https://developers.openai.com/api/docs/pricing
  ok      gemini-3.1-pro-preview  0 days  https://ai.google.dev/gemini-api/docs/pricing

A roundup that cannot pass its own freshness check should be updated before it is cited. Wiring that into CI is a smaller job than the quarterly reminder everyone means to keep.

What we are not claiming

No output-quality ranking appears in this article, and that omission is the finding rather than a gap in it.

Ranking coding models needs four things: both harnesses installed, the same brief reaching both, a fixed task set neither has seen, and a grader independent of both vendors. The committed check for those preconditions reports zero of five met on this machine, and it exits non-zero on purpose. Producing a winner from that position would mean inventing at least three of them.

Two further limits, stated plainly. The prices are list rates read on 2026-08-17 and this category re-prices several times a year — the check:cards threshold exists because that is a certainty, not a risk. And the token shape is one turn on one repository: a session that reads large files shifts real content into the request, moves the balance between the cache-write and cache-read terms, and will reorder rows that sit $0.0012 apart. The 10.5x spread across the full lineup survives that; the top-two ordering does not.

Common mistakes ranking coding models

  • Ranking on the input rate. On the measured turn, uncached input was 2 tokens of 31,989. The cheapest input rate on the list finished second overall.
  • Treating $/MTok as one column. Three vendors, three billing models, one of which is rented by the hour.
  • Quoting a spec the price page does not carry. Two of the three publish no context window where the price is published.
  • Trusting a tool's cost report over the card. One of the two models measured here bills 1.5x its published rate in the tool's own accounting.
  • Reading a benchmark score as a model property. It is a model, a scaffold, and a task set — and you can only buy the first one.
  • Quoting any of this without a date. Two Google models on this list re-price on 2026-12-31 by contract.

Conclusion

Choose the harness, then choose a price tier by whether you check the work, and stop treating "best AI model for coding" as a question with a leaderboard answer — the top two on identical work are $0.0012 apart and the full spread is 10.5x, so tier is the only part of the choice that reliably moves money. Then run npm run check:cards against your own token shape and put it in CI with a 90-day threshold, because the single most likely thing to be wrong about any model comparison, including this one, is that it is six months old.

Frequently asked questions

What is the best AI model for coding in 2026?
No page can answer that from published data alone, including this one. What is establishable is cost on identical work: pricing one measured agentic turn on every vendor's card on August 17, 2026 gives a 10.5x spread, from $0.023067 on gpt-5.3-codex to $0.242233 on claude-fable-5. Pick the tier by task class, then measure your own turns.
Which coding model is cheapest?
For the token shape measured here — 2 uncached input, 11,054 cache writes, 20,933 cache reads, 4 output — gpt-5.3-codex came out cheapest at roughly $0.023067, with claude-haiku-4-5 $0.0012 behind it at $0.024223. Both figures are list prices read on August 17, 2026, and the OpenAI one is approximate because no cache-write rate is published.
Do SWE-bench scores tell you which model to use?
They tell you about a model plus a scaffold plus a task set, and you can buy the model but not the scaffold. SWE-bench instances are built only from pull requests that resolve an issue and ship a test that flips fail to pass, so a score is evidence about repositories that work that way. Running the benchmark's own filter over this repository produced zero instances.
Does a bigger context window mean a better coding model?
Not on current cards, because the flagship tier has converged. Claude Fable 5, Claude Opus 5 and Claude Sonnet 5 all publish a 1M-token window and a 128k output ceiling, so the specification does not separate them. OpenAI and Google publish no context window at all on the pricing pages those figures usually get quoted from.
Why does my tool report a different cost than the vendor's price card?
Because the tool computes the figure itself and can carry a stale rate. Measured on August 17, 2026, Claude Code's reported cost for Claude Sonnet 5 reproduces exactly at $3 in and $15 out per million tokens, while Anthropic's models overview publishes $2 and $10 for that model. That is a 1.5x difference in every Sonnet figure the tool prints.

Muhammad Kashif

Founder and editor of Devventa, covering AI coding assistants, Next.js and the modern AI development stack.