What problem does it solve?
Prompt caching eliminates repeated reprocessing of identical prompt prefixes so agents spend less time and money on identical system prompts, large documents, or tool definitions sent across multiple API calls.
Core Features & Use Cases
- Automatic caching: Add a top-level cache control to let the system manage breakpoints and cache writes for multi-turn conversations.
- Explicit breakpoints: Place cache control on specific content blocks for fine-grained control when different sections change at different rates.
- Cost and rate-limit savings: Reads are heavily discounted versus writes, and cached tokens typically do not count toward input token rate limits, improving throughput.
- Use case: Cache a long system prompt and associated tool definitions so subsequent requests read cached tokens and only pay for uncached input.
Quick Start
Use prompt-caching by adding a cache_control directive to your Messages API request and verify cache hits using the usage fields cache_creation_input_tokens, cache_read_input_tokens, and input_tokens.