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.
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.
Get API key →