Prompt caching calculator

What does prompt caching actually save you?

Model your reusable prefix, cache hit rate, and request volume. The calculator applies each provider’s real cache-read and cache-write prices — including Anthropic’s 1.25×/2× writes and Gemini’s hourly storage.

Free · no sign-upRuns in your browser.Cache rates re-verified Aug 16, 2026

Cache writes are modeled conservatively: the share of requests that miss the cache re-writes the prefix at $2.50 per 1M tokens (Anthropic/OpenAI write pricing). Anthropic’s 1-hour cache write costs 2x input instead of 1.25x — better for sessions longer than an hour.

OpenAI caching engages automatically for prompts of 1,024+ tokens with a stable prefix; xAI, DeepSeek, and Kimi cache automatically too. Anthropic requires cache_control markers. Rates re-verified Aug 16, 2026.

01

Put the stable part first

Caches match the longest unchanged prefix. System instructions, tool schemas, and shared documents belong at the top; timestamps, user IDs, and per-request data belong at the bottom. One changed character near the top invalidates everything after it.

02

Reads are cheap; writes can cost

Cache reads run about 10% of the input price almost everywhere (DeepSeek’s are ~1/120th). Anthropic and OpenAI also bill the first write at 1.25× input — worth it whenever a prefix is read more than a couple of times.

03

Measure your real hit rate

Savings scale linearly with hit rate. Provider usage responses report cache-read and cache-creation tokens separately — log them and feed the measured rate back into this calculator.

Cross-provider reference

Cache read and write prices, August 2026

USD per 1M tokens. Read the provider’s documentation before relying on a specific TTL or minimum.

ProviderMechanismCache read / 1MCache write / 1MCache lifetime
Anthropic (Claude)Explicit cache_control markers10% of input ($0.20 on Sonnet 5)1.25× input (5 min) · 2× input (1 hour)5 minutes or 1 hour
OpenAI (GPT-5.6)Automatic for 1,024+ token prefixes10% of input ($0.20 on Terra)1.25× input, billed on write5–10 min, refreshed on use
Google (Gemini)Implicit + explicit caching~10% of input ($0.20 on 3.1 Pro)No write fee; explicit storage $0.50–$4.50 / 1M tokens / hourExplicit cache minimum 4,096 tokens
xAI (Grok)Automatic prompt caching$0.30 (Grok 4.5) · $0.50 (Grok 4.6)None5–15 min, refreshed on use
DeepSeekAutomatic disk cache$0.003625 (V4 Pro) — ~1/120 of inputNoneHours (automatic)
Moonshot (Kimi)Automatic context caching10% of input ($0.30 on K3)NoneAutomatic
MistralCached input90% off ($0.05 on Large 3)None
Plain-English answers

Caching cost questions

What is a cache read cost?

The price a provider charges for input tokens served from cache instead of being processed fresh. It is dramatically cheaper than normal input — typically 10% (Anthropic, OpenAI, Kimi), 15–25% (xAI), 90% off (Mistral), or about 1/120th of input on DeepSeek.

Is prompt caching worth it?

Whenever the same prefix is sent repeatedly — chat history, system instructions, shared documents — caching cuts input cost substantially, often 40–70% of the total bill. Workloads with a unique prompt on every call see no benefit, and prefixes must usually exceed a minimum size (1,024 tokens on OpenAI, 4,096 on Gemini explicit caches).

Does caching change results?

No — a cache hit returns the same processed prefix the model would compute fresh. It affects price and latency, not output quality. Content that changes between requests simply misses the cache and bills normally.