To configure explicit Bedrock prompt caching in AWS’s Chat Completions example, set prompt_cache_options to explicit and mark the reusable text with prompt_cache_breakpoint. Then check the response usage data to see whether the request wrote to or read from the cache. The required checkpoint size and supported APIs depend on the model. AWS’s guide and Bedrock’s caching documentation describe the request settings and cache behavior.

Explicit caching lets a request mark a prompt prefix for reuse. Put stable instructions and reference material before the changing question; content after the last breakpoint is processed on each request.

Keep the reusable prefix identical across requests, and use cache usage fields—not configuration alone—to confirm that reuse happened.

Check the model and API first

Kimi K3 and GLM 5.3 have different minimum checkpoint sizes and API support. AWS lists the following requirements in their Kimi K3 and GLM 5.3 model cards:

ModelMinimum checkpointMinimum retentionAPIs with explicit cachingInference profile or limit
Kimi K3256 tokensAt least 30 minutesResponses, Chat Completions, InvokeModelExplicit caching is not supported on Converse.
GLM 5.31,024 tokensAt least 30 minutesResponses, Chat CompletionsEligible customers; US-geographic or global cross-Region profiles. In-Region on-demand inference is unavailable.

The Chat Completions fields below apply to AWS’s documented example. Check the model card for the API and inference profile you plan to use before building around that request format.

Configure and test the reusable prefix

AWS’s Chat Completions sample uses Python 3.12, OpenAI Python SDK 3.26.0 or later, and aws-bedrock-token-generator 1.1.0 or later. It also requires an AWS account with access to the selected model and permission to invoke it. The sample’s generated Bedrock API key is short-term and valid for up to 12 hours. These are requirements for that sample, not a general setup checklist for every Bedrock API.

  1. Choose a model and supported API. Check its minimum checkpoint and any inference-profile restrictions in the model card. This avoids setting a prefix too short for the model or choosing an unsupported API.
  2. Put stable content first. Place reusable instructions, tool definitions, and reference material before the changing question. Mark the end of the reusable text with the breakpoint; content after the last breakpoint is processed each time.
  3. Set both Chat Completions fields. In AWS’s example, pass prompt_cache_options with mode explicit and add prompt_cache_breakpoint to a text content part. Explicit mode without a breakpoint caches nothing; a breakpoint without explicit mode behaves like implicit caching. AWS’s sample shows the settings used with the OpenAI SDK’s extra_body.
  4. Send a cold request, then repeat the same prefix. AWS’s sample starts a cold run with a unique run ID at the beginning of the system prompt. Keep that prefix unchanged on subsequent requests so they can match it.
  5. Inspect reads and writes. Check usage.prompt_tokens_details.cached_tokens and cache_write_tokens in the response. AWS also recommends tracking the Bedrock runtime metrics CacheReadInputTokenCount and CacheWriteInputTokenCount across requests.

Read cache behavior in context

A successful cache hit resets the time to live (TTL), the period before a cache entry expires. Cache entries are held on the server that handled a request, so a later request handled by another server can create a new entry. Cross-Region routing can also add writes during periods of high demand. A checkpoint below the model’s minimum can leave inference successful without caching that prefix, and model support does not guarantee a hit. Bedrock’s documentation covers these operational details.

AWS says prompts and outputs for Bedrock open-weight models are not shared with model providers or used to train models. AWS’s guide describes that policy.

Prompt caching is supported on on-demand inference endpoints, not the batch inference API. Bedrock documentation sets out that restriction.