Prompt cache for messages
v1/messages, v2/messages or v1/messages/stream and v2/messages/stream API endpoints.
Overview
Prompt caching is a GenAI feature that improves performance by storing static or repetitive sections of input. When a prompt includes previously cached content, GenAI skips reprocessing that content. This reduces token usage, lowers operational costs, and improves response times and system efficiency.
The v1/messages, v2/messages or v1/messages/stream and v2/messages/stream endpoints support prompt cache through AWS Bedrock. If a prompt payload matches a previously submitted request, the system returns a cached response instead of generating a new one. This reduces latency and token usage.
When to Use
Use prompt cache in these situations:
- You send prompt templates with the same request payload.
- You use system-level prompts.
- You respond to frequently asked questions.
Configurable TTL
Prompt caching supports a configurable TTL of 5 minutes (default) or 1 hour. The TTL parameter is optional on the Messages V1 endpoint and the Messages V2 endpoint.
Use a one-hour TTL for use cases that reuse the same system prompt or context during an extended period. Examples include batch processing and extended multi-turn sessions. The TTL resets each time the system returns a cached response.
If the cache is not used within the TTL period, it expires automatically.
Supported models
These are the models that support prompt cache:
- Claude Sonnet 5
- Claude Sonnet 4.6
- Claude Sonnet 4.5
- Claude Sonnet 4
- Claude 4.5 Haiku
- Amazon Nova Pro
- Amazon Nova Micro
- Amazon Nova Lite