Skip to content

feat: Add option to disable automatic prompt caching in Managed Agents API #1004

@riya-amemiya

Description

@riya-amemiya

Summary

The Managed Agents API (Sessions API) automatically applies prompt caching server-side, but there is no client-side option to disable it. This results in cache_creation_input_tokens charges that users cannot opt out of.

Current behavior

  • SessionCreateParams has no caching-related parameters
  • The Messages API provides cache_control as an opt-in mechanism, giving users full control
  • The Managed Agents harness applies caching automatically with no way to disable it

Expected behavior

A parameter (e.g., disable_prompt_caching: true in SessionCreateParams, or an equivalent header) to opt out of automatic prompt caching in Managed Agents sessions.

Motivation

Cache write tokens cost 1.25x standard input tokens. For use cases where sessions are short-lived or prompts rarely repeat, automatic caching increases cost without benefit. Users should be able to opt out, just as they can choose not to use cache_control in the Messages API.

Environment

  • SDK version: @anthropic-ai/sdk 0.89.0
  • Beta: managed-agents-2026-04-01

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