Ask a team how they will cut their model bill and most answer with a cheaper model. It is the last lever on the published list, not the first — and the four above it cost you nothing at all. The ordering is the whole lesson.
A quick note on where this sits. Lesson 20 is about the number you report — cost per successful outcome, gross margin, what you charge. This one is about the levers you actually pull on Monday, and the order to pull them in.
That order is not a matter of taste. Anthropic publish it as a sequence. The logic is structural. Every lever above model selection is free, and model selection is the only one that lowers what your system can do at all.
Read the middle row across. Four of these cost you nothing at all — and most teams start at number seven.
The largest lever by a wide margin, and it is not close. Anthropic's own measurement puts it at a factor of 2.5 to 3.7 off agent-loop cost, and 83% off one small triage agent's bill — 88% with input trimming added. It changes no output. If you do one thing from this lesson, do this one.
Caching is first because it is the largest lever by a wide margin and it changes no output at all. The measured effect on agent loops is a factor of 2.5 to 3.7, and one small triage agent’s bill fell by 83% — 88% once input trimming was added.
Everything about it follows from one rule. Prompt caching is a prefix match, and any change anywhere in the prefix invalidates everything after it. The prompt renders in a fixed order: tools, then system, then messages.
So the design rule is simply stable content first, volatile content last. Get that ordering right and most of the saving arrives for free. Get it wrong and no amount of cache markers will rescue it.
The prompt renders as tools, then system, then messages. Pick a change and see how far down the damage goes.
Cheap. You keep the tools and system caches, which are usually the large ones, and lose only the messages tail. Safe to vary per request.
Two silent traps worth knowing. A prompt below the per-model minimum cacheable length is simply not cached, and no error is returned. And a cache read refreshes the entry’s timer for free. So requests arriving less than five minutes apart keep a five-minute entry alive indefinitely, and the one-hour TTL buys nothing there except a doubled write price. Choose the TTL by the gap between requests, not by how long the conversation lasts.
# Renders as: tools -> system -> messages.
# Put the frozen content first and the volatile content after the breakpoint.
response = client.messages.create(
model="claude-opus-5",
max_tokens=4096,
tools=TOOLS, # deterministic order — sort it, never build it per user
system=[
{
"type": "text",
"text": STABLE_INSTRUCTIONS, # no timestamps, no request ids, no user names
"cache_control": {"type": "ephemeral"},
},
],
messages=messages,
)
u = response.usage
# A cache miss is silent: the request succeeds and only the bill changes.
# Assert on it in staging rather than discovering it in a monthly invoice.
if u.input_tokens > 0 and u.cache_read_input_tokens == 0 and turn > 1:
raise AssertionError(
"cache never read — check for a timestamp in the system prompt, "
"a tool list that varies per request, or a prefix below the model minimum"
)All usage in a batch is charged at 50% of standard API prices, and the batch and caching discounts stack. For work nobody is waiting on this is close to free money.
Your eval runs are the obvious candidate. So are backfills and scheduled jobs. Most batches finish inside an hour — the 24-hour figure people quote is an expiry, not a service level.
Two constraints decide whether it fits. It is single-shot, so a multi-turn tool loop has to be restructured rather than redirected. And it is genuinely asynchronous, so anything with a person waiting stays on the live path.
Everything so far was free. Effort is the first lever that trades accuracy for money, and on most workloads the trade is better than people expect.
On research-style work, low effort cost 1 to 3 points of accuracy for a 33–50% cost cut, and medium matched the default at 70–85% of cost. Long-horizon coding is steeper: medium lost 2 points for half the cost, low lost 8 points for three-quarters.
There is a cleverer version if your outputs are checkable. Run cheap, detect the failures, and re-run only those at higher effort. Measured on coding work that reached the same pass rate for half the cost, counting the wasted cheap attempts. It needs a real failure signal — a test suite, a schema, a validator — so it belongs to teams who did the evaluation work first.
Model selection is last because it is the only lever that lowers the ceiling on what the system can do. It is also the one where per-token price lists actively mislead.
Price cost per completed task, not per token. Opus 5 matched a more expensive model on a coding benchmark — 91.7% against 91.3%, inside run-to-run noise — at about 60% of its cost. In the other direction, Haiku 4.5 answered benchmark questions at roughly a tenth of Opus 5’s cost per question, at 63% accuracy against 92%.
That second number is the one to think about. A model that fails a third of the time does not cost a tenth as much, because failures become re-runs, escalations and human time. Cheap per token and cheap per outcome are different quantities, and only one of them is on the invoice.
There is one more hidden cost in routing between models. Caches are model-scoped. A cascade that sends some steps to a cheaper model forfeits cache reuse across the models it routes between. It gives up lever one to buy lever seven, which is the wrong direction.
Nubank’s card-delivery agent originally made three separate tool calls to answer one question. They replaced them with a single composite tool. No model changed, no price changed, and no accuracy was traded.
This is lever three, and it compounds harder than it looks. Removing a turn removes its model call — but it also removes the resend of the entire transcript that turn would have carried, on that turn and every turn after it. Against published multipliers of roughly four times chat token usage for agents and fifteen for multi-agent systems, the loop is usually where the money actually is. Most teams look at the price list instead.
Two of the five below are skips at seed. The multi-model cascade is the one teams reach for first, and it stays a skip until there is genuine bulk to hand off.
Nearly all guidance on this topic is written for one company size and then read by everyone. Pick yours — the list re-sorts, and what you should deliberately not build drops to the bottom.
A cache breakpoint after the system prompt and tool definitions, with stable content first.
At this stage · Now design the prompt around it: stable content first, volatile last, so the cache boundary falls somewhere useful.
Evals, backfills and scheduled jobs routed through the Batch API rather than the live path.
At this stage · Half price on all usage, and it stacks with caching. Eval runs are the obvious first candidate because nobody is waiting on them.
An alert when cache_read_input_tokens falls as a share of input tokens.
At this stage · A weekly glance at the ratio. This is the stage where somebody adds a timestamp to a system prompt and nobody notices for a month.
Measuring accuracy and cost at each effort level on your own traffic, route by route.
At this stage · Once an eval exists, sweep the highest-volume route only. The published research numbers suggest medium often matches the default at 70–85% of cost, but that is their workload, not yours.
Routing steps to different models — a cheap worker with a frontier orchestrator, or an advisor pattern.
At this stage · Still skip. Sweep effort on the model you have first — a stronger model at lower effort often beats a weaker one, and it keeps one cache namespace.
1 of 5 deliberately skipped at this stage. Knowing which controls you are choosing not to build, and being able to say why, is a stronger signal than having built all of them.
Caching, input trimming, loop hygiene and batching cost you nothing in quality. Effort, selective re-runs and model choice all trade something. Work the free four before touching the other three.
Tools, then system, then messages — a change invalidates its own tier and everything after it. Stable content first, volatile last. A prompt below the per-model minimum silently does not cache and returns no error.
All usage at 50%, combining with caching. Evals, backfills and scheduled jobs qualify; anything with a person waiting does not.
Price cost per completed task. A model at a tenth the cost per question but 63% accuracy against 92% is not a tenth as cheap, because failures become re-runs. And a multi-model cascade forfeits cache reuse, trading your best lever for your worst.
Primary sources wherever one exists. Where a claim is contested or vendor-reported, the lesson says so at the point it is made.
The published multipliers behind the loop-hygiene lever: agents use roughly four times the tokens of a chat interaction, and multi-agent systems about fifteen times.
Their card-delivery agent replaced three separate tool calls with one composite tool. A loop-hygiene change rather than a pricing one, and the kind that compounds because every removed turn also removes the resend of everything before it.
The lever order, published as a sequence rather than a list. Also the measured claim this lesson is built on: prompt caching was the largest lever by a wide margin, cutting agent-loop cost by a factor of 2.5 to 3.7 and one small triage agent's bill by 83%, or 88% with input trimming added.
Cache reads are billed at 0.1x base input, writes at 1.25x for the five-minute TTL. There is a per-model minimum cacheable prefix, and a prompt below it is simply not cached — no error is returned, which is why silent cache misses are so common.
“All usage is charged at 50% of the standard API prices.” Most batches finish in under an hour; the 24-hour figure is an expiry, not a service level. The batch and caching discounts stack.
The first lever that trades quality for cost, and the one to sweep before reaching for a cheaper model. Effort is a per-route setting, not a global one.
Per-token list prices. Worth reading precisely because the lesson's argument is that these are the least useful numbers in the discussion — they do not predict cost per completed task.