Prompt Caching: The 90% Discount You're Missing
Last updated: October 2026
There is a 90% discount sitting in your API bill, and most developers are either not using it or using it in a way that doesn't work. Prompt caching — paying a tenth of the input price for tokens the provider has already seen — is the highest-leverage cost optimization available on modern LLM APIs. Here's how it actually works and how to get the savings.
How Prompt Caching Actually Works
The idea is simple. When you send a request, the provider processes your input tokens through the model — that's the expensive computation you're paying for. But if your next request starts with the exact same tokens — the same system prompt, the same repo context, the same few-shot examples — the provider doesn't need to recompute all of that. It kept the intermediate results cached. So it charges you a fraction of the price for those repeated tokens.
The key phrase is stable prefix. Caching works from the start of your prompt forward: the provider matches your prompt's beginning against what it has cached, and everything that matches gets the discounted rate. The moment the tokens diverge, matching stops and the rest is billed at full price.
This has one big architectural implication: put stable content first, variable content last. System instructions, repo context, few-shot examples, reference documents — all of that goes at the top, byte-identical every time. The thing that changes per request goes at the end.
The Math: What 90% Off Actually Means
On GPT-5.6 Sol, the numbers are published and stark:
- Fresh input: $4.00 per 1M tokens
- Cached input reads: $0.40 per 1M tokens
Run it through the reference workload — 1,100 tasks/month, each with 12K fresh input, 48K cached input, and 6K output tokens. The 48K cached tokens — four times the volume of fresh tokens — cost less than half as much. Without caching, those 48K tokens at full price would cost $0.1920 per task instead of $0.0192. Across 1,100 tasks a month, caching saves roughly $190/month on this workload alone.
One cost people miss: cache writes. The first time a prompt prefix is cached, the provider charges a premium — on GPT-5.6 Sol, cache writes cost 1.25x the input rate. Every reuse after that is nearly free.
Cache Rates Across Providers: The Full Table
"90% off" is the headline, but each provider implements caching differently — who charges for writes, who caches automatically, and how deep the read discount goes:
| Provider / model | Input rate | Cache read | Cache write | How it works |
|---|---|---|---|---|
| GPT-5.6 Sol (OpenAI) | $4.00/1M | $0.40/1M (10%) | 1.25x input rate | Automatic; explicit breakpoints on the GPT-6 family |
| GPT-6.1 Sol (OpenAI) | $2.00/1M | $0.10/1M (5%) | $2.50/1M (1.25x) | Automatic, with optional explicit breakpoints |
| Claude Sonnet 5.5 (Anthropic) | $2.00/1M | $0.20/1M (10%) | $2.50/1M (5-min) / $4.00/1M (1-hour) | Explicit cache breakpoints in the prompt |
| Claude Opus 5.5 (Anthropic) | $4.00/1M | $0.20/1M (5%) | $5.00/1M (5-min) / $8.00/1M (1-hour) | Explicit cache breakpoints in the prompt |
| Gemini 4 Argon (Google) | $2.00/1M intro | $0.10/1M (5%) | No write fee | Implicit only — Google detects repeated prefixes; no explicit caching |
Two strategic differences matter. OpenAI and Google cache automatically — you get discounts for accidental repetition, but less control. Anthropic makes you declare cache breakpoints, which is more work and more power: you decide exactly where the stable prefix ends, and you choose how long entries live. That choice — the TTL — is a pricing decision, covered below.
The Cache-Write Break-Even
Cache writes are the cost everyone sees and the bargain everyone misses. Take the reference workload's 48K-token prefix on GPT-5.6 Sol. Writing it once costs 48,000 x $5.00/1M (the 1.25x write rate) = $0.24 — versus $0.192 to just send it uncached, a premium of only $0.048. Every reuse then costs $0.0192 instead of $0.192, saving $0.1728 per read. The write premium is recovered on the first reuse, and every read after that is nearly pure savings. Anthropic's 5-minute write (also 1.25x) breaks even the same way. The only losing scenario is a prefix that is written and never re-read — which is why one-shot workloads shouldn't bother, and everything repetitive should.
TTL: The 5-Minute vs 1-Hour Decision
Anthropic's two write tiers exist because cache entries expire. The 5-minute write costs 1.25x input; the 1-hour write costs 2x input (on Sonnet 5.5, $4.00 vs $2.50 per 1M). The right choice is a frequency question: if the same prefix is re-hit at least every five minutes — a busy chatbot, an agent loop — the cheap write keeps renewing itself and the 1-hour tier is wasted money. If requests arrive in bursts separated by quiet gaps — an internal tool used a few times an hour — the 5-minute entries keep expiring and re-writing, and the 1-hour write is cheaper in total. Check your usage dashboard's cache-read ratio by hour; a sawtooth pattern is the signature of a TTL mismatch.
Structuring Prompts for Cache Hits
1. Fixed order, every time. The stable prefix must be byte-identical across calls. Build your prompts programmatically from fixed templates.
2. Nothing dynamic in the prefix. Timestamps, request IDs, user names — if any of it sits inside the cached region, every request has a different prefix and nothing ever hits the cache. Move all dynamic content after the stable block.
3. Longest stable content first. Order the stable blocks by how rarely they change: system prompt first, then reference documents, then conversation summaries, then the live request.
4. Don't reshuffle tool definitions. In agentic loops, the tool schemas are often a large, stable block — perfect cache material. Pin them.
5. Verify, don't assume. After restructuring, check the cached-token ratio in your usage dashboard. You're aiming for 80%+ of input tokens served from cache on repetitive workloads.
Realistic Hit Rates
- Coding agents with stable repo context: 70–90% of input tokens cached is realistic.
- Chatbots with fixed system prompts: 50–80%.
- One-shot or highly variable tasks: 0–30%. Don't force it; caching is for repetition.
Which Workloads Benefit Most
Biggest winners: agentic coding loops, RAG systems with fixed document sets, chatbots with long system prompts, eval harnesses. Modest benefit: mixed workloads with partial repetition. Skip it: truly one-off inference where the input is never repeated.
Debugging a Cache That Won't Hit
Capture two consecutive prompts, diff them, and look at exactly which tokens differ. Common offenders: timestamps injected by templates, session IDs in instructions, tool definitions regenerated per call with non-deterministic ordering, conversation history prepended before the system prompt instead of appended after it.
A Second Worked Example: The Support Chatbot
A support bot carries a 30K-token stable prefix — system instructions, product documentation, policy text — and answers 20,000 conversations a day on Claude Sonnet 5.5. The prefix alone, uncached, is 20,000 x 30,000 = 600M input tokens a day: $1,200/day, $36,000/month, spent re-reading the same documents. With the prefix cached at $0.20/1M, that line becomes $120/day, $3,600/month — a $32,400 monthly difference from one architectural decision, before counting the per-message tokens at all. This is why we tell teams to calculate their bill with the cache ratio as an explicit input: on prefix-heavy workloads it isn't a discount, it's the difference between a viable product and a bonfire.
The Bottom Line
Prompt caching is the closest thing to free money in LLM APIs: a ~90% discount on your largest token category, available for the cost of ordering your prompts correctly. Fix the order, check the dashboard, and watch the input line of your invoice collapse.
FAQ
Do I need to change my code to use prompt caching?
On OpenAI and Google, no — caching is automatic for repeated prefixes, though OpenAI's GPT-6 family also accepts explicit breakpoints. On Anthropic, yes: you mark the end of the stable prefix with a cache-control breakpoint. In all cases you need to structure prompts so a stable prefix exists; the code change is usually an afternoon, the prompt restructure is the real work.
Why is my cache hit rate near zero?
Almost always a prefix that isn't actually stable: a timestamp, session ID or reordered tool definition inside the cached region makes every request a brand-new prefix. Diff two consecutive prompts byte by byte — the culprit is in the first difference. Section six above lists the usual offenders.
Does caching change model output?
No. The cached computation is the model's own processing of identical tokens; outputs are the same as they'd be uncached (subject to normal sampling variation). Caching changes what you pay, not what you get.
Does caching stack with the Batch API?
Yes, on all three providers — batched requests with a stable prefix receive both the ~50% batch multiplier and the cached-input rate. Combined with routing, it's the third layer of the discount stack in our batch guide.
Cache rates are published October 2026 rate-card figures (OpenAI and Anthropic pricing documentation and trackers, verified October 2026); workload figures are illustrative. Rates change — confirm on the provider's pricing page before committing.