Prompt Caching Calculator
Compare the cost of repeated calls with and without prompt caching and find the break-even number of calls, using published cache read and write prices.
Private by design: everything you enter is processed in your browser. It is not sent to our servers.
How to use
- Choose a model and, where offered, the cache duration (5 minutes or 1 hour).
- Enter the tokens in the reusable prefix (the part you cache), the tokens that change on each call, the output tokens, and how many calls reuse the prefix while the cache is valid.
- Compare the total with and without caching, the saving, and the number of calls at which caching starts to pay off.
- Change the number of calls to see how the saving grows. Copy a share link to keep the scenario.
Worked example
A document-Q&A feature sends the same 20,000-token document before every question. With Claude Sonnet 5.5 and the 5-minute cache, ten questions arrive inside the cache window.
| Model | Claude Sonnet 5.5 |
|---|---|
| Prefix (cached) | 20,000 tokens |
| Changing part | 500 tokens |
| Output | 300 tokens |
| Calls in the window | 10 |
| Cache duration | 5 minutes |
Result
| Without caching | $0.44 |
|---|---|
| With caching | $0.108 |
| Saved | $0.332 (75.5%) |
| Break-even | 2 calls |
The first call pays the cache-write price on the prefix; each later call pays the much lower cache-read price. Anthropic’s 5-minute write costs 1.25× normal input, so one extra call recovers the premium.
How it works
Without caching every call pays normal input price for prefix and changing tokens. With caching the first call pays the cache-write price for the prefix and every later call within the cache lifetime pays the cache-read price, while the changing tokens and the output are billed normally.
Break-even is the smallest number of calls N where cached cost is no more than uncached cost. With W = prefix × (write − input) the extra paid once and S = prefix × (input − read) the saved per cached read, cached(N) − uncached(N) = W − (N − 1) × S, so N = 1 + ⌈W ÷ S⌉.
Prices are taken from each provider’s pricing page: Anthropic publishes separate 5-minute and 1-hour write prices and a read price per model; OpenAI’s page lists one “cache writes” price and a cached-input price; for Gemini 3.5 Flash-Lite only a cached-input price is published, so writes are treated as normal input.
The model assumes every call after the first hits the cache. In real traffic some calls miss because the entry expired or the prefix changed, which lowers the saving.
Common errors
calls must be at least 1.- Enter at least one call; the first call creates the cache entry.
This model has no published cache-read price.- Pick a model that lists a cache or cached-input price.
No separate cache-write price is published for this model, so writes are treated as normal input.- This is a note, not a failure. The first call is billed at the normal input price in this calculation.
The cache-read price is not lower than the normal input price, so caching cannot save money here.- Check the model; for the models listed this should not appear.
Limits
- The calculator assumes all later calls hit the cache and arrive inside the cache lifetime. Misses, evictions and minimum cacheable prompt sizes are not modelled.
- Provider rules for what can be cached (minimum tokens, how breakpoints work, whether writes are charged automatically) are not checked; read your provider’s caching documentation.
- Cache storage fees (for example Gemini’s per-hour storage price) are not included.
- Only standard list prices are used; batch discounts and regional uplifts are ignored. Haiku 5.5 uses its higher long-prompt tier above 100,000 total input tokens.
Privacy
Only numbers are processed, in your browser. Nothing is sent anywhere. No account is needed, no cookies are set and no analytics run. See thePrivacy Policy. The “Copy share link” button puts your settings after the “#” in the address; browsers do not send that part to servers, and the page’s canonical address never includes it.
FAQ
When is caching not worth it?
When the prefix is small, when calls are too far apart for the cache to still be valid, or when you make only one call per cache entry. The break-even figure tells you how many reuses are needed.
What is the difference between the 5-minute and 1-hour cache?
For Anthropic the 1-hour write price is higher, so it needs more reuses to break even but survives longer gaps between calls.
Do cached tokens still count toward the context window?
Yes. Caching changes the price of the repeated tokens, not the size of the prompt.
Why does the OpenAI model show a write price?
The OpenAI pricing page lists a “cache writes” column for these models. Check OpenAI’s prompt caching documentation for when it is charged.
Related
Embed this tool
Paste this snippet into your own page or docs to show the tool inline. The embedded view works the same way (everything runs in the visitor’s browser) and carries a small link back to MakeTools.
Sources
- ai.google.dev/gemini-api/docs/pricing – checked 2026-10-14
- developers.openai.com/api/docs/pricing – checked 2026-10-14
- platform.claude.com/docs/en/about-claude/pricing – checked 2026-10-14
Page last updated 2026-10-14. Written by Prajyot Mulik; see the editorial policy.