Opus vs Sonnet for coding
Every comparison of these two quotes per-token rates. Rates hide the thing that decides your bill: the expensive model writes more. So we ran the same task through both on our own keys and read the billed amount out of our own logs.
Input / M (llmrelay): Anthropic list is $5 and $2. We sell both at half list.
Measured cost, one task: Our own billing logs, same task, same day. The ratio here (3.27x) is larger than the ratio of the rates (2.5x) because the more expensive model produced a longer answer. This is the number to budget against.
Output tokens for that task: Same prompt, same temperature=0, same cap. Opus 5 chose to write about 48% more. On output-heavy work that compounds, which is why cost per task and cost per token pull apart.
Measured latency: Single run each, so treat this as “no meaningful difference observed” rather than a timing benchmark. Anthropic’s own ratings are Moderate for Opus and Fast for Sonnet.
Prices are llmrelay's, at 50% of official list. Specs are the vendor's own published figures (Anthropic model docs), not our benchmarks. We do not publish scores we cannot source.
One identical task: $0.0152 against $0.0047
Rate cards compare price per token. Your invoice is price per task, and those are not the same thing — a model that writes more costs more than its rate suggests. So we sent one task to both and read the billed amount straight out of our own billing logs.
3.27× — the ratio you actually pay, against 2.50× on the rate card.
- →Opus 5 cost 3.27x what Sonnet 5 cost for the same task, although its per-token rate is only 2.5x higher. The extra 31% is purely because it emitted 875 output tokens against Sonnet 5’s 592 — more words, billed at the higher rate. Any price table you read will miss this.
- →Both models found the actual bug. The read-check-write sequence is not atomic, so two concurrent calls can both pass the balance check and one charge gets lost. Both also flagged the SQL injection and the unbounded never-invalidated cache. On correctness this task did not separate them.
- →Sonnet 5 arguably gave the better fix: a single atomic conditional UPDATE that pushes the check into the database, so correctness holds regardless of concurrency. Opus 5 wrapped its version in an explicit transaction. Both work; the cheaper answer was tighter.
- →What the extra 3.3x bought was breadth of review, not a better answer — Opus 5 additionally caught an unused import, added input validation and a docstring, and explained why the cache makes the race worse rather than just noting that it is unsafe.
- →Latency was effectively identical: 19.7s against 20.4s. Worth knowing, because Anthropic rates Sonnet’s comparative latency Fast and Opus’s Moderate. On a single 2000-token-cap request that difference did not show up.
What exactly we sent, and how the cost was obtained
One code review: find a concurrency bug in a 15-line Python billing function, identify two lesser issues, and rewrite it correctly. temperature=0, max_tokens=2000, identical system prompt and identical user message to both models.
Measured 31 July 2026. The dollar figures are not estimates from the rate card and not the API's self-reported usage — they are the amount our billing system actually charged, read from the quota column of our request log and converted at our fixed internal rate.
One run per model, one task. That is enough to show cost per task diverging from cost per token, which is the point. It is not a quality benchmark and we are not presenting it as one — we do not publish scores we cannot source, which is also why you will find no benchmark percentages anywhere on this page.
When Opus 5 earns the 3.3x
- +Review work where you want the long tail of smaller findings, not just the headline bug. That is what it demonstrably gave us for the extra money.
- +Problems where being wrong is expensive and a second opinion costs more than $0.01 — migrations, auth logic, anything touching money.
- +Long agent chains where one bad step poisons everything downstream, so the per-task premium is small against the cost of a restart.
- +You are pinned to a specific snapshot for reproducibility. Model ids in this generation are pinned snapshots, so behaviour does not drift under you.
When Sonnet 5 is the right default
- +Most day-to-day coding. On our task it found every issue Opus found and gave a tighter fix for a third of the price.
- +High-volume or looping work — test generation, batch refactors, CI review comments — where 3.3x per call becomes the whole budget.
- +Anything you are going to read and verify yourself anyway. You are the review layer; you do not need to pay for a second one.
- +Starting out. Run Sonnet 5 as the default and escalate to Opus 5 on the specific tasks where you can see it failing. That ordering is cheaper than the reverse.
The honest answer
Default to Sonnet 5 and escalate deliberately. On one real code review it matched Opus 5 on every issue that mattered and cost $0.0047 against $0.0152 — and note that the 3.3x gap is wider than the 2.5x rate difference, because Opus writes more. Opus 5 is worth it when breadth of review matters more than the bill, which is a real case but not the common one. Both sit on one key here at half list, so the honest move is to run your own prompts through both and compare bills rather than trust anyone’s table, including ours.
What this costs you per month
At 50M input and 5M output tokens a month — a realistic heavy agent workload.
Struck-through column is the vendor's list price for the same traffic. Adjust the numbers on the calculator.
Why per-token rates mislead you on this pair
The rate difference between these two models is 2.5x. The bill difference on the one task we measured was 3.27x. That gap is not a rounding artefact and it is not specific to our platform — it exists because output length is a property of the model, not of the prompt. Given the same instruction and the same temperature, Opus 5 wrote 875 output tokens where Sonnet 5 wrote 592. You pay the higher rate on more tokens, and the two multiply.
This matters most on output-heavy work. If your workload is retrieval-style — large prompt, short answer — the input rate dominates and the effective gap narrows back toward 2.5x. If it is generative — write this module, review this diff, produce this migration — the gap widens, because that is where the extra verbosity lands. Before you budget on a rate card, decide which of those two shapes your traffic is.
The practical consequence: any spreadsheet that models cost as tokens multiplied by rate, with the token count held equal across models, will understate what the expensive model costs you. The only way to get a real number is to send your own prompts to both and read the bill. That is a ten-minute exercise, and it is the reason we publish the method rather than just the result.
What the extra money actually bought
On our task, both models found the real defect: the read-check-write sequence in the billing function is not atomic, so two concurrent calls can both pass the balance check and one charge is lost. Both also flagged the SQL injection and the unbounded cache. On the question of whether the expensive model catches things the cheap one misses, this task returned no.
Sonnet 5 arguably produced the better fix. It pushed the check into the database as a single conditional UPDATE, so correctness holds regardless of how many callers arrive at once. Opus 5 wrapped its version in an explicit transaction, which also works but leaves more surface for a future reader to get wrong. The cheaper model gave the tighter answer.
What Opus 5 added was breadth: an unused import, input validation, a docstring, and an explanation of why the cache makes the race worse rather than merely noting that it is unsafe. That is real value if you are reviewing unfamiliar code and want the long tail of findings. It is not value if you already know the codebase and wanted the one bug.
One run, one task, so treat this as an existence proof rather than a benchmark: it demonstrates that the premium is not automatically buying correctness. It does not establish how often that holds. We do not publish scores we cannot source, and a single measurement is not a score.
The knowledge cutoff is the one spec difference that bites silently
Opus 5 has a reliable knowledge cutoff of May 2026 against Sonnet 5’s January 2026, per Anthropic’s published model documentation. Four months does not sound like much until a framework you depend on shipped a breaking change inside that window.
This failure mode is quiet. The model does not say it is unsure; it confidently writes code against an API signature that changed. Everything type-checks, the review reads fine, and it fails at runtime against the current library. If your work touches fast-moving dependencies — an SDK mid-major-version, a framework in active churn — that is the strongest single argument for paying the premium, and it has nothing to do with reasoning depth.
The mitigation, if you would rather stay on Sonnet 5, is to put the current signature in the prompt. Paste the relevant doc section or the actual type definitions. That converts a knowledge problem into a context problem, and context is cheap at $1.00 per million input tokens.
Latency, and what we did not observe
Anthropic rates Sonnet 5’s comparative latency as Fast and Opus 5’s as Moderate, on their own Slower / Moderate / Fast / Fastest scale. On our single 2000-token-capped request the wall-clock times were 19.7s for Opus 5 and 20.4s for Sonnet 5 — which is to say the rated difference did not appear.
Read that as “no meaningful difference observed on one short request”, not as a refutation of Anthropic’s rating. Single-request timings on a shared upstream are noisy, and the rating presumably reflects behaviour across load and longer generations. If latency is what you are optimising for, measure it on your own traffic shape and your own concurrency; nobody’s published rating will predict your p95.
How to decide this in ten minutes, on your own workload
Every recommendation on this page, including ours, is downstream of somebody else’s task. This is the version you can run yourself, and it costs a few cents.
- 01 Pick three prompts you actually send
Not toy examples — three real ones, ideally covering your extremes: your longest context, your most generative task, and your most routine one. Toy prompts systematically favour the cheap model, because they do not have the depth for reasoning to matter.
- 02 Send each to both models with temperature=0 and an identical cap
Same system prompt, same user message, same max_tokens. Only the model id changes. If you vary anything else you are measuring your prompt, not the models. On llmrelay both ids sit behind one key, so this is a string change rather than a second account.
- 03 Read the bill, not the rate card
Take the actual charged amount per request from your usage log. Divide the Opus total by the Sonnet total. That ratio is your real multiplier — ours came out at 3.27x where the rate card implied 2.5x, and yours will differ because your output shape differs.
- 04 Judge the outputs blind, then look at the prices
Strip the model names, read both answers, decide which you would ship. Doing it in that order is the whole point: knowing which one cost more is enough to make the expensive answer look more thorough. If you cannot pick a winner blind, you have your answer.
- 05 Default to the cheap model and escalate by exception
Set Sonnet 5 as your default and keep a short list of task types where you saw Opus 5 earn it. That ordering is cheaper than starting on Opus and trying to justify downgrades, because the escalation cases are specific and findable while the downgrade cases are diffuse.
Sonnet 5’s Anthropic list is $2/$10 per million tokens. That was announced as introductory pricing through 31 August 2026; Anthropic later cancelled the 1 September 2026 increase to $3/$15 and made $2/$10 the standard price. Our half-list price stays $1.00/$5.00. The measured figures on this page were billed at this same rate, so they do not need to be re-run for a price change that will not happen.
Questions people ask about this comparison
Is Opus 5 worth 2.5x the price of Sonnet 5 for coding?
For most coding work, no. On one identical code-review task both models found the same primary bug and the same two secondary issues, and Sonnet 5 gave the tighter fix while costing $0.0047 against Opus 5’s $0.0152. The premium bought breadth of review — extra minor findings, validation, a docstring — not a correct answer where the cheap model gave a wrong one. Opus 5 earns its price when review breadth matters more than the bill, when the task depends on library behaviour after Sonnet’s January 2026 cutoff, or when one bad step in a long agent chain is expensive to recover from.
Why did Opus 5 cost 3.3x more when its rate is only 2.5x higher?
Because it wrote more. On the same prompt at temperature=0 with the same 2000-token cap, Opus 5 emitted 875 output tokens against Sonnet 5’s 592. Output length is a property of the model, so the higher rate applies to more tokens and the two effects multiply. This is why cost per task and cost per token are not interchangeable, and why rate-card comparisons understate what the expensive model costs on generative work.
Which is faster, Opus 5 or Sonnet 5?
Anthropic rates Sonnet 5 as Fast and Opus 5 as Moderate on its own comparative-latency scale. We did not observe that difference: on one 2000-token-capped request Opus 5 took 19.7 seconds and Sonnet 5 took 20.4 seconds. One request each is not a latency benchmark, so treat this as no meaningful difference observed at that size rather than evidence against the published rating. If latency drives your choice, measure it at your own concurrency and prompt length.
Does the knowledge cutoff difference matter in practice?
It is the spec difference most likely to cost you silently. Opus 5’s reliable cutoff is May 2026 against Sonnet 5’s January 2026. Inside those four months a dependency you use may have shipped a breaking change, and the model will not flag uncertainty — it will confidently write code against the old signature. If your work touches fast-moving libraries, either pay for Opus 5 or paste the current API signatures into the prompt, which is cheap at $1.00 per million input tokens.
What does each model cost per month for a heavy coding workload?
At 50 million input and 5 million output tokens a month, Opus 5 is $187.50 on llmrelay against $375.00 at Anthropic list, and Sonnet 5 is $75.00 against $150.00. So the monthly gap between the two models is about $112 at our prices for that volume. You can change the volumes on our calculator to match your own traffic.
Can I use both models on one API key?
Yes. On llmrelay both are behind a single key and a single prepaid credit pool, so switching is a model-id change in your existing code rather than a new account and a second card. That is what makes running your own comparison practical: three prompts through both models costs a few cents and gives you a multiplier measured on your workload instead of ours.
Which model should I default to?
Sonnet 5, with deliberate escalation. Run it as your default and keep a short list of task types where you have actually seen Opus 5 do better — unfamiliar-code review, long agent trajectories, anything depending on post-January library behaviour. Starting on Opus and looking for downgrades is more expensive, because the cases where the premium pays are specific and identifiable while the cases where it does not are spread across everything else.
One key covers both
Switching between them is a model-id change, not a new account. Prepaid, no subscription, $10 minimum — enough to run the same prompt through both and settle the argument with your own output.
Next steps on this decision
Per-model detail for both sides, and the adjacent comparisons people usually read alongside this one.
- Claude Opus 5 pricing and specs$2.50/M in, $12.50/M out — half list. Current flagship Opus. A generation past 4.8, same list price.
- Claude Sonnet 5 pricing and specs$1.00/M in, $5.00/M out — half list. The next-gen Sonnet. Priced to replace GPT for daily work.
- Opus 5 vs Sonnet 5 for codingBoth are current-generation Claude models with a 1M context window.
- Fable 5 vs Opus 5 — is the flagship worth 2×?Fable 5 is Anthropic's most capable widely released model.
- Cost calculatorPut your own monthly token volume in and see the bill against vendor list price.
- Full price listEvery model we serve, at 50% of official list. No subscription, no volume gate.