Prompt Caching Savings Calculator
See how much prompt caching saves on your monthly LLM API bill. Enter the repeated prefix, the fresh input, the output, your request volume and your cache hit rate.
Updated November 19, 2026
Prompt caching savings
5-minute cache: writes cost 1.25x the input price, reads 0.1x. Prices updated November 18, 2026.
Share of requests that find the prefix already cached. Steady traffic within the cache lifetime is often 80 to 95%.
System prompt, tools, documents or examples that repeat exactly.
The part that changes each time, such as the user message.
With a 25% write premium, caching only pays off above a 21.7% hit rate.
The cached prefix alone costs $2,000.00 without caching and $430.00 with it.
Estimate only. Ignores cache storage fees, minimum cacheable prompt sizes and cache expiry beyond what your hit rate captures. Check your provider's pricing page before budgeting.
How prompt caching is billed
Prompt caching lets the provider reuse the processed form of a long, repeated prompt prefix, such as a system prompt, tool definitions or a reference document. Cache hits are billed at a fraction of the normal input price (about 10% for the models listed here). Some providers also charge a premium to write the prefix to the cache; Anthropic's 5-minute cache costs 1.25× the input price for writes.
How to use it
- Pick a model. Prices come from the same table as the LLM cost calculator, so the two pages always agree.
- Enter the tokens in the repeated prefix and the tokens that change on each request, plus the output length.
- Enter requests per month and your expected cache hit rate.
Formula
Cost per request = (uncached input × input price + output × output price + prefix × input price × cache factor) ÷ 1,000,000, where cache factor = hit rate × read multiplier + (1 − hit rate) × write multiplier. Without caching the factor is 1.
Worked examples
- Claude Sonnet 5.5 ($2 in, $10 out per 1M), 10,000-token prefix, 500 new input tokens, 300 output tokens, 100,000 requests, 90% hit rate: without caching $2,400; with caching the prefix factor is 0.9 × 0.1 + 0.1 × 1.25 = 0.215, so the bill is $830, saving $1,570 (65.4%).
- The same workload with a 0% hit rate costs $2,900, which is $500 more than not caching, because every request pays the 1.25× write price. Break-even is a hit rate of 0.25 ÷ 1.15 = 21.7%.
Counting tokens first? Use the AI tokens calculator.
Get this free widget for your site
Show what prompt caching saves on an LLM API bill from prefix size, hit rate and monthly requests. Free to use; the snippet includes a "Powered by MyFreeToolkit" link back to this tool.
See all free widgets.
See also
- Compare model prices without caching with the LLM cost calculator.
- Not sure how many tokens your prefix is? Use the AI tokens calculator.
- Building retrieval over your documents? Estimate it with the RAG cost calculator.
Frequently Asked Questions (FAQ)
It depends on how much of each request is a repeated prefix and how often it hits the cache. With a 10,000-token prefix, 500 new tokens and a 90% hit rate on Claude Sonnet 5.5, caching cuts the input and output bill by about 65%. Short prefixes save little because the changing part and the output dominate.
Steady traffic that reuses the same prefix within the cache lifetime (5 minutes for Anthropic's default cache) often reaches 80 to 95%. Bursty or low-volume traffic can fall under 50%, because the cache expires between requests.
Yes, on providers that charge a premium to write the cache. Anthropic charges 1.25× the input price for 5-minute cache writes, so a very low hit rate costs more than no caching. The calculator shows the break-even hit rate (about 22% with the default prices).
Their automatic caching has no write premium, so you only pay the normal input price on a miss and a reduced price on a hit. Google's explicit caches also charge a storage fee per hour, which this calculator does not model.
The prefix must match exactly, token for token, from the start of the prompt. Put static content first (system prompt, tools, documents) and variable content last. Providers also require a minimum prefix length, often 1,024 tokens or more.
From the same price table as the LLM cost calculator, with the cache multipliers from each provider's pricing page. Prices change often, so check the provider before budgeting.
Related Tools
- RAG Chunking and Embedding Cost CalculatorEstimate RAG chunk count, one-off embedding (indexing) cost and monthly query cost from document size, chunk size, overlap, embedding price and retrieval settings. Prices are dated and editable.
- AI Token CounterCount tokens, words and characters in your prompts for GPT, Claude, Gemini and Llama.
- Tokens to Words, Pages and Books ConverterHow many tokens in a word, page or 1,000 words? Convert words, pages and books to tokens and back for six languages.
- LLM Context Window CalculatorCheck if your tokens, words or pages fit GPT, Claude, Gemini, Llama and Qwen context windows, with room for the reply, tokens left and the KV cache memory that context needs.
- LLM VRAM CalculatorEstimate how much GPU memory (VRAM) you need to run a local LLM, and which GPUs can run it.
- KV Cache CalculatorMemory per token and total KV cache from layers, KV heads, head dimension, context, batch and precision, with GQA and context-length views.