Prompt Caching Savings Calculator (LLM API Costs)
Prompt caching lets an LLM provider bill the repeated part of your prompts — system prompt, few-shot examples, shared documents — at a steep discount when it is served from cache instead of reprocessed. Enter your monthly input volume, the share of it that is actually repeated, and the hit rate you expect, and the calculator splits the tokens into cache hits, cache misses, and never-cached traffic, prices each slice at the model's published rates (2026-07 snapshot), and reports the dollar saving, the percentage cut, and the blended price per million input tokens you would really pay. Claude models bill cache writes at a premium over plain input, so the calculator also shows the break-even hit rate below which caching costs you money — and says so plainly when it does.
Your traffic
Cacheable share: the part of every prompt that is repeated across requests (system prompt, few-shot examples, shared documents). Hit rate: how much of it is actually served from cache.
The model
Prices as of 2026-07 — snapshot of published list rates; verify before relying on them.
Monthly saving from caching
$120.60
$300.00 without caching → $179.40 with caching / month
Saving
40.20%
Effective input price
$1.79/MTok
Claude Sonnet 4.6 bills cache writes at a premium: below a 21.74% hit rate, caching would cost more than it saves.
Token & cost breakdown
Monthly cost vs cache hit rate
Compare scenarios
Run the same calculation with two or three input sets side by side. Differences are highlighted; every number comes from the same tested formula as the calculator above.
| Input | Scenario A | Scenario B |
|---|---|---|
| Monthly Input Tokens M | ||
| Cacheable Share Pct | ||
| Hit Rate Pct | ||
| Model Id |
How it works
Your monthly input tokens are split three ways. Cacheable tokens = volume × cacheable share: the part of every request that is identical across calls, like a long system prompt or a document every user asks about. Of those, hits = cacheable × hit rate are served from cache at the cached-input price; the rest are misses that must be (re)written. Everything outside the cacheable share — the user's actual question, per-request context — is billed at the plain input price no matter what. At the defaults, 100 MTok with a 60% cacheable share and an 80% hit rate splits into 48 MTok of hits, 12 MTok of misses, and 40 MTok of plain input.
Each slice is priced from the 2026-07 snapshot of published rates. Hits cost the provider's cached-input price — typically 10× cheaper than plain input. Misses cost the plain input price on OpenAI and Gemini, but on Claude models they cost the cache-WRITE price, about 25% above plain input: that premium is the whole reason caching can backfire. For Claude Sonnet 4.6 ($3 input, $0.30 cached read, $3.75 cache write per MTok), the default case costs 48×$0.30 + 12×$3.75 + 40×$3 = $179.40 against a $300 no-caching baseline — a $120.60 (40.2%) saving, or an effective $1.79 per million input tokens.
Savings = baseline − with-caching cost, and it is allowed to be negative. On write-premium models the break-even hit rate is (write − input) ÷ (write − cached read): 21.7% for the current Claude rates. Below it, every cached request costs more than an uncached one would have; above it, the discount on hits outruns the premium on misses. The chart sweeps the hit rate from 0% to 100% at your volume and cacheable share so you can see exactly where your setup sits on that curve — and how much headroom a better-structured prompt (stable prefix first, volatile content last) would buy.
Frequently asked questions
What share of my input is actually cacheable?+
Only the part that is byte-identical across requests and sits at the START of the prompt: providers match cached prefixes, so a stable system prompt, fixed few-shot examples, and shared reference documents count, while anything after the first varying token does not. Chat histories are partially cacheable (each turn extends the prefix), one-off prompts are not. Also check your prompts clear the provider's minimum cacheable length — providers only cache prompts beyond a threshold on the order of a thousand tokens, so short system prompts may never be cached at all. Figures are as of 2026-07 — verify current conditions on the provider's docs.
Why can the savings be negative on Claude models?+
Because Anthropic bills cache WRITES at a premium — about 25% above the plain input price ($3.75 vs $3.00 per MTok on Sonnet 4.6, as of 2026-07). Every cache miss on a Claude model is a write, so with a low hit rate you pay the premium often and collect the cheap cached reads rarely. At the current rates the break-even hit rate is roughly 22%: below that, caching genuinely increases your bill, and the calculator shows the negative number instead of hiding it. OpenAI and Gemini have no write premium in this snapshot, so caching there is at worst a wash. This is arithmetic on published prices, not billing advice — verify your own traffic.
What hit rate should I assume?+
It depends on cache lifetime versus your traffic pattern, and both vary by provider — caches typically expire after minutes of inactivity (Anthropic's default TTL is short, with a paid longer option; OpenAI and Gemini manage expiry automatically), so steady traffic that keeps re-hitting the same prefix scores high while bursty or long-tail traffic scores low. A busy production assistant with one shared system prompt can sit above 80%; a nightly batch job whose cache expires between runs can sit near 0%. Measure it: providers report cached token counts in API responses. TTLs, minimum prompt lengths, and pricing are as of 2026-07 — verify before relying on them.
Related tools
Sources
Embed this calculator
+
Drop this calculator into your own site — free. Keep the credit link below the frame: it’s how the free embed stays free.