Claude Code API cost calculator
Claude Code burns tokens faster than almost anything else because it re-reads context on every turn. Here is what that costs, and what it costs through a volume route.
What a month of Claude Code costs
The calculator starts at 300M input and 25M output a month, roughly a developer working in Claude Code most of the day. At that volume:
| Model | Per 1M in / out | This month |
|---|---|---|
| Claude Opus 5 | $2.5 / $12.5 | $1062.5 |
| Claude Sonnet 5 | $1.00 / $5.00 | $425.00 |
| Claude Haiku 4.5 | $0.50 / $2.5 | $212.5 |
| GPT-5 | $0.625 / $5.00 | $312.5 |
| GPT-5 mini | $0.125 / $1.00 | $62.5 |
| DeepSeek V4 Flash | $0.22 / $0.66 | $82.5 |
Put your own two numbers in above and you have your figure. If you do not know them yet, the ratios below matter more than the absolute numbers.
Why input is the whole story here
Claude Code re-sends the conversation on every turn. Ask ten short follow-ups in a long session and you have paid for the entire session context ten times over, while the output you received stayed small. That is why the input rate (not the output rate) decides this bill, and why output-heavy pricing comparisons are misleading for this tool.
- Session length is the multiplier. A session restarted at the right moment costs a fraction of one that runs all day.
- Scope beats model choice. Pointing the agent at one directory instead of the whole repository removes tokens before any rate applies.
- Model choice is second. On this list, Opus-class input costs 2.5× what Sonnet-class input does, worth having, but smaller than the two habits above.
Lowering the bill without switching provider
- Use Sonnet 5 for routine work, Opus 5 for hard reasoning. Opus input costs 2.5× Sonnet input on the current list.
- Keep sessions short. Long conversations are what inflate input tokens.
- Scope the context. Point the agent at a directory, not the whole repo.
- Then cut what is left by routing through a volume endpoint (see the current rates in the table above), and the setup guide for the two-line change.
Figures are estimates based on list prices verified 2026-11-01. Actual spend depends on your cache hit rate, batch usage and long-context tiering.