CLAUDE LABJP
SUNSET — The legacy Workbench retires today, August 17: saved prompts, prompt versions, and evals become inaccessible after that, so exporting is a today-or-never jobAPI — The experimental prompt tool endpoints generate_prompt, improve_prompt, and templatize_prompt retire the same day and will return errors, so any script calling them needs switching over todayCONSOLE — The replacement Workbench is stateless: nothing is stored on Anthropic's servers, your draft stays in the browser, and any request can be exported as codeOSS — Claude for Open Source now grants six months of Claude Max 20x to qualifying maintainers, capped at 10,000 people, individual only, with no API credits and no auto-renewalQUOTA — The 50 percent weekly usage boost for Claude Code subscribers runs through August 19, two days outSELF-HOSTED — Self-hosted environments for Claude Code are in public beta, letting Team and Enterprise plans run sessions on their own infrastructure with internal network access and custom toolingSUNSET — The legacy Workbench retires today, August 17: saved prompts, prompt versions, and evals become inaccessible after that, so exporting is a today-or-never jobAPI — The experimental prompt tool endpoints generate_prompt, improve_prompt, and templatize_prompt retire the same day and will return errors, so any script calling them needs switching over todayCONSOLE — The replacement Workbench is stateless: nothing is stored on Anthropic's servers, your draft stays in the browser, and any request can be exported as codeOSS — Claude for Open Source now grants six months of Claude Max 20x to qualifying maintainers, capped at 10,000 people, individual only, with no API credits and no auto-renewalQUOTA — The 50 percent weekly usage boost for Claude Code subscribers runs through August 19, two days outSELF-HOSTED — Self-hosted environments for Claude Code are in public beta, letting Team and Enterprise plans run sessions on their own infrastructure with internal network access and custom tooling
Articles/API & SDK
API & SDK/2026-07-03Advanced

A 40% Lower Price Doesn't Mean a 40% Lower Bill — Measuring the Opus 4.8 to Sonnet 5 Migration by Cost per Completed Task

Sonnet 5's intro pricing looks ~40% cheaper than Opus 4.8, yet extra tool turns can flip the math. Working TypeScript for consumption vectors, a paired-run harness, and break-even turn counts.

Claude API117Sonnet 57cost engineeringmodel migration2TypeScript24

Premium Article

On July 2, Claude Sonnet 5 became the default model across plans, with introductory pricing of $2 per million input tokens and $10 per million output tokens. Next to Opus 4.8 at $5/$25, that is roughly 40% cheaper at standard rates and about 60% cheaper during the intro window. I switched the overnight batches for the blogs I run that same evening and opened the next morning's cost ledger expecting a satisfying drop.

The drop was about 18%. On a model that costs 60% less per token.

Cross-referencing the usage logs told the story: on my tool-loop tasks, the median turn count had risen from 5 to 7, and those two extra turns inflated input tokens far more than intuition suggests. If you judge a migration by the price table alone, this effect stays invisible until the invoice arrives.

This piece builds a different yardstick — cost per completed task — as one continuous design: recording consumption vectors, running old and new models side by side, and solving for the break-even turn count. It is a small mechanism, the kind an indie developer can bolt on in an afternoon, but it changes the quality of the migration decision noticeably.

Per-task cost is a dot product, not a price

What you pay per task is the dot product of a price vector and a consumption vector.

ComponentPrice sideConsumption side
Input$/MTok (input)Total input tokens sent until the task completed
Output$/MTok (output)Total generated tokens
Cache readsMuch cheaper read rateInput tokens served from cache
RetriesEvery component spent on failed attempts

Swapping models swaps the price vector instantly — but it changes the consumption vector too. Sonnet 5 is positioned as the most agentic Sonnet yet, with stronger planning and tool use, and in practice it does not call tools the same number of times or produce the same output length as Opus 4.8 on identical tasks. Some task families consume less, some consume more. Which means the sign of your savings cannot, even in principle, be read off the price table.

Turn count inflates input tokens quadratically

Each turn of a tool loop resends the whole conversation as input. With S for the system prompt plus initial context and d for the history added per round trip (tool_result plus the previous assistant output), the total input for an n-turn task is approximately:

total input ≈ n×S + d×(0 + 1 + ... + (n-1)) = n×S + d×n(n-1)/2

The second term grows with the square of n. Here are real dollars for a shape close to my link-checking agent — S = 3,000, d = 1,200 (an 800-token tool_result plus 400 tokens of prior output), 400 output tokens per turn:

Model and price4 turns6 turnsvs. Opus 4.8 at 4 turns
Opus 4.8 ($5/$25)$0.136$0.240baseline / +76%
Sonnet 5 intro ($2/$10)$0.054$0.096-60% / -29%
Sonnet 5 standard ($3/$15)$0.082$0.144-40% / +6%

At the same 4 turns, the discount tracks the price sheet exactly: 60% and 40%. Add two turns after the migration, though, and the intro-price saving shrinks to 29% — and at standard pricing, effective September 1, the task costs 6% more than it did on Opus 4.8. "We moved to the 40% cheaper model and the bill went up" is ordinary arithmetic for this task shape. Prompt caching softens the quadratic slope, but caches are scoped per model, so you cannot count on hits right after a switch — the dynamics I covered in the prompt-cache rewarm design for the Opus 4.8 to Sonnet 5 cutover.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
You'll be able to trace 'the price table says cheaper, but the bill barely moved' back to input tokens growing with the square of turn count
You can drop in a paired-run harness that runs the same task on both models and captures per-task effective cost and consumption profiles
You'll learn how to solve for the break-even turn count from your own prices and task shape, and make migration calls per task family
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API & SDK2026-07-09
When the RAG Started Being Confidently Wrong — Field Notes on Measuring Retrieval Misses With Groundedness
In a Claude API RAG, the answers stay fluent while the facts drift. Often the cause is a silent recall decay on the retrieval side, missing the document that holds the answer. Field notes on measuring groundedness and retrieval hit rate and walking the system back, with working code and real numbers.
API & SDK2026-07-08
Contract-Test Every Tool Before You Submit or Automate an MCP Connector
A connector that works once in a chat can still break silently in an unattended job through misread response shapes or double-fired writes. Here is a small harness that machine-checks tool descriptions, response contracts, idempotency, and latency, with measured numbers.
API & SDK2026-07-05
Fable 5 Is Back Worldwide and Sonnet 5 Is the Default — Where Each of the Three Models Belongs in a Solo Automation Stack
With Fable 5 redeployed worldwide and Sonnet 5 now the default, solo automation suddenly has three capable top-tier models to reach for. Instead of ranking them, this piece assigns each a role and captures that in a policy object with a fallback ladder and run-level logging.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →