Claude Prompt Caching vs Bedrock and Other Providers

By Shye Uy

Claude prompt caching: request lines whose identical openings fuse into one stored green block, while only the changing ends of each request stay separate.

Claude prompt caching lets the Claude API reuse a previously processed prompt prefix and bill cache reads at 0.1x the standard input rate or less, after a 5-minute cache write that costs 1.25x. Whether that turns into real savings depends less on the headline discount than on how the prompt is built and how often the same prefix comes back before it expires.

Anthropic, Amazon Bedrock, OpenRouter and Groq each implement caching differently, so one prompt design can cut costs on one platform and raise them on another.

Key Takeaways

  • Prompt caching matches on exact prefixes, so stable content (tool definitions, the system prompt, long documents) has to come first and anything that changes per request has to come last.
  • On the Claude API, a 5-minute cache write costs 1.25x the base input price and a cache read costs 0.1x or less, so a cached prefix pays for itself on its first reuse.
  • A prefix that is written to the cache and never read again costs more than sending it uncached on Anthropic, Bedrock and OpenRouter's Claude routes, while Groq charges no cache write fee at all.
  • Bedrock prompt caching for Claude uses different request fields, different minimums for some models, account-and-Region scoped caches, and no caching in batch inference.
  • OpenRouter keeps cache hits alive by routing follow-up requests to the same provider, and passing a session_id makes that stickiness start from the first request.

How Claude Prompt Caching Works

Claude prompt caching stores the processed state of a prompt prefix so that a later request starting with the identical prefix can resume from it instead of recomputing it. Anthropic's prompt caching documentation describes three steps: the system checks whether the prefix up to a cache breakpoint is already cached from a recent query, uses the cached version if it is, and otherwise processes the full prompt and caches the prefix once the response starts.

A prefix, in this context, is everything from the first token of the request up to a chosen point. Anthropic builds that prefix in a fixed order: tools, then system, then messages. The cache key is cumulative, which means changing any block at or before a breakpoint produces a different hash and a miss. Anthropic states that cache hits require "100 percent identical prompt segments, including all text and images up to and including the block marked with cache control."

Why content order decides the hit rate

Because matching runs from the start of the prompt, a single changed token early in the request invalidates everything after it. Anthropic's invalidation table shows the hierarchy in practice: modifying tool definitions invalidates the tools, system and messages caches; toggling web search or citations invalidates the system and messages caches; changing tool_choice or adding an image invalidates only the messages cache.

Anthropic's documentation walks through a common failure mode. A prompt has five blocks of static system context followed by a sixth block that contains a timestamp and the user message. If the cache breakpoint sits on block six, every request writes a new entry (because the timestamp changes the hash) and no request ever reads one. The documentation's verdict is that "You pay for a fresh cache write on every request and never get a read." Moving the breakpoint to block five, the last block that stays the same, fixes it.

Claude prompt caching breakpoint placement: a breakpoint on the changing timestamp block misses every call, while one on the last static block gets cache hits.

Groq's prompt caching documentation makes the same point for an automatic system: "If you put variable information (like timestamps or user IDs) at the beginning, even identical system instructions later in the prompt won't benefit from caching because the prefixes won't match." The mechanism differs by provider, but the ordering rule holds across all four covered here.

Prompt caching vs semantic caching

Prompt caching reduces the cost and latency of a model call that still happens; the model still generates a fresh response, and Anthropic notes the output is identical to what you would get without caching. Semantic caching is a different technique that you build in your own application: it embeds incoming queries, finds a previously answered query that is similar enough, and returns the stored response without calling the model at all. That saves output tokens too, but it can return a wrong answer when two different questions score as similar, which exact-prefix prompt caching cannot do. Serving engines that you host yourself, such as vLLM and SGLang, also reuse key-value state across shared prefixes, a separate topic from the managed API features compared here.

Anthropic Prompt Caching Pricing and Limits

Anthropic prompt caching is opt-in on the Messages API and is priced as multipliers on each model's base input rate: 1.25x for a 5-minute cache write, 2x for a 1-hour cache write, and 0.1x for a cache read, with lower read multipliers on several newer models. All figures in this section come from Anthropic's prompt caching documentation.

Automatic caching vs explicit cache breakpoints

The Anthropic prompt caching API offers two ways to turn caching on.

Automatic caching. You add a single cache_control field ({"type": "ephemeral"}) at the top level of the request, and the system applies the breakpoint to the last cacheable block and moves it forward as a conversation grows.

Explicit cache breakpoints. You place cache_control on individual content blocks to control exactly what is cached.

You can define up to 4 breakpoints per request, and an automatic breakpoint uses one of those 4 slots. Breakpoints themselves cost nothing; you pay only for tokens written, tokens read and uncached input. Anthropic recommends multiple breakpoints when sections change at different frequencies (for example, tools that rarely change and context that updates daily).

Two mechanics matter for placement. First, writes happen only at a breakpoint, so the system never caches stable content that sits behind a breakpoint on changing content. Second, on a miss the system walks backward looking for earlier cache entries, but only across a 20-block lookback window. Anthropic's example: if turn 3 of a conversation places its breakpoint 20 or more blocks past the turn-2 entry, there is no hit unless a second breakpoint was added closer to that earlier position.

Automatic caching suits multi-turn chat, where the growing history is the prefix. It is the wrong choice when the final block changes every request (a timestamp or a fresh user query appended after static context), because automatic caching would place the breakpoint on that changing block. In that case Anthropic advises an explicit breakpoint at the end of the static content.

Cache lifetime: 5 minutes or 1 hour

By default an entry lives for 5 minutes and is refreshed at no additional cost each time it is used. A 1-hour lifetime is available by adding "ttl": "1h" to cache_control, at a higher write price. The lifetime is measured from the start of the request that writes or reads the entry, not the end of its response: Anthropic's example notes that if a response takes 4 minutes to stream, the follow-up request must start within about 1 minute of that response completing to reuse the 5-minute cache.

A cache entry becomes available only after the first response starts. If you fire many parallel requests with the same prefix at once, they will not hit each other's cache; Anthropic's guidance is to wait for the first response before sending the rest.

Minimum cacheable length

Anthropic sets a per-model minimum cacheable prompt length on the Claude API, Claude Platform on AWS, Claude Models on Google Cloud (Google managed) and Microsoft Foundry:

  • 512 tokens for Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1, Claude Mythos 5.1, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Fable 5, Claude Mythos 5 and Claude Haiku 5.5
  • 1,024 tokens for Claude Opus 4.8, Claude Sonnet 5, Claude Sonnet 4.6 and Claude Sonnet 4.5 (deprecated), as well as Claude Opus 4.1, Claude Opus 4 and Claude Sonnet 4, which are retired except on Claude Models on Google Cloud (Google managed) and, for Opus 4.1 and Sonnet 4, Bedrock
  • 2,048 tokens for Claude Mythos Preview and Claude Opus 4.7
  • 4,096 tokens for Claude Opus 4.6, Claude Opus 4.5 and Claude Haiku 4.5

A shorter prompt marked with cache_control is processed without caching and no error is returned. The way to detect this is the usage block: if both cache_creation_input_tokens and cache_read_input_tokens are 0, nothing was cached.

Cache write vs read pricing

Anthropic prompt caching pricing uses three multipliers on base input: 1.25x for 5-minute writes, 2x for 1-hour writes, and 0.1x for reads and refreshes. Anthropic lists per-model exceptions on the read side: cache hits on Claude Opus 5.5 and Claude Sonnet 5.5 cost 0.05x the base input price, and cache hits on Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1 and Claude Mythos 5.1 cost 0.025x.

Model (Claude API)

Base input

5-minute write

1-hour write

Cache hit

Claude Opus 5.5

$4 / MTok

$5 / MTok

$8 / MTok

$0.20 / MTok

Claude Sonnet 5.5

$2 / MTok

$2.50 / MTok

$4 / MTok

$0.10 / MTok

Claude Haiku 5.5 (prompts up to 100,000 tokens)

$0.10 / MTok

$0.125 / MTok

$0.20 / MTok

$0.01 / MTok

Claude Sonnet 4.6

$3 / MTok

$3.75 / MTok

$6 / MTok

$0.30 / MTok

Claude Haiku 4.5

$1 / MTok

$1.25 / MTok

$2 / MTok

$0.10 / MTok

These multipliers stack with other pricing modifiers, including the Batch API discount, long context pricing and data residency, according to the same documentation.

The break-even follows directly from the multipliers. With a 5-minute cache, one write plus one read costs 1.25x + 0.1x = 1.35x the base input for that prefix, against 2x for sending it twice uncached, so the first reuse already wins. With a 1-hour cache, one write plus one read costs 2.1x against 2x uncached (a small loss), and one write plus two reads costs 2.2x against 3x (a win). The 1-hour option therefore needs at least two reads within the hour to pay off. Anthropic's tracking fields make this measurable per request: cache_creation_input_tokens (written), cache_read_input_tokens (read), and input_tokens (tokens after the last breakpoint, not eligible for caching).

Anthropic prompt caching pricing break-even: a 5-minute cache beats uncached input from the first reuse, but a 1-hour cache only pays off after two reads.

Bedrock Prompt Caching: What Changes on AWS

Bedrock prompt caching for Claude is explicit opt-in: according to the Amazon Bedrock User Guide page on prompt caching, "Anthropic models that support prompt caching on Amazon Bedrock support Explicit Prompt Caching. Requests without cache controls aren't cached." The underlying idea matches the direct API, but field names, minimums, routing behavior and batch support differ in ways that change whether a given prompt saves money.

Bedrock field names and usage fields

On the Converse API you mark a cache boundary with a cachePoint block ({"cachePoint": {"type": "default"}}) placed after the content to cache, in the system, messages or tools fields. On the InvokeModel and Messages APIs you use cache_control on content blocks, as on the direct API. Claude models on Bedrock accept up to 4 cache checkpoints. To request the 1-hour lifetime, AWS says to add "ttl": "1h" to the cachePoint object in Converse or to the cache_control object in InvokeModel.

The Converse response reports caching in cacheReadInputTokens, cacheWriteInputTokens and cacheDetails (which breaks writes down by TTL). As on the direct API, inputTokens counts only non-cached tokens, so AWS gives the total as inputTokens + cacheReadInputTokens + cacheWriteInputTokens. Code that parses Anthropic's snake_case usage fields will need a mapping layer when it runs against Converse.

Automatic caching on Bedrock: the documentation disagrees

Sources conflict on whether the top-level automatic caching field works on Bedrock. Anthropic's documentation states that automatic caching "is available on every platform except Amazon Bedrock (bedrock-runtime)," where the API "returns a 400 error for a top-level cache_control field." The AWS User Guide, by contrast, documents automatic caching for Claude on Bedrock (a top-level cache_control in InvokeModel and Messages API bodies, or via additionalModelRequestFields in Converse) and lists it as supported on Claude Haiku 4.5, Claude Sonnet 4.6, Claude Opus 4.7, Claude Opus 4.8, Claude Opus 5, Claude Opus 5.5, Claude Sonnet 5, Claude Sonnet 5.5 and Claude Haiku 5.5, with other models returning a ValidationException. OpenRouter's prompt caching guide takes a third position: it translates the top-level field into a trailing cache breakpoint on Bedrock "since Bedrock's InvokeModel API does not accept the top-level field directly." Until these align, the safe choice on Bedrock is explicit checkpoints, and any use of top-level automatic caching should be verified against the cache usage fields for your specific model and API.

Minimums, TTLs and routing on Bedrock

AWS publishes its own table of minimum tokens per cache checkpoint, and it does not always match Anthropic's. Claude Opus 4.7 has a 2,048-token minimum on the Claude API but a 4,096-token minimum on Bedrock, so a 3,000-token system prompt for that model can be cached through Anthropic and silently skipped through Bedrock. For the newest models the values agree: AWS lists 512 tokens for Claude Fable 5.2, Claude Opus 5.5, Claude Sonnet 5.5 and Claude Haiku 5.5, 1,024 for Claude Opus 4.8, Claude Sonnet 5 and Claude Sonnet 4.6, and 4,096 for Claude Opus 4.6, Claude Opus 4.5 and Claude Haiku 4.5. The minimum is cumulative across tools, system and messages, and AWS notes that a checkpoint placed before the minimum is reached still lets inference succeed, without caching.

Bedrock prompt caching minimums differ: a 3,000-token Claude Opus 4.7 prefix is cached on the Claude API but skipped on Bedrock, with no error.

Every Claude model in AWS's table supports both a 5-minute and a 1-hour TTL, and the TTL resets with each successful cache hit. Bedrock adds an ordering constraint for mixed TTLs: "a 1-hour cache entry must appear before any 5-minute cache entries."

Cache locality is more visible on Bedrock than on the direct API. AWS states that a cache entry "is stored on the server that processed the request," and that requests served by a different server, "such as one in another Region," write a new entry instead of reading one. AWS also warns that cross-Region inference "may lead to increased cache writes" at times of high demand. An AWS Machine Learning Blog post on Bedrock prompt caching for Anthropic models adds that cache entries "are scoped to individual AWS accounts and AWS Regions." Anthropic's documentation notes the isolation difference from its own platform: on the Claude API caches are isolated per workspace, while on Amazon Bedrock they are isolated by organization only.

Bedrock pricing and batch

AWS's User Guide says only that cache writes are billed at a model's cache-write rate, "which, depending on the model, can be higher than the standard input token rate," and points to the Amazon Bedrock pricing page for rates. The multipliers appear in AWS's own blog posts. AWS's Machine Learning Blog post "Four Amazon Bedrock inference choices that affect cost" states that for Claude Sonnet 5 and Claude Opus 5 on Bedrock, "a 5-minute write costs 1.25 times the input rate. A 1-hour write costs 2 times, and a cache read costs 0.1 times." The AWS blog post "Managing Amazon Bedrock costs end to end" adds that a cache read is billed at 0.1x on Claude Sonnet 4.6 and Claude Haiku 4.5 and at 0.05x on Claude Sonnet 5.5 and Claude Opus 5.5. The Bedrock pricing page notes that, starting October 7, 2026, cache read pricing for Claude Sonnet 5.5 was reduced by 50% from the prior rate. AWS's Bedrock User Guide section on global cross-Region inference states that "You save approximately 10% on both input and output token pricing compared to geographic cross-Region inference," so the dollar rate depends on the inference profile you call.

The largest practical difference is batch. AWS states plainly: "Prompt caching is only supported for on-demand inference endpoints. It is not supported with the batch inference API." On Anthropic's own API, caching multipliers stack with the Batch API discount. A document-processing pipeline that relies on both discounts will price very differently depending on which platform runs it.

Bedrock also offers a rate-limit benefit for Claude. AWS's best-practice section lists the 1-hour cache as useful "when you want to improve your rate limit use, since cache hits are not deducted against your rate limit." AWS's guidance on TTL choice mirrors the break-even math: keep the 5-minute cache for prompts used more often than every 5 minutes, since it "will continue to be refreshed at no additional charge," and use the 1-hour cache for prompts reused less often than every 5 minutes but more often than every hour.

Prompt Caching on OpenRouter and Groq

OpenRouter passes each underlying provider's caching model through to you, explicit for Claude and automatic for providers such as OpenAI and Groq, and adds sticky routing to keep requests on a warm cache. Groq caches automatically on a short list of models, charges nothing to write, and discounts cached input by 50%.

OpenRouter prompt caching and sticky routing

For Claude models, OpenRouter supports both Anthropic modes: a top-level cache_control for automatic caching and per-block cache_control for explicit breakpoints, with a limit of four explicit breakpoints. Its prompt caching guide lists Anthropic cache writes at 1.25x the input price for a 5-minute TTL and 2x for a 1-hour TTL, and cache reads at 0.1x. That read figure does not reflect the lower 0.05x and 0.025x read multipliers Anthropic now lists for its newest models, so check the per-model price before relying on it. OpenRouter states the 1-hour TTL for explicit breakpoints is supported across Anthropic, Amazon Bedrock and Google Vertex AI as Claude providers.

The routing layer is what makes OpenRouter prompt caching distinct. A cache lives on the provider endpoint that wrote it, so a request routed to a different provider misses. OpenRouter's answer is provider sticky routing: after a cached request, follow-up requests for the same model go to the same provider. According to the guide, stickiness is tracked per account, per model and per conversation; it activates only when the provider's cache read price is cheaper than its regular prompt price; it is not used when you set a manual provider.order; and sticky sessions expire after 60 minutes of inactivity.

By default OpenRouter identifies a conversation by hashing the first system (or developer) message and the first non-system message. That works for chat but breaks for agents whose opening messages change between turns. Passing a session_id (up to 256 characters, in the body or the x-session-id header) replaces the hash. The difference in timing matters: "When session_id is set, sticky routing activates on any successful request, even before cache usage is observed," while without it, "sticky routing only activates after a cache hit is detected." If neither is set, OpenRouter falls back to the OpenAI-style prompt_cache_key field.

OpenRouter reports cache activity in prompt_tokens_details.cached_tokens and cache_write_tokens, and a cache_discount field shows the net effect. The guide notes that providers like Anthropic show a negative discount on cache writes and a positive one on reads, which is the write premium showing up on the bill.

Groq prompt caching

Groq prompt caching is automatic and cannot be turned off. Groq's documentation states that caching "works automatically on all your API requests to supported models with no code changes required and no additional fees," and that "Prompt caching is automatically enabled and cannot be manually disabled." Cached data lives only in volatile memory and "automatically expires after 2 hours without use." The minimum cacheable prompt length "varies by model, ranging from 128 to 1024 tokens."

Pricing has no write side: "Prompt caching is provided at no additional cost. There is a 50% discount for cached input tokens." Groq's changelog gives a concrete example for GPT-OSS-Safeguard 20B: "50% cost savings on cached input tokens ($0.037/M vs $0.075/M)." Cached tokens do not count toward Groq rate limits, although Groq notes they are subtracted after processing, so large parallel bursts can still hit limits. The discount does not stack with Groq's batch discount: batch requests already receive 50% off all tokens, and no extra discount is applied to cached tokens in batch.

Supported models are a point of disagreement. Groq's own documentation lists only openai/gpt-oss-20b, openai/gpt-oss-120b and openai/gpt-oss-safeguard-20b. OpenRouter's guide says Groq caching on OpenRouter is "Currently available on Kimi K2 models." Groq's changelog shows caching rolling out to Kimi K2 first, on August 20, 2025, then reaching GPT-OSS 20B on September 25, 2025 and GPT-OSS 120B on October 21, 2025, so the OpenRouter note may describe an earlier state. Confirm on your own traffic with the cached_tokens field before planning around either list.

Claude Prompt Caching vs Bedrock, OpenRouter and Groq Side by Side

The four platforms differ on every dimension that decides whether a cached prefix saves money: who turns caching on, how long entries survive, how short a prefix can be cached, and whether writes cost extra. Bedrock multipliers below come from AWS's own Machine Learning Blog posts, because the Bedrock User Guide defers rates to the pricing page.

Provider

Explicit or automatic

Cache lifetime

Minimum cacheable length

Write cost

Read cost

Anthropic API (Claude)

Opt-in: top-level automatic cache_control or up to 4 explicit breakpoints

5 minutes default, 1 hour optional; refreshed free on each hit

512 to 4,096 tokens, by model

1.25x input (5 minutes), 2x input (1 hour)

0.1x input; 0.05x on Opus 5.5 and Sonnet 5.5; 0.025x on Fable 5.2, Mythos 5.2, Fable 5.1 and Mythos 5.1

Amazon Bedrock (Claude)

Explicit opt-in via cachePoint or cache_control, up to 4 checkpoints; top-level automatic on listed models per AWS (disputed by Anthropic)

5 minutes default, 1 hour on listed Claude models; resets on each hit

512 to 4,096 tokens per checkpoint, by model

1.25x input (5 minutes), 2x input (1 hour)

0.1x on Sonnet 4.6, Haiku 4.5, Sonnet 5 and Opus 5; 0.05x on Sonnet 5.5 and Opus 5.5

OpenRouter (Claude routes)

Passes through Anthropic's automatic or explicit cache_control, up to 4 explicit breakpoints

5 minutes default, 1 hour with "ttl": "1h"

512 to 4,096 tokens, by model

1.25x input (5 minutes), 2x input (1 hour)

0.1x input as listed by OpenRouter

Groq

Automatic only; cannot be disabled

Expires after 2 hours without use

128 to 1,024 tokens, by model

No write fee

0.5x input (50% discount)

The table explains why the same prompt can behave differently. A prefix sent once and never again costs 25% more on the cached portion with a 5-minute write on the three Claude routes, and costs nothing extra on Groq. A request that changes its prefix every time gets no benefit anywhere, but only loses money where writes carry a premium. A 3,000-token prefix on Claude Opus 4.7 clears the 2,048-token Anthropic minimum and falls short of the 4,096-token Bedrock minimum. A request pattern with gaps of 30 minutes keeps a Groq cache warm, needs the 1-hour option on Claude, and breaks the 5-minute default.

Structuring Prompts for Cache Hits

The structure that raises hit rates on every provider is the same: put everything that stays constant at the front in a fixed order, put everything that varies at the end, and keep enough traffic flowing on each prefix to read it before it expires. The details below come from the provider documentation linked above.

Prompt-structure rules that raise hit rates

  • Order content from least to most volatile. Tools, then the system prompt, then long reference documents and few-shot examples, then conversation history, then the current user message. This matches Anthropic's and Bedrock's tools, system, messages processing order and Groq's recommended structure.
  • Keep timestamps, user IDs, request IDs and retrieved snippets out of the prefix. Groq lists timestamps, session-specific information and unique identifiers as content to place last; Anthropic's timestamp example shows the cost of getting it wrong.
  • On Claude, put the breakpoint on the last block that is identical across requests, not on the incoming message. For multi-turn chat, a breakpoint on the final block works as long as each turn adds fewer than 20 blocks; otherwise add a second breakpoint closer to the previous write.
  • Use multiple breakpoints for sections that change at different rates. AWS's example places one checkpoint after tool definitions, one after the system prompt and one after a reference document, so that changing only the document leaves the tools and system prompt cached.
  • Freeze tool definitions and request settings within a session. On Anthropic, editing tool definitions invalidates the entire cache, and changes to tool_choice, images, thinking parameters or the speed setting invalidate part of it. Groq's troubleshooting list similarly calls out tool_choice, tool usage and image usage.
  • Meet the minimum for your model and platform. Anthropic notes that if a prompt falls just short of the minimum, expanding the cached content to reach it is often worthwhile for frequently reused prompts.
  • Warm the cache before fanning out. Anthropic and AWS both state that parallel requests sent before the first response starts will write their own entries instead of reading one.
  • Pin routing. On OpenRouter, send a stable session_id for agent sessions and avoid provider.order unless you need it; on Bedrock, expect more cache writes when cross-Region inference spreads traffic.
  • Verify with usage fields, not assumptions. Read cache_read_input_tokens and cache_creation_input_tokens on Anthropic, cacheReadInputTokens and cacheWriteInputTokens on Bedrock Converse, and cached_tokens on OpenRouter and Groq.

When prompt caching costs more than it saves

Caching loses money on providers with a write premium in three recognizable cases, and batch support is a fourth factor to check:

  • Low repeat traffic. If requests for the same prefix arrive more than 5 minutes apart, every request on a 5-minute cache pays a 1.25x write and never reads, and a 1-hour cache that sees only one read in its window costs 2.1x against 2x uncached.
  • A frequently changing prefix. Per-request context placed before the breakpoint means a fresh write on every call.
  • Parallel bursts with no warm-up. Each request writes its own entry instead of reading a shared one.
  • Batch compatibility is a separate consideration. Anthropic allows prompt caching alongside its Batch API discount, although cache hits are best effort. Bedrock does not support prompt caching in batch inference. Groq caching remains active in batch requests, but cached tokens get no extra discount on top of the batch discount and no extra charge.

Groq removes the downside but also the control. With no write fee, an uncacheable prompt costs the same as before, so there is no losing case on price, but there is also no way to mark what should be cached or to extend the 2-hour window. Choosing between providers on caching alone means matching your traffic shape to these rules, not comparing headline read discounts.

LangChain prompt caching

LangChain prompt caching passes the provider's own markers through rather than adding a separate cache. LangChain's ChatAnthropic integration docs show cache_control on content blocks and tool definitions, note that automatic caching requires langchain-anthropic>=1.4.0, and recommend AnthropicPromptCachingMiddleware for agents that should cache stable system prompt and tool content. For Bedrock, LangChain's BedrockPromptCachingMiddleware reference states that ChatBedrock (InvokeModel API) adds cache_control to message content, while ChatBedrockConverse (Converse API) inserts cachePoint blocks. The AWS blog post on Bedrock prompt caching also shows ChatBedrockConverse.create_cache_point() for placing a checkpoint by hand inside message content. The same ordering rules apply: a framework can place markers, but it cannot make a changing prefix cacheable.

Engineers who can trace a cost regression to a moved breakpoint or a drifting prefix are doing the kind of LLM infrastructure work that AI startups hire for, and Fonzi is one place to find those roles.

Is Claude Prompt Caching Worth It?

Claude prompt caching pays off when the prompt is built for it: stable tools, instructions and documents first, volatile content last, and enough repeat traffic to read each prefix before it expires. On the Claude API, a 5-minute cache write plus one read costs 1.35x the base input against 2x uncached, so the first reuse already wins, but the 1-hour cache needs at least two reads within the hour to pay off. Bedrock prompt caching uses the same write multipliers for Claude, yet it does not support caching in batch inference and sets a higher minimum on some models, such as 4,096 tokens for Claude Opus 4.7. OpenRouter needs a stable session_id to keep agent requests on a warm cache, and Groq charges no write fee at all. Because Anthropic, Bedrock, OpenRouter and Groq differ on opt-in, lifetime, minimum length and write pricing, test your actual prompt and traffic pattern on the platform you deploy to and confirm the result in the cache usage fields.

If you want to work on LLM cost and caching problems like these at an AI startup, sign up on Fonzi.

FAQ

Does Claude prompt caching work automatically?

Not by default on the Messages API; you opt in by adding a top-level cache_control field (automatic caching) or by placing cache_control on specific content blocks (explicit breakpoints), according to Anthropic's documentation.

How many cache breakpoints can I use with Anthropic prompt caching?

Up to 4 per request on the Claude API, and an automatic caching breakpoint takes one of those 4 slots; Claude models on Amazon Bedrock also allow up to 4 cache checkpoints.

Is the 1-hour cache worth the higher write price?

Only when the same prefix is read at least twice within the hour and requests arrive more than 5 minutes apart, because a 2x write plus one 0.1x read (2.1x) still costs more than sending the prefix twice uncached (2x).

Why does my Bedrock request show zero cached tokens when the same prompt caches on the Anthropic API?

Check the per-model minimum first, since some differ (Claude Opus 4.7 needs 2,048 tokens on the Claude API but 4,096 on Bedrock), then check whether the request was served by a different server or Region, which AWS says writes a new entry instead of reading one.

Do I need to change my code to use Groq prompt caching?

No; Groq caches automatically on supported models with no code changes, charges no write fee, discounts cached input by 50%, and reports hits in prompt_tokens_details.cached_tokens.

Keep reading