Prompt Caching Savings Calculator
Prompt caching lets you reuse the computed KV cache of a large system prompt or document prefix across multiple API calls — dramatically reducing costs for applications with stable, large contexts. Anthropic charges 10% of standard rate for cache reads (vs 125% for cache writes). The savings depend on your system prompt size, call volume, and cache hit rate. This calculator shows exact monthly savings and the call volume where caching becomes worth implementing. Because provider pricing changes — and goes stale silently — every price and cache multiplier here is a field you control, not a number baked into the page. Verify current pricing on the provider's page before you rely on a forecast.
per month
per month
Gray = uncached monthly cost. Blue = cost with caching. The gap between the bars is your monthly savings.
View the TypeScript implementation on GitHub: packages/calc/src/prompt-caching-savings.ts · view tests
What this means
Prompt caching is one lever: it makes the stable, repeatedpart of your prompt cheap, and does nothing for the parts that change. The whole result hinges on a single number, the blended prefix factor — the share-weighted mix of the cheap cache-read rate and the more expensive cache-write rate. When most of your calls reuse the same warm prefix, that factor collapses toward the read rate (around a tenth of base) and the cacheable tokens nearly fall off your bill. When the cache keeps expiring before it’s reused, the factor climbs toward the write rate and caching quietly becomes a tax instead of a discount.
In my experience the biggest wins come from RAG and agent workloads with a fat, fixed preamble — a long system prompt, a retrieved-document block, a tool schema, a few-shot exemplar set — hit thousands of times an hour. There the prefix dwarfs the unique input and the hit rate is naturally high, so the savings line in the chart above gets dramatic. The related LLM Cost Calculator is the right next stop once you know the cached number: it rolls caching into your full monthly spend across input, output, and volume.
I’ve found the failure mode is the opposite shape: short, unique, low-volume prompts. If every request is personalized and traffic is sparse enough that the 5-minute cache expires between calls, you pay the write premium on nearly every call and never collect the read discount. That’s why the hit rate is an input you can drag to zero and watch the savings go red — the calculator is happy to tell you not to cache. And because provider prices change without warning, every rate here is editable; the presets are dated and labeled “verify current pricing” so a stale number never masquerades as a fact.
Worked example
Take a RAG assistant with a 50,000-token cached prefix (system prompt plus retrieved context), 500 unique input tokens, and 500 output tokens per request, at 10,000 requests/month. Price it at a Sonnet-class $3/M input and $15/M output, with the typical Anthropic cache economics — write 1.25×, read 0.1× — and a 90% hit rate.
Without caching:input is 50,500 tokens × $3/M = $0.1515/req, output is 500 × $15/M = $0.0075/req, so $0.159/req × 10,000 = $1,590/month.
With caching:the blended prefix factor is 0.9×0.1 + 0.1×1.25 = 0.09 + 0.125 = 0.215, so the 50,000-token prefix costs 50,000 × $3/M × 0.215 = $0.03225/req. Add unique input ($0.0015) and output ($0.0075) for $0.04125/req × 10,000 = $412.50/month. That’s a $1,177.50/month saving — about 74%off — and the cacheable prefix’s effective price drops from $3/M to $0.645/M.
Now break it. Set the hit rate to 0%: the factor becomes the bare write multiplier, 1.25, the prefix costs $0.1875/req, and the monthly bill climbs to $1,965 — $375 MORE than not caching at all. The crossover sits wherever the blended factor passes 1.0. That single sign-flip is the entire decision: cache the fat, frequently-reused preamble; leave the sparse, unique prompt alone.
Frequently asked questions
The information and tools on this website are for general educational purposes only and do not constitute financial, investment, legal, or tax advice. Consult a licensed professional for decisions specific to your situation.