Amazon Bedrock in Practice

Using Anthropic Prompt Caching via the Bedrock API

If your requests share a long prefix — a system prompt, tool definitions, a reference document — prompt caching lets you pay full price for it once and a tenth of the price on every reuse. On Bedrock, you have to place the breakpoints yourself.

Claude 3P 101 · Updated July 2026 · Unofficial guide

Prompt caching stores a processed prefix of your prompt on the serving infrastructure so subsequent requests that start with the same prefix skip reprocessing it. The result is lower latency and much lower cost on the cached portion. Amazon Bedrock supports Anthropic prompt caching with both the 5-minute and 1-hour cache durations. What Bedrock does not support is the automatic caching mode available on the first-party API (a single top-level cache_control field): on Bedrock you must set explicit cache_control breakpoints on individual content blocks. Cache diagnostics are also unavailable on Bedrock, so your usage numbers are the feedback loop.

Setting a breakpoint

A breakpoint marks the end of the region to cache. Everything from the start of the prompt up to and including the marked block becomes the cacheable prefix — so put stable content first (system prompt, tool definitions, reference documents) and variable content after the breakpoint.

from anthropic import AnthropicBedrockMantle

client = AnthropicBedrockMantle(aws_region="us-east-1")

response = client.messages.create(
    model="anthropic.claude-opus-4-8",
    max_tokens=1024,
    system=[{
        "type": "text",
        "text": LONG_POLICY_DOCUMENT,           # stable, reused prefix
        "cache_control": {"type": "ephemeral"},  # breakpoint here
    }],
    messages=[{"role": "user", "content": user_question}],
)
print(response.usage)  # cache_creation_input_tokens / cache_read_input_tokens

The first request writes the cache (you'll see cache_creation_input_tokens in usage); requests within the cache window that share the exact prefix read it (cache_read_input_tokens). Any change inside the cached region — even one character — is a different prefix and forces a fresh write. Changing the model string also invalidates the cache, though the breakpoints themselves keep working after a migration.

The economics

OperationPrice vs. base inputBreaks even after
5-minute cache write1.25xOne cache read
1-hour cache write2xTwo cache reads
Cache read0.1x

Concretely, on Claude Opus 4.8 ($5 per million input tokens), a 5-minute cache write costs $6.25 per million and every read costs $0.50 per million. For a chatbot that re-sends a 50,000-token system context on every turn, the cached turns cost a tenth as much on that prefix. AWS's Bedrock pricing page lists the cache-write and cache-read rates per model. Two placement rules keep you profitable: only cache content that will actually be reused within the window, and remember the minimum cacheable prefix on Bedrock is 1,024 tokens — shorter prefixes simply won't cache (this applies even on Claude Fable 5, which has a lower 512-token minimum on the first-party API).

A quota bonus on the mantle endpoint

On the current "Claude in Amazon Bedrock" surface (the bedrock-mantle endpoint), cached input tokens read from the cache do not count against your input tokens-per-minute quota. For high-throughput applications with long shared prefixes, caching therefore stretches not just your budget but your effective throughput ceiling — the same quota supports far more requests when most of each request is a cache read.

Things that trip teams up

Cached tokens still occupy the context window. Caching changes what you pay, not what fits: input_tokens, cache_read_input_tokens, and cache_creation_input_tokens all count toward the model's context window.

Prefix ordering is everything. If per-user content sits before shared content, the shared content is unreachable by the cache. Restructure prompts as: shared and stable first, breakpoint, then per-request material.

Verify with usage, not vibes. Without cache diagnostics on Bedrock, watch the usage fields per request. If cache_read_input_tokens stays at zero in steady state, your prefix is changing between calls — hunt for timestamps, session IDs, or reordered tool definitions sneaking into the "stable" region.

Rule of thumb: pick the 5-minute duration for bursty interactive traffic and the 1-hour duration only when reuse is guaranteed but spread out — it needs two reads just to break even.

Where to go next

For the cost side in depth, read prompt caching as a cost lever and cache hit-rate strategy. Working with documents? Combine caching with the inline-document patterns.

Sources