Click any words you think contain an error. Click again to unmark.
Prompt caching discounts INPUT tokens only, not output.
Imagine a bakery that gives you ninety percent off flour but full price on the cake itself. If your order is mostly cake with a little flour, the discount barely shows up on the receipt. Prompt caching is the flour discount. It cuts the cost of the long, repeated instructions you send in, but it does nothing for the long answer the model writes back. When the model writes a three thousand word essay, that essay is the cake, and you pay full price for every word. The total bill drops a little, not a lot.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Prompt caching is genuinely transformative for the right workload, and dramatically oversold for the wrong one. The claim under review takes a real provider feature, the ninety-percent input-token discount on cache hits, and projects it across the whole invoice. The result is a prediction that is wrong by roughly six times on the scenario described, and the source of the error is a single category mistake that recurs in many forms in production cost discussions.
The scenario is a long-form writing assistant: about 2200 input tokens (2000 system, 200 user) producing about 3000 output tokens of essay. The author has correctly noticed that the system prompt is stable across requests and that caching it should help. They have then leapt to the conclusion that the per-token discount on cached input flows through to the whole bill. It does not, for two reasons that compound.
This walkthrough builds the right cost model from the price sheet up, applies it to the scenario, and explains which workload shapes genuinely realize the headline discount and which do not. By the end you should be able to project the bill impact of turning on caching for any new workload on a napkin, and to identify workload redesigns that recover more of the headline figure when it matters.
How LLM pricing actually works
Every major provider in 2026 charges separately for input and output tokens, and the two prices are very different. Anthropic's Claude lineup runs roughly $3 per million input tokens and $15 per million output tokens for the mid-tier model; a five to one ratio. OpenAI's GPT-5 and o4 lineup runs roughly four to one. Google's Gemini lineup is similar. The factor varies by provider and SKU but the direction is consistent: output costs more than input, often by a multiple.
The price difference reflects the underlying serving cost. Input is processed in the prefill phase, which runs all the input tokens through the model in one parallel forward pass. That phase is compute-bound on modern hardware and amortizes well across batched requests, especially when prompts share a prefix. Output is produced in the decode phase, which generates tokens sequentially, one per forward pass, and is memory-bandwidth-bound per request. Decode is the expensive side; input is the cheap side. The price sheet bakes this asymmetry in.
Prompt caching adds a third tier. On a cache hit, the provider skips the prefill work for the cached portion of input and charges a deeply discounted rate. Anthropic charges roughly ten percent of the normal input rate on hits, with a slight write premium on the first call that populates the cache. OpenAI charges roughly fifty percent on hits with no write premium. The exact factor matters for the math, but the structural property is the same on every provider: the discount applies to input only, and only to the prefix-hit portion of input, and not at all to output.
This is the entire structural fact the original argument missed. Output is the expensive part of the bill, caching does not touch it, and on any workload where output is non-trivial the headline discount cannot flow through to the invoice.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Anthropic Claude pricing in 2026: input $3/M, output $15/M (5x), cache reads at ~$0.30/M (10x discount on input). A 90% input-token cut buys 12-15% bill cut on output-heavy chat.
- OpenAI o4 and GPT-5 pricing show output at 4x input with automatic prompt caching at ~50% discount; realized bill savings on generation-heavy apps land near 5-10%.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhat is the maximum possible bill reduction from prompt caching alone, even with a perfect hit rate?
Cap is the input share of the bill multiplied by (1 - d). If output is 80% of the bill, the input share is 20%, and even a perfect 90% input discount cuts only 18% of the total. The output side cannot be touched, so saving has a hard ceiling set by the workload mix.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Multiplying a per-token input discount by the whole invoice and predicting a 90% bill cut. Output tokens carry the bulk of cost on generation-heavy workloads and the cache does not touch them.
60 second bullets to scan on the way to the call.
How input and output tokens are billed separately, with output typically 3-5x input
Why prompt caching discounts only input tokens, never output
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.