How it works · 31 of 37 Core
What drives AI inference cost and latency, and how does prompt caching help?
Pay per token, unless it's kept
Inference cost, latency & caching: Every answer costs money and time per token in and out; reusing work (caching repeated prompt parts) cuts both.
Loading the animation…
Say it like this You pay for every token in and out, so caching the part of the prompt that repeats, like a long manual, cuts both the bill and the wait.
Under the hood — for builders
- Out costs more than in
- Each Claude model on Anthropic's price list charges five times more for a token it writes than for one it reads.
- Where one question's money goes
- With a long manual in the prompt, almost the whole bill is the manual being read again; keeping it cuts that part to a twentieth.
- Faster, too
- Kept work also means the first word arrives sooner: in Anthropic's tests the wait fell by up to 79%.
- How caching works
- The service saves its work on the start of your prompt; the next request that starts the same way reuses it.
- Exact match only
- Hits need the cached part 100% identical; change one word near the top and everything after it is read again.
- Lifetime and break-even
- Kept 5 minutes, renewed free on each use; writing costs 1.25×, so it pays back on the first reuse.
- Price of kept tokens
- Sonnet 5.5 and Opus 5.5 charge 0.05× the input price for kept tokens; older models such as Sonnet 4.6 charge 0.1×, Fable 5.2 0.025×.
- Watch out
- Too-short prompts aren't cached at all (under 512 tokens on Sonnet 5.5); put what changes, like the question, last.
- Sources
- Anthropic, Pricing (platform.claude.com/docs/en/about-claude/pricing) · Anthropic, Prompt caching docs (platform.claude.com/docs/en/build-with-claude/prompt-caching) · Anthropic, Prompt caching with Claude (claude.com/blog/prompt-caching).
What happens in the inference cost, latency & caching animation, step by step?
- A chatbot answers questions about a 100,000-token manual. You pay for every token going in, and five times more for each one coming out.
- Each new question sends the whole manual again. Same pages, same price, same wait, every time.
- Your turn: switch on “keep the manual” and watch the receipt.
- Kept, the manual is read once and reused: later questions cost $0.015 instead of $0.21, and in Anthropic's test the first word came in 2.4 s, not 11.5 s.
- Your turn again: tap 3, 10 or 50 questions. At 10 the bill drops from $2.05 to $0.39: the more the start of a prompt repeats, the more caching saves.
What everyday example explains inference cost, latency & caching?
A print shop that charges per page, but keeps a copy of the manual you bring every time.
Why should a team care about inference cost, latency & caching?
Demo vs affordable product.