Free developer tool

Free Prompt Caching Calculator

Prompt caching is an LLM API feature that bills a repeated prompt prefix (system prompt, tools, documents) at a fraction of the input price when it is reused within the cache lifetime. Enter your prompt sizes and traffic to see monthly cost with and without caching on Claude, OpenAI GPT, Gemini and DeepSeek, the break-even hit rate, and whether gaps in your traffic turn cheap cache reads back into paid writes. It runs in your browser; nothing is sent anywhere.

Cache lifetime (TTL)

The cached prefix is the part that repeats on every request: system prompt, tool definitions, documents or earlier conversation turns. Uncached input is the new part.

Cache hit rate

Monthly cost, 5,280 requests

Without caching

$259

With caching

$79.94

You save

69%

  • Hit rate: 91% (estimated: 8.6% of requests arrive after the 5-minute cache has expired, or start a new day cold, and pay the write price again)
  • Break-even hit rate: 21% (write $2.50/M vs read $0.10/M vs input $2.00/M).
  • Traffic needed: about 3 requests per hour on the same prefix to stay above break-even with a 5-minute TTL.
  • Prices: input $2.00, cache read $0.10, output $10.00 per 1M tokens. Cache reads cost 0.05x input. Opt-in with cache_control; writes cost 1.25x input (5-minute TTL) or 2x (1 hour); minimum 512 tokens; up to 4 breakpoints.

Where to put the cache breakpoint

// Anthropic Messages API, one turn of an agent loop
await client.messages.create({
  model: "claude-sonnet-5-5",
  max_tokens: 1024,
  tools, // rendered first, so cached by the breakpoint below
  system: [{
    type: "text",
    text: SYSTEM_PROMPT_AND_DOCS, // byte-identical every call
    cache_control: { type: "ephemeral" },
  }],
  messages: [
    ...history,
    // 2nd breakpoint: caches the growing conversation (max 4)
    { role: "user", content: [{ type: "text", text: userTurn, cache_control: { type: "ephemeral" } }] },
  ],
});
// Or set one top-level cache_control: { type: "ephemeral" }
// and the API caches up to the last block.
// Check usage.cache_read_input_tokens and
// usage.cache_creation_input_tokens.

Same workload on every model

ModelHit rateWithout cacheWith cacheSaved
100%$12.94$3.4873%
91%$12.94$4.4865%
100%$37.86$6.9482%
100%$162$28.2183%
100%$129$29.5777%
91%$97.02$31.8967%
91%$194$56.5471%
100%$259$59.1477%
91%$259$75.3971%
91%$259$75.3971%
91%$259$79.9469%
91%$517$16069%
91%$1,035$30071%
100%$1,294$34873%

Prompt caching prices by model

USD per 1M tokens, standard tier, checked November 14, 2026.

ModelInputCache writeCache readOutputDefault TTLMin tokens
Claude Fable 5.2$8.00$10.00 (1 hour: $16.00)$0.20$40.005 min512
Claude Opus 5.5$4.00$5.00 (1 hour: $8.00)$0.20$20.005 min512
Claude Sonnet 5.5$2.00$2.50 (1 hour: $4.00)$0.10$10.005 min512
Claude Haiku 5.5$0.10$0.125 (1 hour: $0.20)$0.01$0.505 min512
GPT-6 Astra$10.00$12.50 (12 hours: $25.00)$1.00$50.0030 min1,024
GPT-6.1 Sol$2.00$2.50 (12 hours: $5.00)$0.10$10.0030 min1,024
GPT-6.1 Terra$1.00$1.25 (12 hours: $2.50)$0.05$5.0030 min1,024
GPT-6 Luna$0.10$0.125 (12 hours: $0.25)$0.01$0.5030 min1,024
Gemini 4 Carbon$2.00free$0.10$10.00automatic4,096
Gemini 4 Argon$2.00free$0.10$10.00automatic4,096
Gemini 4 Hydrogen$1.50free$0.075$7.50automatic4,096
Gemini 3.8 Flash$0.75free$0.075$3.75automatic4,096
DeepSeek V4 Pro$1.32free$0.044$3.96automaticnone published
DeepSeek Flash$0.30free$0.006$1.20automaticnone published

Sources: Anthropic pricing, Anthropic prompt caching, OpenAI pricing, OpenAI prompt caching, Gemini API pricing, Gemini context caching, DeepSeek pricing, DeepSeek context caching. Gemini 4 Carbon and Argon prices rise on December 1, 2026. DeepSeek prices are peak rates; off-peak is half.

How to calculate prompt caching savings

  1. 1. Pick a model and TTL

    Choose the model you call. For Claude and OpenAI, choose the default cache lifetime or the longer, pricier one.

  2. 2. Enter your prompt shape

    Enter the tokens that repeat on every request (cached prefix), the new input tokens and the output tokens per request.

  3. 3. Enter your traffic

    Enter requests per active hour, active hours per day and days per month. The calculator estimates the hit rate from how often requests arrive within the cache lifetime, or you can set a measured hit rate.

  4. 4. Read the verdict

    Compare monthly cost with and without caching, check the break-even hit rate and the traffic it needs, then copy the code sample that places the cache breakpoint.

The hit-rate estimate assumes requests arrive at random: a request misses when the previous one came more than one cache lifetime earlier, plus one cold start per active day. Bursty traffic hits more often, evenly spaced sparse traffic less.

Prompt caching FAQ

What is prompt caching?

Prompt caching lets an LLM API reuse the processed form of a prompt prefix it has seen recently, such as a long system prompt, tool definitions or documents. Cached tokens are billed at a fraction of the normal input price and are processed faster.

Is prompt caching worth it?

Yes when the same prefix of at least the provider minimum (512 tokens on Claude 5.x, 1,024 on OpenAI, 4,096 on Gemini 4) is reused often enough to beat the break-even hit rate. On providers that charge extra to write the cache, sparse traffic can make caching cost more than it saves.

How much does Claude prompt caching cost?

On Claude 5.x models a cache write costs 1.25x the input price with the default 5-minute lifetime, or 2x with the 1-hour lifetime. Cache reads cost 0.1x input on Haiku 5.5, 0.05x on Opus 5.5 and Sonnet 5.5, and 0.025x on Fable 5.2. Each hit refreshes the 5-minute timer for free.

What is the break-even cache hit rate?

It is the share of requests that must hit the cache for caching to cost the same as not caching: (write price - input price) / (write price - read price). With a 1.25x write and a 0.1x read it is about 22%; with a 2x write it is about 53%. Providers with free cache writes break even at any hit rate above zero.

Does OpenAI charge for prompt caching?

On GPT-5.6 and later, caching is automatic and a cache write costs 1.25x the input price for the default 30-minute lifetime or 2.5x for 12 hours. Cache reads cost 0.1x input, or 0.05x on GPT-6.1 Sol and Terra. Older OpenAI models cache automatically with no write charge.

Why is my cache hit rate low?

The prefix changed (a timestamp, user name or reordered tools near the top), requests arrived more than one TTL apart so the cache expired, or the prefix is under the minimum cacheable size. Put static content first, keep it byte-identical, and send related requests close together.

Keep your agent prompts cache-friendly

Tornic runs AI coding workflows as deterministic steps with the same instructions every time, on the Claude Code, Codex or Cursor CLI you already pay for, so repeated prefixes stay identical and cacheable.

Explore Tornic

Related free tools