Prompt Caching Savings Calculator
Find how much prompt caching saves when a large share of your input tokens (a system prompt, shared context, or document) repeats across requests.
Inputs
- Monthly Input Tokens (millions)
- Cache Hit Rate (% of tokens repeated)
- Normal Input Price per Million Tokens
- Cached Price per Million Tokens
Paste this into any page — the widget stays live and updates automatically as this calculator improves. Using WordPress or Notion? See the embed guide.
Saved Scenarios
— select 2+ to compare| Metric | |
|---|---|
Monthly Savings
$108.00
Cost with Caching
$42.00
Cost without Caching
$150.00
Spark says
How it's calculated
Formula
- CachedTokens
- — Input tokens that repeat identically across requests (system prompts, shared documents, few-shot examples) and qualify for the cached-token discount
What is the Prompt Caching Savings Calculator?
This calculator finds how much prompt caching saves by charging a steeply discounted rate for input tokens that repeat identically across requests — a long system prompt, a shared reference document, or few-shot examples — instead of the full normal input price every time.
Use this when your application repeatedly sends a large, mostly-unchanging context (a long system prompt, a reference document, a codebase excerpt) alongside a smaller varying user query, deciding whether restructuring a prompt to maximize cache-eligible content is worth the engineering effort, or comparing providers with different cached-token discount rates.
How to use it
- 1 Enter your total monthly input tokens in millions.
- 2 Enter what share of those tokens repeat identically across requests (your cache hit rate).
- 3 Enter the normal and cached price per million tokens, and read your monthly savings.
Understanding Prompt Caching Savings Calculator
Prompt caching is one of the highest-leverage LLM cost optimizations available for a specific, common class of applications: any use case that repeatedly sends a large block of identical or near-identical context — a long system prompt, an embedded reference document, a set of few-shot examples, or accumulated conversation history in a multi-turn chat — alongside a comparatively small, genuinely varying user query on each request.
The mechanism behind prompt caching is straightforward once understood: a provider caches the internal computed representation of a specific prefix of input tokens after processing it once, then reuses that cached representation on subsequent requests that share the identical prefix, charging a steeply discounted rate (commonly a tenth or less of the normal input price) for those reused tokens instead of fully reprocessing them from scratch. This is a genuine computational shortcut, not merely an accounting discount, which is why the savings can be so substantial for the right usage pattern.
The critical, easy-to-miss detail that determines whether caching actually delivers its potential savings is prompt structure: because caching is prefix-based for most providers, the identical shared content needs to appear at the very start of the prompt, with any request-specific varying content — the actual user query — placed after it. A prompt structured the opposite way, with a varying element placed before the shared static content, breaks caching for everything that follows that variation, since the cached prefix has to match exactly from the beginning. This makes prompt structure itself a genuine, worthwhile engineering consideration for any application hoping to capture meaningful caching savings, not an afterthought.
Cache lifetime — how long a cached prefix remains available for reuse before expiring due to inactivity — is the other practical factor that determines real-world cache hit rate. A cache that expires between a user's requests (during a long pause in a conversation, for instance) won't deliver savings on the next request even if the prompt structure is otherwise perfectly cache-friendly, since the provider has to reprocess the prefix from scratch once the cache has expired. Checking a specific provider's cache lifetime against your application's actual request frequency and user behavior patterns gives a much more realistic estimate of achievable cache hit rate than assuming a theoretical maximum based purely on prompt structure alone.
For applications built around a genuinely large shared context — a coding assistant with an entire codebase or large file loaded as reference, a customer support bot with an extensive product knowledge base embedded in its system prompt, a document-analysis tool repeatedly querying the same large document — prompt caching very often represents one of the single largest cost optimization opportunities available, frequently dwarfing smaller optimizations in total dollar impact, and is worth prioritizing and structuring an application's prompts around deliberately rather than treating as an optional afterthought.
Worked examples
Advantages
- •Makes the concrete dollar value of prompt caching visible for your specific usage pattern.
- •Highlights how much cache hit rate itself matters, encouraging prompt structure that maximizes cacheable content.
- •Works for any provider's specific normal-versus-cached pricing.
- •Useful for justifying engineering time spent restructuring prompts to be more cache-friendly.
Limitations
- •Assumes a stable cache hit rate — real cache hit rates depend on cache lifetime (a cache typically expires after a period of inactivity) and request patterns, so verify your actual hit rate against your real traffic pattern rather than assuming a theoretical maximum.
Common mistakes
- ⚠️ Putting the varying user query before the shared static context in a prompt's structure, which breaks caching for many providers since the cache is typically prefix-based — content after the first change is no longer cache-eligible.
- ⚠️ Assuming caching applies automatically without provider-specific setup, when most providers require an explicit cache breakpoint or flag in the request rather than caching everything by default.
- ⚠️ Underestimating how much a large system prompt or reference document contributes to total token cost until directly calculating the cache savings available, especially for applications with a genuinely large shared context repeated on nearly every request.
Tips
- 💡 Why does prompt structure matter for caching? Most providers cache by prefix, meaning content must be identical and appear at the start of the prompt to be cache-eligible — putting the varying user query first breaks caching for everything after it.
- 💡 Structure prompts with static, shared content (system instructions, reference documents, few-shot examples) first, and the varying user-specific content last, to maximize the cache-eligible share of every request.
- 💡 Check your provider's cache lifetime (how long a cache stays warm between requests) against your actual request frequency, since a cache that expires between requests won't deliver the savings this calculator assumes.
- 💡 For applications with a genuinely large, mostly-static shared context (a long system prompt, an embedded reference document), prompt caching is often one of the single highest-leverage cost optimizations available — worth prioritizing before other, smaller optimizations.
Real-life uses
- Applications that repeatedly send a large, mostly-unchanging context (a long system prompt, a reference document, a codebase excerpt) alongside a smaller varying user query
- Deciding whether restructuring a prompt to maximize cache-eligible content is worth the engineering effort
- Comparing providers with different cached-token discount rates
- Multi-turn conversational applications where earlier conversation turns remain in context and repeat across each subsequent request
Frequently asked questions
Why does prompt structure matter for caching?
Most providers cache by prefix, meaning content must be identical and appear at the start of the prompt to be cache-eligible — putting the varying user query first breaks caching for everything after it.
How should I structure prompts to maximize caching?
Put static, shared content (system instructions, reference documents, few-shot examples) first, and varying user-specific content last.
Does caching apply automatically?
Not always — most providers require an explicit cache breakpoint or flag in the request rather than caching everything by default, so check your provider's specific implementation.
What determines real-world cache hit rate?
Cache lifetime (how long a cache stays warm between requests) against your actual request frequency — a cache that expires between requests won't deliver savings on the next one.
Which applications benefit most from prompt caching?
Applications with a genuinely large shared context repeated across requests — coding assistants with a loaded codebase, support bots with an embedded knowledge base, or multi-turn chat with accumulated conversation history.
calixo.cloud/ai/prompt-caching-savings-calculator/ — free calculator, no signup required.