Home / Tools / Prompt caching cost calculator

Prompt caching cost calculator

If every request to an AI API starts with the same long system prompt or documents, prompt caching lets you pay for that part in full once and then at a fraction of the price. Work out what it saves for your traffic.

  • AI tool
  • Runs in your browser
  • Tested 19 November 2026
  • Sources
Standard API prices, checked 19 November 2026.
The part that's identical every time: system prompt, tools, documents.
The question or message that changes.
Requests that reuse the prefix, each before the cache expires.

How prompt caching is charged

With caching, the start of your prompt (everything up to a cache breakpoint) is stored after the first request. Each later request that begins with exactly the same tokens reads it back instead of processing it again. Three prices apply to input tokens:

  • Cache write. The first request pays a little more than normal for the cached part: 1.25 × the input price for the shorter lifetime on both Claude and the latest GPT models, and 2 × (Claude, 1 hour) or 2.5 × (GPT, 12 hours) for the longer one.
  • Cache read. Later requests pay a small fraction for the same tokens. On Claude it's 0.1 × the input price on most models, 0.05 × on Opus 5.5 and Sonnet 5.5, and 0.025 × on Fable 5.2. On GPT-6.2 Astra and Sol it's 0.05 ×.
  • Normal input for everything after the cached part, and the normal output price for what the model writes.

The calculator assumes each request in a session arrives before the cache expires. Reading the cache restarts its timer on both providers, so steady traffic keeps it warm.

Worked example. Claude Sonnet 5.5 with a 50,000-token prefix, 500 new tokens and 400 output tokens, 20 requests in a session. Without caching: 20 × (50,500 × $2 + 400 × $10) ÷ 1,000,000 = $2.10. With caching: one write (50,000 × $2.50), 19 reads (50,000 × $0.10 each), plus the new input and the output, comes to $0.32. That's 85 % less.

When it pays off

A short-lifetime cache pays for itself as soon as it's read once, because the extra 0.25 × on the write is less than what one read saves. A long-lifetime cache needs two reads on Claude's pricing. If requests are more than the lifetime apart, every request pays the write price and caching costs more, so check how your traffic is spread out.

Things to know

  • The prefix must match exactly. Put fixed content first (tools, system prompt, documents) and anything that changes, such as a timestamp or the user's question, after it.
  • There's a minimum length. Shorter prompts aren't cached and are charged normally. It's 512 tokens on current Claude models and 1,024 tokens on GPT-5.6 and later. The tool warns you if your prefix is too short.
  • It stacks with batch processing on Claude, which halves input and output prices for work that can wait.
  • Claude Haiku 5.5 has higher prices for prompts over 100,000 tokens. The calculator switches to them automatically.
  • Gemini bills its context caching differently, with an hourly storage charge, so it isn't included here. Use the custom option with your own prices if you want a rough comparison.

Sources

Where the formulas and figures on this page come from. We test every tool against worked examples from these before publishing.