[Feature Request] Support Bedrock Prompt Caching in Claude Agent SDK
Description
I am currently using the Claude Agent SDK with Amazon Bedrock as the model provider. I am unable to enable Prompt Caching via the SDK because the current ClaudeAgentOptions (and the underlying Bedrock provider) do not support the injection of cache control metadata into the message payload.
To leverage Bedrock's prompt caching, the payload must allow for cache_control or cachePoint blocks within the messages or system prompts.
Proposed Change
Update the ClaudeAgentOptions and the Bedrock model provider logic to support the following structures in the request payload:
For Ephemeral Caching:
"cache_control": {
"type": "ephemeral"
}
For Cache Points:
"cachePoint": {
"type": "default"
}
1. Documentation Links
[Feature Request] Support Bedrock Prompt Caching in Claude Agent SDK
Description
I am currently using the Claude Agent SDK with Amazon Bedrock as the model provider. I am unable to enable Prompt Caching via the SDK because the current
ClaudeAgentOptions(and the underlying Bedrock provider) do not support the injection of cache control metadata into the message payload.To leverage Bedrock's prompt caching, the payload must allow for
cache_controlorcachePointblocks within the messages or system prompts.Proposed Change
Update the
ClaudeAgentOptionsand the Bedrock model provider logic to support the following structures in the request payload:For Ephemeral Caching:
For Cache Points:
1. Documentation Links