Per MillionLLM API prices, tracked daily

Prompt Caching Cost 2026: Discount Table + Savings Formula

By Per Million · Published · 19 min read

Prompt caching cost is what you pay to reuse input tokens a provider has already processed. A cache read on current flagship models costs 5–10% of the normal input price, and some providers also charge a one-time cache write premium of 1.25x–2.5x. The discount alone won't tell you what you'll save. Your savings come from three numbers: how many tokens in each request are a repeated prefix, how often that prefix is still in cache (your hit rate), and how many requests you send. The formula and tables below turn those into dollars for OpenAI, Claude, Gemini and Amazon Bedrock (all prices as of October 2026; check the official pages).

Which option is right for you?

Start with the provider and caching mode that matches how you already work. You can switch later once you have real hit-rate numbers.

Which option is right for you?. Source: the LiteLLM price list (MIT License)
Your situationWhat to pick firstFirst page to open
Beginner, want savings with zero code changesOpenAI implicit caching (GPT-5.5 and earlier have no write fee, so a miss costs nothing extra) or Gemini implicit cachingOpenAI prompt caching guide
Daily work: chatbot or agent with a long, stable system promptClaude Sonnet 5.5 with one cache_control breakpoint, 5-minute TTLAnthropic prompt caching docs
Daily coding in Claude CodeLeave caching on and check the Prompt cache (main) line in /usageClaude Code prompt caching
Tight budget, high volume, same big document every callGemini 3.8 Flash explicit cache (cached input $0.075/1M plus storage)Gemini API pricing
Already on AWS, need billing in your AWS accountBedrock Converse API with a cachePoint after static contentBedrock prompt caching

Here's the reasoning in one line each. OpenAI's older models are the safest place to start because a cache miss never costs extra. Claude's 0.05x read rate on the 5.5 models is one of the deepest discounts, but you pay 1.25x on every write. Gemini explicit caching locks in near-100% hit rates for one fixed document, and you pay for that by the hour.

What Is Prompt Caching Cost?

Prompt caching cost is the discounted rate for reused input tokens (a cache hit), plus any fee to store them (a cache write or hourly storage). Every provider caches by exact prefix match, so only the unchanged start of your prompt qualifies.

When you send a request, the model has to process every input token. With caching, the provider keeps the processed state of your prompt's prefix for a while. That prefix is usually tools, then the system prompt, then earlier messages. The next request that starts with the same tokens reads that state at a lower rate. Anthropic's docs list the hierarchy as tools → system → messages, and a change to tool definitions invalidates everything after it (Anthropic).

There are three line items you can be billed for:

  1. Cache read (hit). These tokens are billed at a fraction of base input. Claude Sonnet 5.5 is $0.10 per million tokens against a $2 base (Anthropic pricing). GPT-5.6 Terra is $0.20 against $2 (OpenAI pricing). Gemini 3.8 Flash is $0.075 against $0.75 (Google).
  2. Cache write. Anthropic charges 1.25x base for a 5-minute write and 2x for a 1-hour write. OpenAI's GPT-5.6-and-later models charge 1.25x for the 30-minute TTL and 2.5x for 12 hours. Older OpenAI models charge no write fee (OpenAI guide).
  3. Storage. Only Gemini explicit caching bills by the hour: $0.50 per million tokens per hour on Gemini 3.8 Flash and $1.00 on Gemini 2.5 Flash (Google).

Output tokens are never cached, so caching does nothing for long answers. If output dominates your bill, see the per-model output prices in our LLM API pricing comparison.

Does Prompt Caching Reduce Cost? (With a Worked Formula)

Yes, prompt caching reduces cost once your hit rate clears a break-even point. That point is about 21% for 5-minute Claude writes and 0% for OpenAI models with no write fee. A low hit rate with write fees can cost more than not caching.

The formula

Use these variables (all prices per million tokens):

Prefix cost without caching = N × P × B
Prefix cost with caching    = N × P × [h × R + (1 − h) × W] + P × S × T
Monthly savings             = (cost without) − (cost with)
Break-even hit rate         = (W − B) / (W − R)

The (1 − h) × W term assumes every miss rewrites the prefix. That's how Anthropic and OpenAI's explicit-breakpoint models behave when a cache entry has expired.

Break-even hit rates by provider

Break-even hit rates by provider. Source: the LiteLLM price list (MIT License)
Write/read pairWRBreak-even hit rate
Claude Sonnet/Opus 5.5, 5-min TTL1.25x0.05x0.25 / 1.20 ≈ 21%
Claude Sonnet/Opus 5.5, 1-hour TTL2x0.05x1 / 1.95 ≈ 51%
Claude models at 0.1x read, 5-min TTL1.25x0.1x0.25 / 1.15 ≈ 22%
OpenAI GPT-5.6+, 30-min TTL1.25x0.1x≈ 22%
OpenAI GPT-5.6+, 12-hour TTL2.5x0.1x1.5 / 2.4 ≈ 63%
OpenAI GPT-5.5 and earlier1x (no fee)0.1x0%
Gemini implicit1x (no fee)0.05–0.1x0%

The multipliers come from Anthropic and OpenAI. The Gemini ratios are worked out from list prices on Google's pricing page.

Worked example (illustrative numbers)

Say you run a support bot with a 10,000-token system prompt and help-center excerpt. Each call adds 300 user tokens and returns 400 output tokens, and you send 100,000 requests a month. The prefix is 1,000 million tokens a month. Assume a 90% hit rate on the prefix.

On Claude Sonnet 5.5 with 5-minute caching:

  1. Without caching: 1,000 × $2 = $2,000 for the prefix.
  2. With caching: 900 × $0.10 + 100 × $2.50 = $90 + $250 = $340.
  3. User input (30M × $2 = $60) and output (40M × $10 = $400) stay the same.
  4. The monthly total drops from $2,460 to $800, a 67% saving on the whole bill, even though the prefix alone fell 83%.

The gap between 83% and 67% is why the "up to 90%" headline doesn't match your invoice. Output isn't discounted, and misses still pay the write rate.

Now run the same workload at a 15% hit rate, which you might see with bursty traffic. The cost becomes 150 × $0.10 + 850 × $2.50 = $2,140, which is more than the $2,000 you'd pay without caching. That's the break-even table at work.

Steps to calculate your own savings

  1. Log one day of real responses and add up the cache fields: cache_read_input_tokens and cache_creation_input_tokens (Anthropic), cached_tokens and cache_write_tokens (OpenAI), cached_content_token_count (Gemini), or cacheReadInputTokens and cacheWriteInputTokens (Bedrock).
  2. Hit rate = read tokens ÷ (read + write tokens) for the cacheable part.
  3. Plug in N, P, h and that model's prices from the comparison table below.
  4. Compare your h with the break-even rate. If you're close to it, use the shorter TTL or a provider with no write fee.

If you'd rather script this, our LLM cost calculator in Python walks through building one, and you can add the formula above as an extra function.

Prompt Caching Cost in Claude (API) vs Claude Code

On the Claude API you choose what to cache and pay explicit write and read rates. Claude Code caches automatically. You see the effect through /usage, not on a per-request invoice, and subscribers don't pay per token at all.

Prompt Caching Cost in Claude (API) vs Claude Code. Source: the LiteLLM price list (MIT License)
Claude APIClaude Code
Who sets cachingYou (cache_control, automatic or explicit breakpoints)Claude Code, automatically
Default TTL5 minutes1 hour for the main conversation on a subscription within plan usage; 5 minutes on API key, usage credits or cloud provider
How you're billedPer token: write 1.25x/2x, read 0.05x–0.1xSubscription: counts against plan limits. API key or cloud: same per-token rates
Where you see cache datausage object in each response/usage → Prompt cache (main) line (v2.1.251+)
Change TTL"ttl": "1h" in cache_controlpromptCacheTtl setting or CLAUDE_CODE_PROMPT_CACHE_TTL (v2.1.242+)

Sources: Claude Code prompt caching, Claude Code costs.

According to Anthropic, enterprise Claude Code deployments average about $13 per developer per active day and $150–250 per developer per month, and 90% of users stay under $30 per active day (Claude Code costs). Most of that input is cache reads. The sample /usage output in the docs shows 940.0k cache-read tokens next to 50.0k cache-write tokens and only 1.2k uncached input.

How to check your cache hit rate in Claude Code

  1. Run /usage in the session.
  2. Find the Prompt cache (main) line, for example 14 requests · 91% of input tokens from cache · 2 misses.
  3. If misses are high, look for the likely cause: text (v2.1.260+), such as tool definitions changed.
  4. To confirm which TTL your writes used, run claude -p "hello" --output-format json and check ephemeral_1h_input_tokens and ephemeral_5m_input_tokens under usage.cache_creation.

Pitfalls and fixes

If you're deciding between paying per token and a flat subscription for Claude Code, our Claude API vs Max plan break-even table works through that choice.

Anthropic Prompt Caching Pricing: Cache Write vs Cache Read Rates

Anthropic charges 1.25x base input for a 5-minute cache write and 2x for a 1-hour write. Cache reads cost 0.1x base on most models, 0.05x on Opus 5.5 and Sonnet 5.5, and 0.025x on Fable 5.1 and Mythos 5.1.

Anthropic Prompt Caching Pricing: Cache Write vs Cache Read Rates. Source: the LiteLLM price list (MIT License)
ModelBase input5m write1h writeCache hitOutput
Claude Fable 5.1$10$12.50$20$0.25$50
Claude Opus 5.5$4$5$8$0.20$20
Claude Sonnet 5.5$2$2.50$4$0.10$10
Claude Haiku 5.5 (≤100k tokens)$0.10$0.125$0.20$0.01$0.50
Claude Haiku 5.5 (>100k tokens)$0.50$0.625$1$0.05$2.50

Prices are per million tokens, as of October 2026 (Anthropic prompt caching, Anthropic pricing; check the official page).

Rules that affect your bill:

Steps: add caching to a Claude API call

  1. For the simplest setup, pass cache_control={"type": "ephemeral"} at the top level of client.messages.create. Anthropic calls this automatic caching. It uses one of your four breakpoint slots.
  2. For more control, put "cache_control": {"type": "ephemeral"} on the last system or tool block that stays identical across requests.
  3. Add "ttl": "1h" only if requests are more than 5 minutes but less than an hour apart.
  4. Check usage in the response. On the second identical call, cache_read_input_tokens should be above zero.

A common mistake is putting a timestamp or user ID in the system prompt. That changes the prefix on every call, so you pay 1.25x on every write and get no reads. Move anything that changes to the end of messages.

OpenAI Prompt Caching Cost: Rates and Eligibility Rules

OpenAI caches prompts of 1,024 tokens or more automatically. Cached reads cost 0.1x input on most models and 0.05x on GPT-6.1 Sol. GPT-5.6 and later charge a 1.25x write fee, while GPT-5.5 and earlier charge none.

OpenAI Prompt Caching Cost: Rates and Eligibility Rules. Source: the LiteLLM price list (MIT License)
ModelInputCached inputCache write (30m / 12h)Output
GPT-6 Astra$10.00$1.00$12.50 / $25.00$50.00
GPT-6.1 Sol$2.00$0.10$2.50 / $5.00$10.00
GPT-5.6 Sol$4.00$0.40$5.00 / $10.00$20.00
GPT-5.6 Terra$2.00$0.20$2.50 / $5.00$12.00
GPT-5.6 Luna$0.20$0.02$0.25 / $0.50$1.20
GPT-5.5$5.00$0.50none$30.00
GPT-5.4$2.50$0.25none$15.00
GPT-5 Mini$0.25$0.025none$2.00

Standard tier, per million tokens, as of October 2026 (OpenAI pricing; check the official page).

How retention works (OpenAI guide):

Pitfalls

To see your hit rate, open the Prompt Caching Dashboard that OpenAI's guide mentions. For full cost math on OpenAI models, see our OpenAI API pricing calculator.

Gemini Prompt Caching Cost: Explicit vs Implicit Caching

Gemini implicit caching is on by default and passes on the discount automatically with no storage fee. Explicit caching is a cache object you create, billed at the cached-token rate plus an hourly storage fee.

Gemini Prompt Caching Cost: Explicit vs Implicit Caching. Source: the LiteLLM price list (MIT License)
ModelInputCached inputDiscountStorage (explicit)Explicit caching?
Gemini 4 Argon$2.00*$0.10*95%none listedNo (implicit only)
Gemini 3.8 Flash$0.75*$0.07590%$0.50 / 1M tokens / hourYes
Gemini 3.5 Flash-Lite$0.30$0.0390%$1.00 / 1M tokens / hourYes
Gemini 2.5 Flash$0.30$0.0390%$1.00 / 1M tokens / hourYes

*Google labels Argon pricing as valid through and 3.8 Flash input pricing through . The discount column is worked out from list prices. Paid tier, as of October 2026 (Gemini pricing; check the official page).

Key rules from Google's caching docs and the explicit caching page:

Example: when explicit storage is worth it

Using the support-bot numbers from earlier (illustrative), a 10,000-token prefix is 0.01 million tokens. Keeping it as an explicit cache on Gemini 3.8 Flash around the clock costs 0.01 × $0.50 × 720 hours = $3.60 a month. Every request then reads it at $0.075 per million, so 100,000 requests cost $75 plus $3.60. Implicit caching at 90% hits would cost 900 × $0.075 + 100 × $0.75 = $142.50.

Explicit caching wins here because traffic is steady. Storage is charged per hour whether or not anyone sends a request, though. If you cache a 1-million-token document for 24 hours and query it twice, you pay $12 in storage on 3.8 Flash for two requests. For free-tier limits and more Gemini cost examples, see our Gemini API pricing and free tier guide.

Prompt Caching Pricing on AWS Bedrock

Bedrock bills cached tokens at each model's cache-read rate and writes at a rate that may be higher, with no separate storage line. Prices follow Anthropic's direct prices for Claude, but regional endpoints add a premium.

What the Bedrock prompt caching docs say:

Prompt Caching Pricing on AWS Bedrock. Source: the LiteLLM price list (MIT License)
Model family on BedrockMin tokens per checkpointMax checkpointsTTL
Claude Opus/Sonnet/Haiku 5.5, Opus 5, Fable 5.x51245 min, 1 hour
Claude Sonnet 5, Sonnet 4.6, Sonnet 4.5, Opus 4.81,02445 min, 1 hour
Claude Opus 4.5–4.7, Haiku 4.54,09645 min, 1 hour
OpenAI GPT-5.6 Sol/Terra/Luna, GPT-6 Astra, GPT-6.1 Sol1,0244 cache writes30 minutes
Amazon Nova Pro/Lite/Micro, Nova 2 Lite1K (max 20K cached)45 min

AWS also documents that GPT-5.6+ writes on Bedrock bill at 1.25x uncached input, while GPT-5.5 and earlier have no write fee. For OpenAI models on Bedrock, cached tokens don't count against the input-tokens-per-minute quota, which is the opposite of OpenAI's direct API.

On price: AWS's pricing page notes that from , cache read pricing for Claude Sonnet 5.5 dropped 50%. A public pricing-data update (models.dev PR #9053, a secondary source) lists Bedrock Sonnet 5.5 at $2 input, $2.50 cache write and $0.10 cache read on global endpoints. US/EU regional endpoints are $2.20, $2.75 and $0.11, a 10% premium. Check the AWS page for your region before you budget.

Steps: turn on caching in the Bedrock console

  1. Open a chat playground in the Amazon Bedrock console.
  2. Open the Configurations menu.
  3. Turn on the Prompt caching toggle.
  4. Run your prompts. Once the minimum is reached, Bedrock creates checkpoints for you. Choose View cache checkpoints to see them, and open the Caching metrics pop-up on a response to see read and write tokens.

In code, add {"cachePoint": {"type": "default"}} after static content in the Converse API. Add "ttl": "1h" only on models that support it.

Pitfalls

Side-by-Side Comparison: Prompt Caching Cost Across OpenAI, Claude, Gemini, Bedrock

This table lists the numbers that decide real savings for each provider: write premium, read discount, minimum tokens and TTL, all as of October 2026.

Side-by-Side Comparison: Prompt Caching Cost Across OpenAI, Claude, Gemini, Bedrock. Source: the LiteLLM price list (MIT License)
Claude APIOpenAI APIGemini APIAWS Bedrock
Cache read0.05x (Opus/Sonnet 5.5), 0.1x most, 0.025x Fable 5.10.1x most, 0.05x GPT-6.1 Sol0.1x (Flash), 0.05x (Argon)Model's cache-read rate (Sonnet 5.5: $0.10 global)
Cache write1.25x (5m), 2x (1h)1.25x (30m), 2.5x (12h) on GPT-5.6+; none on olderNone (implicit); storage fee (explicit)Same as model (Claude 1.25x/2x; GPT-5.6+ 1.25x)
Storage feeNoneNone$0.50–$1.00 / 1M tokens / hour (explicit)None documented
Min tokens512–4,096 by model1,0242,048–4,096512–4,096 by model
TTL5 min / 1 hour30m / 12h (GPT-5.6+); in-memory or 24h (older)Implicit: automatic; explicit: default 1h, configurable5 min / 1 hour (Claude); 30 min (GPT-5.6+)
Setupcache_controlAutomatic; optional breakpointsAutomatic, or caches.create()cachePoint / cache_control
Rate-limit effectHits not countedCached tokens still countn/aNot counted for OpenAI models
Break-even hit rate (short TTL)~21%~22% (GPT-5.6+); 0% older0% implicit~21% Claude

Sources: Anthropic, OpenAI guide, OpenAI pricing, Gemini pricing, Bedrock docs.

To put the table in dollars, here's the earlier example (1,000 million prefix tokens a month, 90% hits, illustrative) on each model:

Side-by-Side Comparison: Prompt Caching Cost Across OpenAI, Claude, Gemini, Bedrock. Source: the LiteLLM price list (MIT License)
ModelPrefix cost without cachingPrefix cost with caching
Gemini 3.8 Flash (explicit, 24/7)$750$78.60
Gemini 3.8 Flash (implicit)$750$142.50
Gemini 4 Argon (implicit, intro price)$2,000$290
Claude Sonnet 5.5 (5m)$2,000$340
GPT-6.1 Sol (30m)$2,000$340
Claude Opus 5.5 (5m)$4,000$680
GPT-5.5 (no write fee)$5,000$950

Sonnet 5.5 and GPT-6.1 Sol come out the same on prefix cost because their base, write and read prices match. If they're both on your shortlist, compare them on output quality and rate-limit behavior. Caching won't separate them.

Next steps

Start with today's logs. You don't need a new vendor to find out what caching saves you.

Do it yourself today:

  1. Pull 24 hours of responses and work out your hit rate from the cache usage fields in the formula section.
  2. Move anything that changes per request (timestamps, user names, retrieved snippets) after your last cache breakpoint, then measure again.
  3. Compare your hit rate with the break-even table. If you're below about 25% on Claude or GPT-5.6+, use the shorter TTL or put that workload on a model with no write fee.

If you'd rather not manage it yourself:

Related guides on Per Million:

FAQ

What is prompt caching cost in Claude Code specifically?

Claude Code bills cache reads and writes at the same Claude API rates when you use an API key or a cloud provider, with a 5-minute TTL by default. On a Pro or Max subscription within plan usage, the main conversation gets a 1-hour TTL and usage counts against plan limits, not dollars. Run /usage to see the session's share of input served from cache.

What is prompt caching cost reduction in practice (realistic %, not marketing claims)?

It depends on your prefix size and hit rate. In this guide's illustrative support-bot example, a 90% hit rate cut the cached prefix by 83% but the whole Sonnet 5.5 bill by 67%, because output isn't discounted. At a 15% hit rate with 5-minute Claude writes, caching cost more than not caching.

Is prompt caching pricing on Bedrock the same as Anthropic's direct API?

On global endpoints the Sonnet 5.5 rates line up ($2 input, $2.50 write, $0.10 read), according to the pricing data cited above. US/EU regional endpoints carry a 10% premium. Bedrock also doesn't support caching in batch inference, so check the AWS page for your model and region.

How is Gemini prompt caching cost different from implicit caching?

Implicit caching is automatic, has no storage fee, and only discounts tokens when a hit happens to occur. Explicit caching guarantees the cached content is available for its TTL (1 hour by default), and you pay storage for every hour it exists, for example $0.50 per million tokens per hour on Gemini 3.8 Flash. Gemini 4 Argon supports implicit caching only.

Does AWS charge extra for prompt caching setup or storage?

AWS's documentation describes no setup or storage charge. You pay the cache-read rate for tokens read, the standard input rate for uncached tokens, and, depending on the model, a higher rate for tokens written. The Bedrock pricing page has the model-specific numbers.

Sources

Spotted something out of date or wrong? Tell us at shigoto.ai.note@gmail.com. We check every guide against its official sources.