Prompt caching savings calculator
Set to a long retrieval chat on Claude Sonnet 5.5, where every turn resends large documents. Compare the monthly bill with and without caching, then try other models.
$0.00
$0.00
- Input tokens per session
- Output tokens per session
- Longest request with reply
Turn by turn, one session
| Turn | Input that turn | Total so far | With caching |
|---|
What gets cached
Caching stores the beginning of a prompt so that later requests starting with the same text are cheaper and faster. Anything that changes, like the newest message, is billed normally.
Order matters: put the system prompt, tool definitions and long documents first, and the changing conversation after them, so the shared prefix is as long as possible.
Reads, writes and expiry
Most providers charge a cached read at 10% or less of the input price. Some charge extra to write to the cache; the simulator includes each model’s write price.
Caches expire after a few minutes without use. Steady traffic keeps them warm; a chat where users reply after long pauses gets fewer hits than this model assumes.
| Model | Input | Cached read | Share |
|---|---|---|---|
| Claude Sonnet 5.5 | $2.00 | $0.10 | 5% |
| GPT-5 | $1.25 | $0.125 | 10% |
| Gemini 3.1 Pro | $2.00 | $0.20 | 10% |
| DeepSeek Pro (off-peak) | $0.66 | $0.022 | 3% |
| GPT-4o | $2.50 | $1.25 | 50% |
Other AI setups
- OpenAI API cost calculator5 models
- Claude API cost calculatorHaiku · Sonnet · Opus
- Gemini API cost calculatorFlash · Pro
- DeepSeek API cost calculatorOff-peak rates
- Prompt caching savings calculator
- AI agent cost calculator20 turns
- Context window calculator128K to 1M
- Private token counter
Related
Questions
How long does a prompt cache last?
Usually around five minutes after the last use, refreshed on each hit. Anthropic also offers a longer one-hour cache at a higher write price.
Is there a minimum prompt length for caching?
Yes. Providers only cache prefixes above a minimum, typically around 1,000 tokens. Short prompts are billed normally.
Why is my real cache hit rate lower than expected?
Any change near the start of the prompt, such as a timestamp or a user name in the system prompt, breaks the shared prefix. Keep the start of the prompt identical across requests.
Does caching work for single requests?
Only if many requests share the same prefix, like a fixed system prompt. For one-off prompts there is nothing to reuse.