Anthropic supports prompt caching with Claude, which allows Claude models to cache system messages and conversation history between requests to improve performance and reduce costs.Prompt caching is generally available for:
Claude 4 Sonnet
Claude 3.7 Sonnet
Claude 3.5 Sonnet
Claude 3.5 Haiku
To enable caching of the system message and the turn-by-turn conversation, update your model configuration as follows: