Skip to content

[FEATURE] Prompt Caching Support in Claude Agent SDK #626

@rajeshwarmanthena

Description

@rajeshwarmanthena

[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


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions