Prompt Caching Savings Calculator
See how much caching your repeated system prompt or documents saves on an AI API bill, and when it pays off.
The part that is the same at the start of every request: system prompt, tool definitions, documents.
The part that changes, like the user's question. Never cached.
The reply, including any thinking tokens.
Use 22 for weekdays only.
Example prices: enter your provider's current rates.
Paid when the prefix is stored. Same as input if your provider adds nothing.
Paid each time the stored prefix is reused.
How long the cache lasts after its last use. Each hit resets the timer.
Share of requests that read the cache. The rest write it again.
The hours your requests are spread over. Also used for storage.
Different system prompts or documents, with requests split evenly between them.
Only if your provider charges to keep a cache. Leave 0 if not.
Prices are in US dollars. Enter today's rate to see results in another currency.
Per request, on average
A month, by part
How your caching saving is worked out
Cost without the cache, how often it's reused, cost with it, and the difference.
- 1
Without caching
$0.036 a request
× 1,000 a day
= $36.00 a day - 2
How often it's reused
1 − e^−3.47
= 96.9% hits
31 writes, 969 reads - 3
With caching
$1.16 write
+ $2.91 read
+ $6.00 rest
= $10.07 a day - 4
What you save
$36.00 − $10.07
= $25.93 a day
72% · $778 a month
Read more: the formula, a worked example and how providers price caching
Most AI APIs can cache the start of your prompt. When many requests begin with the same long text (a system prompt, tool definitions or a document), the provider stores it the first time (a cache write) and later requests reuse it (a cache read) at a fraction of the normal input price. The cache lasts a few minutes after its last use, so it only pays off if requests come often enough to reuse it before it expires.
The formula
without caching, a day = requests × (prefix + new input) × input price + requests × output × output price
chance of a hit = 1 − e^(−requests a minute per prefix × lifetime in minutes)
writes a day = requests × (1 − hit rate), at least 1 per prefix
with caching, a day = writes × prefix × write price + reads × prefix × read price + requests × (new input × input price + output × output price) + storage
saving = without − with
break-even reads per write = (write price − input price) ÷ (input price − read price)
(token counts ÷ 1,000,000 when prices are per million; batch takes its discount off every token cost)
Worked example
A chatbot has a 10,000-token system prompt, 500 new input tokens and 300 output tokens per request, and gets 1,000 requests a day spread over 24 hours. Example prices: $3 input, $3.75 cache write, $0.30 cache read and $15 output per million tokens, with a 5-minute cache.
- Without caching: (10,000 + 500) × $3 ÷ 1M + 300 × $15 ÷ 1M = $0.0315 + $0.0045 = $0.036 a request, so $36 a day and $1,080 a month (30 days).
- Hit rate: 1,000 requests over 1,440 minutes is 0.694 a minute, so in 5 minutes about 3.47 arrive. The chance a request finds the cache still warm is 1 − e^−3.47 ≈ 96.9%. That is about 31.05 writes and 968.95 reads a day.
- With caching: writes 31.05 × 10,000 × $3.75 ÷ 1M = $1.16; reads 968.95 × 10,000 × $0.30 ÷ 1M = $2.91; new input and output 1,000 × ($0.0015 + $0.0045) = $6.00. Total $10.07 a day, or about $302 a month.
- Saving: $36 − $10.07 = $25.93 a day, about $778 a month (72%), or $9,334 a year.
- Break-even: ($3.75 − $3) ÷ ($3 − $0.30) = 0.28, so each write pays for itself from the first read. Caching saves money at any hit rate above 0.75 ÷ 3.45 ≈ 21.7%.
When caching costs more
With only 10 requests a day, the 5-minute cache has nearly always expired by the next request: about 9.66 of the 10 requests write the cache again, and the day costs $0.42 instead of $0.36. A longer cache lifetime, fewer distinct prefixes or grouping requests into busy hours fixes this.
Tips
- Put the fixed part first and the changing part last. The cache only matches an identical beginning, so a date or user name at the top breaks it.
- Each provider has a minimum size before a prefix can be cached, often around a thousand tokens. Check yours.
- Several system prompts each need their own writes. Merging them, or sending more traffic to fewer prompts, raises the hit rate.
Prices in the fill-from-model list
| Model | Input | Write | Read | Output |
|---|---|---|---|---|
| Claude Fable 5.1 Anthropic | $10 | $12.5 | $1 | $50 |
| Claude Opus 5.5 Anthropic | $4 | $5 | $0.4 | $20 |
| Claude Sonnet 5.5 Anthropic | $2 | $2.5 | $0.2 | $10 |
| Claude Haiku 5.5 Anthropic · Prompts up to 100K tokens; $0.50 / $2.50 above that | $0.1 | $0.125 | $0.01 | $0.5 |
| GPT-5.6 Sol OpenAI · Prompts under 270K tokens | $5 | $5 | $0.5 | $30 |
| GPT-5.6 Terra OpenAI · Prompts under 270K tokens | $2 | $2 | $0.2 | $12 |
| GPT-5.6 Luna OpenAI · Prompts under 270K tokens | $0.2 | $0.2 | $0.02 | $1.2 |
| Gemini 3.1 Pro (preview) Google · Prompts up to 200K tokens; long prompts cost more | $2 | $2 | $0.2 | $12 |
| Gemini 3.8 Flash Google · Introductory price | $0.75 | $0.75 | $0.075 | $3.75 |
| Gemini 3.5 Flash-Lite | $0.3 | $0.3 | $0.03 | $2.5 |
US dollars per million tokens. Input and output prices are from our LLM API cost calculator list, checked on 9 October 2026 against each provider's pricing page. Cache prices there are approximate: reads at about a tenth of input, and writes at 1.25× input for Anthropic's 5-minute cache (other lifetimes and providers can differ). Some providers also charge for keeping a cache by the hour. Always confirm with your provider's own pricing page.
Common questions
How much does prompt caching save?
It depends on how big the repeated part of your prompt is and how often it is reused before the cache expires. In the worked example, a 10,000-token system prompt sent 1,000 times a day with a 5-minute cache cuts the bill from $1,080 to about $302 a month, a 72% saving.
What is a cache write and a cache read?
The first time a provider sees your prompt prefix it stores it: that is a cache write, which some providers (such as Anthropic) charge a little more for than normal input. Later requests that start with exactly the same prefix read it from the cache at a much lower price, about a tenth of normal input.
When does prompt caching not pay off?
When the cache expires before it is reused. If requests are far apart, almost every request writes the prefix again and pays the write price. With example prices of $3 input, $3.75 write and $0.30 read, each write needs at least one read to break even, and you need a hit rate above about 22%.
How long does a prompt cache last?
Usually a few minutes after the last use, and each hit resets the timer. Some providers offer longer lifetimes at a different write price, and some charge for storing a cache by the hour. Enter your provider's lifetime and prices under Advanced.
What should go in the cached prefix?
Anything that stays the same at the start of every request: the system prompt, tool definitions, long documents or examples. Put the parts that change, like the user's question, after it, because the cache only matches an identical beginning.
Can I use caching with the batch API?
Often yes. The batch discount then applies on top of the cache prices. Turn on the batch option under Advanced and enter the discount your provider gives.
Related calculators
Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.