Can you see that your bill is constantly rising irrespective of whether you are using Claude in 2026?
Token rates have risen to unbelievable amounts, going as high as $1 - $10 per million input tokens and $5 - $50 per million output tokens. But then again, there are various ways you can use to lower costs, as mentioned in this guide by Anthropic.
The Figures that matter
Here is the table that determines prices in 2026. Presently, the price for a million tokens of the API is as follows:
|
Model |
Input Cost |
Output Cost |
|
Claude Haiku 4.5 |
$1 |
$5 |
|
Claude Sonnet 5 |
$2 |
$10 |
|
Claude Opus 5 |
$5 |
$25 |
|
Claude Fable 5 |
$10 |
$50 |
|
|
|
|
The Six Levers That Really Make a Difference
1. Task Complexities to Route
The greatest mistake I see people make is using Opus for everything. Opus quality is awesome, but so is its price. This is the tiered routing approach that could slash the total costs by 60% or more:
Haiku 4.5 ($1/$5): classification, intent detection, content moderation, simple extraction, quick editing
Sonnet 5 ($3/$15 under standard pricing): RAG responses, content generation, standard tool use, most production inference
Opus 5 ($5/$25): complex coding, multistep debugging, autonomous agents, reasoning in high-stakes scenarios
Fable 5 ($10/$50): only after having done the measurement that the additional capability justifies twice the cost of Opus.
There is one routing pattern that seems to work great for agentic scenarios – running Sonnet or Haiku as the executor and asking Opus only when necessary. The so-called "subagents" pattern involves keeping the strong model as the orchestrator and delegating the bulk work to less expensive models. Each of the subagents runs in its separate context window, and the cheap model is never exposed to the expensive context of the orchestrator. This can be configured in Claude Code via the model field such as haiku or sonnet.
2. Prompt Caching: The 90% Off Hack
Prompt caching is the biggest per-request cost lever. When you provide Claude with the same prefix—a system prompt, tool definitions, project context—it can cache it and charge you 10% of the base input price for further reads.
This is the math that explains why it's worth it. A cached input token costs you just $0.20 on Sonnet 5 and $2.00 uncached. It costs you $0.50 versus $5.00 on Opus 5. On Haiku 4.5, it will cost you $0.10 per million cached input tokens.
Trap of minimum threshold: In order for caching to be applied, you must reach the minimum number of tokens in the prefix. For Opus 5 and Fable 5, the minimum token numbers in the prefix are 512. For Sonnet 5, the minimum token number in the prefix is 1,024. For Haiku 4.5, the minimum token number in the prefix is 4,096. If the number of tokens in your prefix is below this number, then your cache marker is ignored silently.
How to use it:
The main rule here is stability. Cache works only if the prefix is exactly the same as the prefix from the previous request. It means:
Static content comes first: System prompt → project context → session context → dynamic messages
No changing models during the session: Each model has its own cache. Changing the model during the session means invalidating the cache. Switching from Opus 5 to Haiku 4.5 100k tokens into the conversation will cost you more than continuing the session because of building up the cache anew.
No changing effort level during the session: It also invalidates the cache.
Never add or remove tools during the session: Tools are a part of the cached prefix. Any changes invalidate the cache for the whole conversation. One of the most frequent ways to mess up caching is this.
The compact timing trick: If you plan on compacting a long conversation, do it while the cache is still warm. It will cost you fractions of the amount you'd have to spend if you compacted it once the cache expired.
Updates via system reminder messages: If any of the prompts are getting stale (timestamped data, updated documents, etc.), send it through system-reminder messages of the agent in the next turn.
3. Batch Everything That Can Wait
The Message Batches API will offer you 50% off both input and output tokens for any workload that can afford to have a latency of 24 hours.
What should be batched:
-
Data labeling/classification overnight
-
Evaluation pipelines
-
Bulk summarisation
-
Synthetic data generation
-
Backfills and reprocessing on model upgrades
You can submit up to 100,000 requests per batch. Most batches are finished within an hour but never take more than 24 hours.
The discount is stackable with caching – a cached input token in batch mode costs just $0.15/M on Sonnet 5 which is 95% cheaper than the base input.
Important point to remember: Batches do not allow streaming responses or multi-turn usage of tools. For example, an agent can ask for a response, use the tool, and then use another tool; however, such actions cannot be performed inside a batch.
4. Control Adaptive Thinking
Opus 5 and all subsequent models utilise adaptive thinking controlled by effort parameter (low/medium/high/max) in lieu of fixed thinking budgets.
Optimization strategy:
- For classification, formatting, and extraction – use low/medium with negligible quality hit
- Keep high/xhigh for coding and agentic tasks
- The max effort level can generate several times more tokens of thinking than low and thus should be used only in cases where you need it.
Anthropic mentions that even low efforts on its latest models yield good results and often outperform higher efforts on previous generations. Try to experiment with a step or two down to see if the quality still holds.
Set max_tokens: That's a hard ceiling on the output. You use it to control the runaway scenario – a model that decides to generate 4,000 token essays when all you needed was a JSON object.
Use count_tokens: Estimate the cost before sending. count_tokens endpoint allows you to calculate exactly how many input tokens your request would consume, using Claude tokenizer itself. Don't use tiktoken for this – that's OpenAI's tokenizer and undercounts Claude's tokens by about 15 to 20%.
5. Aggressively Prune Your Context
Multi-turn conversations kill your bill. Each turn resubmits the whole context once again.
Actionable tips:
After completing a task, use /clear: Don’t let irrelevant context persist. One developer pointed out that a 10-step task reprocesses the same context 10 times, and the bill goes up as the square of the session time
Compact early and often: Not just when you reach the limit. Compressing a long dialogue to a shorter one greatly reduces the cost of the next call
Reference files using @: This allows the file to be attached to the message, instead of forcing Claude to use tool calls to look it up. With no @, Claude will hunt for the file, maybe open several different files, and all of these go into the dialogue history
Include quiet flags for tests: Add --reporter=dot or something like it to CLAUDE.md so that test output is printed as just a few lines rather than hundreds. The shorter the output, the less context is added
Bigger tasks with output to subagents: Subagent works in its own context window, and it only sends back the result. The files it processes and command outputs don’t get into your main dialogue
Server-side pruning features:
clear_tool_uses_20250919: Removes old tool outputs from the context being resent
compact_20260112: Summarizes old history into a shorter one
6. Track Unit Economics
None of these levers means anything if you don’t track your costs. Track Claude costs:
- Per customer
- Per feature
- Per agent run
- Per team
Untracked token expenditure will go uncontrolled. Spending $0.11 per resolved support ticket is great; spending $4 is a problem you should be aware of. Per team, per feature, and per customer attribution is what makes the other five levers actionable.
Real-World Cost Savings
Consider how these levers could be applied to a usual heavy MCP, long session implementation. The maximum savings would be 90% if the caching represents the major cost and session hit ratio is extremely high.
|
Lever |
Savings |
Cumulative Reduction |
|
Baseline |
— |
$50,000 |
|
Prompt caching |
~$16,409 input |
~33% |
|
Tool compilation |
~$527 input |
~34% |
|
Model routing |
~$12,000 total |
~59% |
|
Context pruning |
~$714 input |
~61% |
Math time on the $50,000/month baseline:
Bottom Line: $19,700/month compared to $50,000 baseline, 60.6% reduction.
One user observed that an equal amount of work done on Opus 5 but without caching would cost 3.8x as much as a cached workflow. The customer support agent guide from Anthropic gives an estimate of $37/10k tickets on Haiku.
Claude Code Specific Optimisation
Usage of Claude Code is included in paid subscription plans without any per-use charge. However, if you are using the API for the service, charges will be based on token rates as per models.
Internal Practices of the Claude Code Team:
-
They design the complete harness for prompt caching.
-
They do alert for cache hit ratio and SEVs for low cache hit ratios.
-
System prompt and tools are globally cached.
-
CLAUDE.md is cached per project.
-
Session context is cached per session.
-
The dynamic portion includes conversation messages.
Optimisation Checklist
-
Route by complexity – Haiku for simple use cases, Sonnet for production, Opus for hard reasoning
-
Cache aggressively – Design prompts with stable content first, track cache hit ratios
-
Batch everything which can afford it – 50% discount for asynchronous workloads
-
Set deliberate efforts – Do not default to maximum effort, try lower effort levels
-
Prune context – Do not pay for re-sending context the model does not require
-
Constrain outputs – Use max_tokens, count tokens before sending request
-
Monitor unit economics – Know your costs per customer and features
Most importantly: If you are in the middle of a lengthy session, finish whatever you are working on, then clear and restart. Each new task in the same session just makes the next task costlier.
Conclusion
In 2026, Claude AI cost optimization goes beyond merely selecting the cheapest model and involves building an efficient workflow for each API request. The efficient use of Claude API can be achieved through routing tasks based on complexity, caching stable prompts and contexts, batching workloads which do not need any instant response, controlling thinking efforts and pruning excessive context.
The main point here is treating tokens as an expense item of a business and not as a technical cost factor. Tracking token usage per customer, feature, agent and team help to understand which workflows are inefficient and where there is room for improvement. Even minor optimization of cache hits, context size, models and response length can lead to significant savings.
Thus, the optimal setup for Claude is not necessarily the setup which always uses the most powerful model, but rather the one which uses the appropriate model, context, thinking effort level and processing strategy for each particular case.