> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://openrouter.ai/docs/llms.txt.
> For full documentation content, see https://openrouter.ai/docs/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://openrouter.ai/docs/_mcp/server.

# Caching - Python SDK

The Python SDK and docs are currently in beta.
Report issues on [GitHub](https://github.com/OpenRouterTeam/python-sdk/issues).

Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.

## Fields

| Field  | Type                                                                                         | Required             | Description | Example |
| ------ | -------------------------------------------------------------------------------------------- | -------------------- | ----------- | ------- |
| `ttl`  | [Optional\[components.AnthropicCacheControlTTL\]](../components/anthropiccachecontrolttl.md) | :heavy\_minus\_sign: | N/A         | 5m      |
| `type` | [components.ToolTypeEphemeral](/docs/sdks/components/components/tooltypeephemeral)           | :heavy\_check\_mark: | N/A         |         |