Prompt caching explained: when it saves money and when it does not

Prompt caching lets an LLM API reuse the processed start of your prompt instead of reading it again on every call. On Anthropic’s API, a cached read costs a small fraction of normal input (0.1x on most models, 0.05x on Claude Sonnet 5.5 and Opus 5.5), but writing to the cache costs more than normal input (1.25x or 2x). So caching saves real money when a long, unchanging prefix is reused often and quickly. It saves nothing, or costs extra, when the prefix is short, changes at the start, or expires before the next call.
What prompt caching actually does
Every request you send has a prefix: tool definitions, then the system prompt, then the messages, in that order. With caching on, the API stores a hash of the prefix up to a point you mark (a “cache breakpoint”). On the next request, if the prefix up to that point is byte for byte the same, the API reads it from cache instead of processing it again. The prompt caching docs are clear that the prefix has to match exactly.
You can turn it on with one top-level cache_control field (automatic caching, where the breakpoint moves forward as a conversation grows) or with explicit breakpoints on content blocks, up to 4 per request. Caching does not change the output.
The cache is short-lived. The default lifetime is 5 minutes, and each hit refreshes it at no extra cost. You can pay more for a 1-hour lifetime. One detail matters: the clock starts when the request that writes or reads the cache starts, not when the response ends. If a response takes 4 minutes to stream, the docs note that your next request must start within about 1 minute.
How Anthropic bills it
There are three kinds of input tokens on a cached request, and the API reports each one separately in the usage field:
cache_creation_input_tokens: written to the cache on this callcache_read_input_tokens: read from the cache on this callinput_tokens: everything after your last breakpoint, billed at the normal rate
The multipliers, from the pricing page, are relative to the model’s base input price:
| Operation | Multiplier |
|---|---|
| 5-minute cache write | 1.25x |
| 1-hour cache write | 2x |
| Cache read (hit) | 0.1x on most models; 0.05x on Claude Opus 5.5 and Sonnet 5.5; 0.025x on Claude Fable and Mythos 5.1 and 5.2 |
For Claude Sonnet 5.5, that works out to $2 per million input tokens, $2.50 for a 5-minute write, $4 for a 1-hour write, $0.10 for a hit, and $10 per million output tokens. Anthropic’s own break-even rule: a 5-minute write pays off after one cache read, a 1-hour write after two.
There is also a floor. Prompts shorter than a minimum are not cached at all, even if you mark them, and the API returns no error. The minimum is 512 tokens on the newest models (including Opus 5.5, Sonnet 5.5 and Haiku 5.5), 1,024 on Sonnet 5 and Sonnet 4.6, 2,048 on Opus 4.7, and 4,096 on Opus 4.6, Opus 4.5 and Haiku 4.5. If both cache fields in usage are 0, nothing was cached.
When caching saves money, and when it quietly does not
Where it pays
- Long, stable system prompts. A support bot with a 20,000-token instruction set and many examples, called every few minutes, is the textbook case.
- Large documents reused across questions. Load a contract or a codebase summary once, then ask many questions against it. Only the new question is billed at the full rate.
- Agent loops that resend history. Agents call the API again after every tool result, resending the whole conversation each time. With automatic caching, earlier turns are read from cache and only the newest blocks are written.
Where it saves nothing
- Prefixes below the minimum. A 400-token system prompt on Sonnet 5.5 is under the 512-token floor. You get normal input pricing and no warning.
- Prompts that change at the start. A timestamp, user name, or request ID near the top changes the hash for everything after it. The docs call out a common mistake: putting the breakpoint on a block that contains a timestamp. You then pay a 1.25x write on every request and never get a read. Changing tool definitions invalidates the whole cache, too.
- Short single-shot calls. A one-off classification with no follow-up has nothing to reuse. Marking it for caching just turns 1x input into a 1.25x write.
- TTL expiring between calls. If calls arrive more than 5 minutes apart, every call is a fresh write. That is 25% more than not caching at all.
- Parallel bursts. A cache entry only exists once the first response starts, so 10 identical requests sent at once can all miss.
- Long growing conversations. Lookback for an earlier cache entry only checks 20 blocks back from each breakpoint. An agent turn that adds many blocks can miss the previous entry unless you add a second breakpoint.
A hypothetical worked example
This is a hypothetical workload, not a measurement. Prices are Claude Sonnet 5.5 list prices as read on 2026-11-20: input $2, 5-minute write $2.50, 1-hour write $4, hit $0.10, output $10, all per million tokens.
Each call has a 20,000-token stable prefix, a 300-token question, and a 400-token answer.
Scenario A: busy bot, 500 calls in a day, never more than 5 minutes apart.
- Without caching: 500 × 20,300 = 10,150,000 input tokens × $2/M = $20.30. Output: 200,000 × $10/M = $2.00. Total $22.30.
- With caching: one write, 20,000 × $2.50/M = $0.05. Then 499 reads, 9,980,000 × $0.10/M = $0.998. Questions: 150,000 × $2/M = $0.30. Output $2.00. Total $3.35.
Input cost drops about 93%, and the whole bill about 85%.
Scenario B: quiet bot, 20 calls in a day, each more than 5 minutes apart but less than an hour apart.
- Without caching: 406,000 × $2/M = $0.81 input.
- 5-minute cache: every call is a write. 400,000 × $2.50/M + 6,000 × $2/M = $1.01 input. About 25% more than no caching.
- 1-hour cache: one write at 20,000 × $4/M = $0.08, 19 reads at 380,000 × $0.10/M = $0.038, plus $0.012 for questions. Total $0.13 input, about 84% less. (Output is $0.08 in every case.)
Only the TTL changed, and the bill moved from $1.01 to $0.13.
A short checklist
- Put stable content first (tools, system prompt, documents) and anything that changes (timestamps, user data, the question) after the breakpoint.
- Check that the cached prefix is above your model’s minimum.
- Compare your typical gap between calls to the TTL. If it is over 5 minutes but under an hour, price out the 1-hour cache.
- Read
cache_creation_input_tokensandcache_read_input_tokensin production. Mostly writes and few reads means you are paying extra. - For parallel jobs, let the first request start responding before sending the rest.
Sources
- Prompt caching, Anthropic (Claude Platform Docs), read 2026-11-20: https://platform.claude.com/docs/en/build-with-claude/prompt-caching
- Pricing, Anthropic (Claude Platform Docs), read 2026-11-20: https://platform.claude.com/docs/en/about-claude/pricing