Prompt Caching Savings Calculator
How much prompt caching saves when many requests share a long prefix — system prompt, documents, few-shot examples — given the discount on cached reads, the premium on cache writes, and how often the cache is reused before it expires.
A cached prefix is read at a fraction of the normal input price, but writing it costs a premium, so caching only pays once the prefix is reused enough times.
How the prompt caching savings calculator works
A cached prefix is read at a fraction of the normal input price, but writing it costs a premium, so caching only pays once the prefix is reused enough times. With a 90% read discount and a 25% write premium the break-even is under two reuses; with a smaller discount it is several.
The saving scales with how much of each request is the shared prefix: a 20,000-token document with a 200-token question is almost all cacheable, and the bill falls by most of the discount.
Formula: without = n × (prefix + unique) × price; with = writes × prefix × price × (1 + premium) + (n − writes) × prefix × price × (1 − discount) + n × unique × price
Worked examples
| Inputs | Daily saving | Note |
|---|---|---|
| A 20k document, 5,000 questions a day | 263.1 | saves most of the bill |
| A cache that expires fast | -75 | caching costs more |
| A short prefix | 6.58 | little to gain |
FAQFrequently asked questions
What is prompt caching?
Storing the processed form of a prompt prefix so later requests that start the same way skip re-reading it. Providers charge a fraction of the input price for cached tokens.
What can be cached?
Anything at the start of the prompt that repeats exactly: system instructions, reference documents, tool definitions, few-shot examples. The unique part — the user's question — comes after.
Why is there a write premium?
Because storing the cache costs the provider memory. Most charge 10 to 25% over the normal price to write, then a large discount to read.
When does caching not pay?
When the prefix is short, when requests are too infrequent to reuse the cache before it expires, or when the prefix changes between requests — a timestamp at the top breaks it.
What is a typical saving?
Fifty to ninety per cent of input cost for document-heavy or agentic workloads where the same context is read thousands of times. Output tokens are unaffected.
Where these figures come from
- Vaswani et al. (2017) — Attention Is All You Need — the transformer architecture the memory arithmetic follows
- Kaplan et al. (2020) — Scaling Laws for Neural Language Models — the compute relationship used for training estimates
- Hoffmann et al. (2022) — Training Compute-Optimal Large Language Models — the tokens-per-parameter guidance ("Chinchilla")
- IEEE 754 — Standard for Floating-Point Arithmetic — the numeric formats behind bytes per parameter
- NIST AI Risk Management Framework — the US federal AI framework
Last checked: September 2026. The relationships here are architectural, not vendor-specific: bytes per parameter follow the numeric format, KV-cache size follows the transformer definition, and token-per-word ratios come from published tokeniser behaviour.