Tools Web

Calculators

LLM Prompt Caching Cost Calculator

Estimate how much prompt caching saves. Enter system prompt tokens, new tokens and output per turn, turns per session, sessions per month, and cache hit rate. No cache = every turn pays the full prompt; with cache, turn 1 writes the prefix and later turns pay hit% × cached rate + miss% × write rate. Presets: OpenAI GPT-6 cached input with 30m/12h write, DeepSeek hit/miss peak/off-peak. Estimates only; official pricing prevails.

Math runs in your browser. Nothing is uploaded.

Custom $/1M rates (optional)

No-cache monthly USD
—

With caching monthly USD
—

Savings (USD)
—

Savings %
—

Cache write / miss spend
—

Cache hit spend
—

Estimates only; official vendor pricing prevails (2026-10-30). No cache = turns × (prefix + new) × input + output. With cache: turn 1 writes the prefix; later turns pay hit% × cached rate + miss% × write rate. OpenAI misses are modeled at the selected 30m/12h write rate; DeepSeek misses at the cache-miss input rate.Official pricing: OpenAI · DeepSeek

OpenAI Token Cost Calculator · DeepSeek Token Cost Calculator · LLM API Cost Calculator · AI Agent Cost Calculator · OpenAI Flex vs Fast vs Standard Cost Calculator

How it works

How is prompt caching cost calculated?
No cache: sessions × turns × ((system + new) × input + output × output rate). With cache: turn 1 writes the system prompt at the write rate; each later turn pays hit% × cached rate + (1 − hit%) × write rate for the prefix. Example: GPT-6.1 Terra, 4,000-token system prompt, 500 new + 300 output tokens, 10 turns, 1,000 sessions, 90% hits, 30m write → $60.00 without cache vs $31.12 with cache (save $28.88, 48%).
What do OpenAI 30m and 12h writes mean?
OpenAI lists a cache-write price for a 30-minute or 12-hour retention window, plus a cached-input (hit) price. For GPT-6.1 Terra: input $1.00, cached $0.05, 30m write $1.25, 12h write $2.50 per 1M. Longer retention costs more to write but keeps hits alive across idle gaps.
How does DeepSeek caching differ?
DeepSeek has no separate write fee: a miss is billed at the cache-miss input rate and a hit at the much lower cache-hit rate (deepseek-flash peak $0.30 vs $0.006 per 1M). Off-peak hours are half price.
What about Anthropic Claude caching?
Claude also bills cache writes above base input and cache reads far below it. Enter Claude’s write and read $/1M in the custom fields to model it; presets cover OpenAI and DeepSeek only.
Are these results exact?
No. Caching depends on exact prefix matches, TTLs, and minimum lengths. Treat results as planning estimates; official OpenAI and DeepSeek pricing pages prevail.