Prompt Caching – Claude Platform Docs
Anthropic's Prompt Caching feature allows developers to reuse cached prefixes in prompts, reducing latency and cost for repeated API calls. The system automatically caches content blocks and returns cached results when a matching prefix is detected, supporting use cases like conversation history, large documents, and agentic workflows. Pricing applies per cache write and read operations.
Background
- Prompt Caching is a feature of Anthropic's Claude API (application programming interface) that lets developers reuse recently processed input text without re-sending it, reducing cost and latency.
- Anthropic is the AI company behind Claude, a large language model (LLM) competitor to OpenAI's GPT (the model behind ChatGPT) and Google's Gemini.
- The key idea: when a developer sends a long prompt repeatedly (e.g., a system instruction plus a knowledge base), the API can store ("cache") that prefix on the server side and only send the new portion each time. This cuts down on processing time and tokens (the units of text the model charges for).
- Why it matters: developers building complex AI applications — chatbots with long instructions, code assistants with large context, document analysis tools — often send the same background text with every request. Caching turns those repeated costs into a one-time charge, making sophisticated AI features more economically viable at scale.
- Prior context: before this feature, every API call required sending the full prompt in its entirety, even when 99% of it was identical to the previous call.