aicodecost

Claude API pricing and token cost calculator

Updated October 13, 2026

The Claude API charges per million tokens. Opus 5.5 costs $4 for input and $20 for output, Sonnet 5.5 $2 and $10. Cached context costs far less to read back, and batch requests are half price.

Fable 5.1, input / output
$10 / $50
Opus 5.5, input / output
$4 / $20
Sonnet 5.5, input / output
$2 / $10
Haiku 5.5, input / output
$0.10 / $0.50

Work out what your tokens cost

Model

Tokens, in millions

New text you send that is not cached

What Claude writes, including its thinking

Context Claude re-reads from the cache

Context saved to the cache

Total cost

$49.82

  • Input$0.00 0%
  • Output$5.92 12%
  • Cache read$31.40 63%
  • Cache write$12.50 25%

It starts with a real heavy day of Claude Code on Opus: about 500 requests that would cost $50 at API rates.

API prices per million tokens

Claude API prices per million tokens
ModelInputOutputCache readCache write
Fable 5.1$10$50$0.25$12.50
Opus 5.5$4$20$0.20$5
Sonnet 5.5$2$10$0.10$2.50
Haiku 5.5$0.10$0.50$0.01$0.125

Haiku 5.5 prices apply to prompts up to 100,000 tokens. Above that, Haiku costs $0.50 for input and $2.50 for output. Cache write prices are for the standard five-minute cache. Batch requests cost 50% less, fast mode on Opus 5.5 costs 2x, and US-only processing costs 1.1x.

Where the money goes in Claude Code

On that measured day, 63% of the cost was cache reads: Claude re-reading the conversation and code it already had in context, hundreds of times. Output, the code Claude actually wrote, was a small part of the bill.

That is why long sessions get expensive. Starting fresh with /clear between unrelated tasks keeps the context, and the cache reads, small.

API or a plan?

For hands-on coding, a plan costs far less. The measured day above would cost $50 on the API, while Max 20x costs $200 for a whole month. The API makes sense for automation, CI and apps you build. Find the plan that fits you.

Common questions

How much does Claude Opus cost on the API?
Opus 5.5 costs $4 per million input tokens and $20 per million output tokens.
What is a cache read?
When Claude reuses context it has already seen, such as earlier messages or files, it reads it from the cache. That costs a fraction of normal input.
Is there a discount for batch requests?
Yes. Batch requests cost 50% less. They run in the background, so they suit work that does not need an instant answer.

Sources