Prompt caching
cached input tokens / prompt cache / AI API caching
Prompt caching lets an AI provider reuse its work on the opening part of a prompt when the next request starts the same way. It lowers cost and speeds up replies. OpenAI applies it by default, while Anthropic charges extra to write a cache and a tenth of the normal price to read one.
Many AI features send the same long instructions with every request: a system prompt, a list of tools, a company's policies. That repeated opening is the prefix, and caching works on it. The saving applies only when a new request begins with the same prefix as an earlier one.
OpenAI enables prompt caching by default for supported models. Reused tokens are billed at a reduced cached-input rate, discounted up to 90%. Caches are not shared across organizations.
Anthropic's pricing shows the trade more plainly. Writing to its 5-minute cache costs 1.25 times the base input price, writing to its 1-hour cache costs 2 times, and reading from either costs 0.1 times. Content that is written to the cache and rarely read again costs more than sending it uncached.
Caches also expire. Anthropic offers 5-minute and 1-hour lifetimes. OpenAI says in-memory entries on earlier models typically stay active for around 5 to 10 minutes of inactivity, up to an hour.
In practice
A booking assistant sends 4,000 tokens of instructions and business details before every customer question. Using Anthropic's multipliers, the first request writes that block to the 5-minute cache at 1.25 times the base price. The next nine questions, arriving within minutes of each other, read it at 0.1 times. Across all ten, the instructions cost 2.15 times the base price instead of 10 times. The figures are a worked example.
Why it matters to you
In custom software that runs AI all day, repeated instructions can be a large share of the input bill. Keeping the fixed part of each prompt identical and at the start lets caching cut that cost. A design that reshuffles that part on every request gets no saving, and on Anthropic a cache that is rarely reused adds cost.
What to ask or check
- 01Does the system keep its fixed instructions at the start of every prompt, identical each time?
- 02Is prompt caching on, and what share of input tokens is read from the cache?
- 03Is cached content reused often enough to cover the higher price of writing it?
What people get wrong
That caching always saves money. On Anthropic, writing to the cache costs more than normal input, so a prefix that is rarely reused costs more with caching than without.