Artificial Intelligence

Prompt Caching Costs: Claude, Bedrock, Azure Compared

Engineer comparing cloud AI token caching costs on a monitoring dashboard
Lukas Blazek

Prompt caching costs break in your favour only when the same long prefix is replayed often enough inside the cache window, and the three major APIs price that replay very differently. Anthropic bills cache writes at $5 per million tokens for Claude Opus 5.5 on the 5-minute TTL, against a $4 base input price, while cache hits cost $0.20 per million tokens. Amazon Bedrock charges per-model cache-write and cache-read rates behind explicit checkpoints, and Azure OpenAI applies a discount on cached input tokens that is switched on by default. This guide compares the billing shapes, retention windows and eligibility minimums, then works through the break-even arithmetic with a copy-and-check worksheet.

How Providers Bill Cached Tokens

All three vendors split cached input into the same three billing classes, though they name them differently. Amazon Bedrock’s documentation states the model plainly: tokens written to the cache are billed at the model’s cache-write rate, which depending on the model can be higher than the standard input rate; tokens read from the cache are billed at the cache-read rate; everything else stays at the standard input rate. Anthropic uses the same shape with published dollar figures, and Azure OpenAI folds the discount into cached-token pricing. What changes is who decides what gets cached: Anthropic and Bedrock expose explicit breakpoints, while Azure matches prefixes automatically.

ProviderCache writeCache hitDefault retentionPrefix minimum
Anthropic (Opus 5.5)$5/MTok (5m), $8/MTok (1h)$0.20/MTok5 minutesPer model
Bedrock explicitPer-model ratePer-model rate5 minutes (common)512–4,096 tokens
Azure OpenAINo separate write feeDiscount vs input price5–10 minutes in-memory1,024 tokens

Anthropic: Writes And Hits

The economics hinge on a 25% write surcharge trading against a 95% read discount. On the default plan, the cache lifetime is 5 minutes, refreshed at no additional cost each time the cached prefix is reused; Anthropic also sells a 1-hour duration at extra cost ($8/MTok writes on Opus 5.5). Two operational details matter. The clock starts at the beginning of the request, not the end of the response, so a four-minute streaming answer leaves roughly one minute to replay the prefix. And editing earlier blocks invalidates the prefix, while appending new messages or tool definitions preserves it — structure prompts append-only if you want the cache to survive a multi-turn conversation.

Amazon Bedrock Checkpoint Rules

Bedrock offers implicit caching, which attempts prefix reuse automatically, and explicit caching, where you mark cache checkpoints in the system, messages and tools fields. Explicit cache checkpoints on Bedrock require a cumulative prefix of between 512 and 4,096 tokens per checkpoint, and many models support a 5-minute TTL; supported models allow up to four checkpoints per request. Two traps cost real money. Caching works only on on-demand endpoints, not the batch inference API, and a cache entry lives on the server that wrote it, so a request routed to a different server or region pays for a fresh write. Cross-region inference, which load-balances across an inference profile’s regions, can therefore increase cache writes at peak demand. If you pair caching with queue-driven scaling, as in KEDA queue-depth autoscaling, keep bursts inside one region so entries survive.

Azure OpenAI Eligibility Rules

Azure OpenAI requires at least 1,024 tokens with an identical first 1,024 tokens for a cache hit, and prompt caching is enabled by default with no opt-out. Routing is decided by a hash of the initial prefix — typically the first 256 tokens — and a single character difference in the opening block forces a full miss. After the first 1,024 tokens, hits accrue in 128-token increments of identical content. In-memory caches clear within 5 to 10 minutes of inactivity and are always removed within one hour; newer models default to a 24-hour extended retention policy that spills key/value tensors to GPU-local storage, and provisioned deployments can earn up to a 100% discount on cached input tokens. A prompt_cache_key parameter improves routing, but above roughly 15 requests per minute on the same prefix, requests overflow onto extra machines and hit rates drop. For a deeper cross-cloud comparison of these managed AI platforms, see our AWS vs Azure guardrails breakdown.

Break-Even Math And Checklist

Using the Opus 5.5 list prices above, the write surcharge is $1.00 per million tokens ($5 write minus $4 base) and each hit saves $3.80 ($4 base minus $0.20 hit). One hit repays the surcharge almost four times over — on this pricing, a cached prefix that is read even once inside the TTL comes out ahead. The arithmetic is harsher when hit rates are low: Bedrock models with a 4,096-token minimum burn writes on prompts that never replay, while Azure’s implicit scheme carries no write risk at all. Here is a worked example calculated from published list prices, not a measured benchmark: a 60,000-token prefix replayed nine times in five minutes costs $2.40 uncached (10 × 0.06 MTok × $4), but $0.41 with caching (0.06 × $5 for the write plus 9 × 0.06 × $0.20 in hits) — about 83% cheaper on that prefix.

  1. Measure your hit rate before optimising: read cache_read_input_tokens on Anthropic, the cache usage metrics in Bedrock responses, or cached_tokens under prompt_tokens_details on Azure.
  2. Put static content — system prompts, tool definitions, retrieved documents — at the top of the request and dynamic content at the bottom.
  3. Check the prefix minimum for your model before adding checkpoints; under-minimum prefixes still succeed but never cache.
  4. Keep replay traffic inside one region and under the per-prefix rate ceiling.
  5. Recheck TTL behaviour during long streaming responses, and move to the 1-hour tier only if measured read volume justifies the higher write fee.

Sources

Keep exploring