How to Cut Claude Opus 4.5 API Costs with Prompt Caching
Prompt caching on Claude Opus 4.5 can cut repeated input costs by up to 90% on the cached portion, and routing easy requests to Sonnet or Haiku trims the rest. This is the cost playbook I used to bring a monthly API bill down without hurting output quality.
Why is Claude Opus 4.5 so expensive?
Claude Opus 4.5 prices near $15 per million input tokens and $75 per million output tokens. Output is the killer: agents that loop through many tool calls generate enormous output volume. A single 30-step agent run can cost more than a full day of Sonnet chat.
The fix is not to avoid Opus. It is to stop paying full price for the parts of the prompt that never change.
How does prompt caching work on Anthropic’s API?
You mark stable content — usually a system prompt and reference docs — with a cache breakpoint. The first call writes the cache; subsequent calls read it at a large discount (roughly a tenth of the input price) as long as the content is unchanged and the cache has not expired.
- Move all fixed instructions, style guides and reference files to the top of the message array.
- Add a cache breakpoint after the stable block using the cache control field.
- Keep variable content — the user’s actual question — after the breakpoint.
- Send requests within the cache TTL (a few minutes) to get the discount.
If you include a timestamp or random ID in the cached block, you bust the cache every call and pay full price. That mistake alone wiped out the savings in my first attempt.
How much can caching actually save?
On a document-Q&A workload with a 20,000-token system prompt reused across 500 calls, caching dropped input cost by about 88% on the cached block. The output tokens stayed the same, so the total bill fell by roughly a third.
For agent loops with stable tool definitions, savings were higher because the schema block was large and untouched.
How to combine caching with model routing
Add a cheap classifier in front. If the request is simple — formatting, lookup, short rewriting — send it to Haiku. If it needs real reasoning across many files, send it to Opus. This two-layer setup is what most teams should run.
| Task type | Model | Why |
|---|---|---|
| Classification, formatting | Haiku | Cheap, fast enough |
| Standard code edits | Sonnet | Balanced price/quality |
| Multi-file refactors, agents | Opus 4.5 | Best tool use and coherence |
What else trims the bill?
Trim context aggressively. Do not paste the whole repo when three files will do — every extra token is paid on every call unless cached. Cap agent iteration counts so a stuck loop cannot run forever. And log token usage per request so a regression is visible the day it appears, not at month-end.
When is Opus 4.5 still worth it?
When the task genuinely needs the strongest reasoning and tool use — refactors, complex debugging, long-horizon agents. For everything else, routing to a cheaper tier costs you almost nothing in quality and a lot less in money.
Quick Summary
- Claude Opus 4.5 costs about $15/M input and $75/M output tokens.
- Prompt caching discounts the stable portion of a prompt by up to ~90%.
- Never put timestamps or random IDs inside the cached block — it busts the cache.
- Route simple tasks to Haiku or Sonnet and reserve Opus for hard reasoning.
- Log token usage per request to catch cost regressions early.
