CoreCodeBlog

Pricing

Claude API cost calculator

Published · Last checked

Enter the tokens one request uses and how many requests you make, and this page works out what they cost on the Claude API. Official prices are Anthropic's, in US dollars per million tokens, as listed in Claude API pricing (checked on November 2, 2026). The last column prices the same usage on CoreCode from the live price list.

Key points
  • A request costs input tokens × input price + cache writes × write price + cache reads × read price + output tokens × output price, each per million tokens.
  • On Sonnet 5.5, 1M input tokens cost $2 and 1M output tokens cost $10. On Opus 5.5 they cost $4 and $20.
  • In Claude Code most tokens are cache reads, which cost 5% of the input price on Opus 5.5 and Sonnet 5.5. Whether the cache hits matters more than the model's list price.
  • One typical Claude Code turn on Sonnet 5.5 costs about $0.02 with a cache hit and $0.14 when the cache misses.

Calculator

Fill in:
Official (USD)Official (CNY)CoreCode (CNY)
Per request$0.02——
Per day$2.00——
Per month$44.00——

The CoreCode column needs JavaScript and the live price list. Current prices are on the pricing page.

What 1M and 10M tokens cost

US dollars, official prices. The last column is 10 million tokens in the proportions of a Claude Code turn that hits the cache: 50,000 tokens read from the cache, 2,000 written to it and 1,000 of output.

Model1M input1M output1M cache reads10M tokens of Claude Code use
Claude Fable 5.1$10$50$0.25$16.51
Claude Opus 5.5$4$20$0.20$7.55
Claude Sonnet 5.5$2$10$0.10$3.77
Claude Haiku 5.5$0.10$0.50$0.01$0.24

Haiku 5.5 is priced for prompts up to 100,000 tokens. Above that the whole request costs five times as much; the calculator applies this when the prompt is longer.

How the cost is worked out

Anthropic bills each request by four kinds of tokens, each with its own price per million (MTok):

Add the four products and divide by one million. The API returns each count in the response's usage field as input_tokens, cache_creation_input_tokens, cache_read_input_tokens and output_tokens, so you can price a real request with the same formula.

What a Claude Code session costs

Claude Code sends the system prompt, tool definitions, files it has read and the whole conversation again on every turn. Most of that is read from the cache. One turn with 50,000 tokens of cached context, 2,000 new tokens written to the cache and 1,000 tokens of output costs:

ModelCache hitCache missed100 turns a day for 22 days, cache hit
Claude Fable 5.1$0.0875$0.70$192.50
Claude Opus 5.5$0.04$0.28$88.00
Claude Sonnet 5.5$0.02$0.14$44.00
Claude Haiku 5.5$0.00125$0.007$2.75

A missed cache writes all 52,000 prompt tokens to the cache again, so the turn costs about seven times as much. Long pauses, switching models mid-session and editing CLAUDE.md all break the cache. Caching and billing explains how to check the hit rate in your logs.

Paying less for the same tokens

FAQ

How much do 10 million Claude tokens cost?

At official prices, 10 million input tokens cost $20 on Sonnet 5.5 and $40 on Opus 5.5; 10 million output tokens cost $100 and $200. In a Claude Code session, where most tokens are cache reads, 10 million tokens cost about $3.77 on Sonnet 5.5 and $7.55 on Opus 5.5.

What does one Claude API request cost?

It depends on its tokens. A Claude Code turn with 50,000 cached tokens, 2,000 new tokens and 1,000 output tokens costs about $0.02 on Sonnet 5.5 and $0.04 on Opus 5.5. Enter your own counts in the calculator above.

Why do output tokens cost more than input tokens?

Anthropic prices output at five times input on current Claude models. In Claude Code, output is usually a small share of the tokens, so a turn's cost is driven more by how much context it resends and whether that context is a cache hit.

Does the calculator count the 1-hour cache?

No. It prices cache writes at the 5-minute rate, which Claude Code uses by default. A 1-hour write costs 2 times the input price instead of 1.25 times.

Sources