Prompt caching lets an API reuse a long prefix you send with every request, such as a system prompt, tool definitions or a reference document. A cache hit is billed at a lower cached-input rate. A cache miss writes the prefix to the cache, and some vendors charge more than the normal input rate for that write. This calculator shows whether caching saves money for your traffic and what hit rate you need to break even.
How the estimate works
- Input per request = shared prefix tokens + unique tokens per request.
- Without caching, every input token is billed at the model’s standard input rate, and output at the output rate.
- With caching, the prefix is split by your hit rate. Hits are billed at the published cached-input rate. Misses are billed at the published cache-write rate (the shortest-TTL rate where a vendor lists more than one), or at the normal input rate when no write rate is published. Unique tokens and output stay at standard rates.
- Monthly cost = cost per request × requests per day × days per month.
- Break-even hit rate is the hit rate where caching costs the same as not caching. Below it, the extra write charges outweigh the cheaper reads.
Only models with a published cached-input rate appear in the picker. Rates that are introductory or promotional, such as Google’s current Gemini 4 Argon and Gemini 3.8 Flash rates, are left out rather than treated as list prices.
What the result does not include
Cache storage fees that some vendors bill per hour, the longer-TTL write rates, batch discounts, long-context tiers above the prefix you enter, and tax. Real hit rates depend on how often your prefix changes and on each vendor’s cache lifetime, so treat the hit rate as your assumption and check it against your API usage logs.
Related
API cost calculator · Batch API savings calculator · Context window cost calculator · LLM API pricing · Tokens explained
How we check prices
Per-token rates come from each vendor’s official pricing documentation. We rechecked the Anthropic, OpenAI, Google, xAI and Perplexity rates on 18 November 2026 (Asia/Colombo). DeepSeek and v0 rates date from 3 November 2026. Prices are USD and exclude tax. Corrections: [email protected].