Skip to content
English

Pricing and Billing

Claude input and output are billed at a discount per model, while cache reads and writes are billed at the official list price; verify call costs using the categorized billing examples.

Claude input and output are billed at the discount for that model; cache reads and cache writes are billed at the official list price with no discount. Unit prices and discounts for each model are listed in Models and Pricing . For GPT, MiMo, and image generation models, check their respective billing units and pricing; the token examples on this page are for Claude.

Each call is billed separately for the four token categories in the response usage:

text
费用 = ( 输入 token × 输入单价
+ 缓存写入 token × 缓存写单价
+ 缓存读取 token × 缓存读单价
+ 输出 token × 输出单价 ) ÷ 1,000,000
输入单价、输出单价 = 对应官方单价 × 该模型折扣
缓存读取单价、缓存写入单价 = 对应官方原价

The four token categories correspond to these fields in the response:

Billing Itemusage Field (Anthropic Native)Official Unit Price Relative to Input Price
Inputinput_tokens1×
Cache Writecache_creation_input_tokens1.25× (5-minute cache), 2× (1-hour cache, "ttl": "1h")
Cache Readcache_read_input_tokens0.1× (0.05× for Opus 5.5 and Sonnet 5.5, 0.025× for Fable 5.1)
Outputoutput_tokensVaries by model; see the pricing page

The official cache multipliers come from the Anthropic Prompt Caching documentation . Cache usage on this site is billed at the corresponding official list price, without applying the input/output discount again.

1-hour cache write tokens are recorded separately in cache_creation.ephemeral_1h_input_tokens and billed at 2 times the official input price, without applying the input/output discount. The cache write unit prices listed on the pricing page are for the 5-minute cache.

The unit prices below are round numbers chosen for demonstration and do not correspond to any specific model; see the pricing page for actual unit prices.

Assume a model’s official unit prices (per million tokens): input $3, output $15, cache write $3.75, cache read $0.30. The usage for one Claude Code request is:

json
{
"input_tokens": 2000,
"cache_creation_input_tokens": 1500,
"cache_read_input_tokens": 30000,
"output_tokens": 800
}

At official prices:

ItemTokensOfficial Unit PriceOfficial Cost
Input2,000$3$0.006
Cache Write1,500$3.75$0.005625
Cache Read30,000$0.30$0.009
Output800$15$0.012
Total$0.032625

Assume this example model’s input and output are billed at 20% of the official price (for demonstration only, not representing current model pricing), then:

text
输入费用 = $0.006 × 0.2 = $0.0012
输出费用 = $0.012 × 0.2 = $0.0024
缓存费用 = $0.005625 + $0.009 = $0.014625
合计 = $0.018225

You cannot simply multiply the official total cost by the input/output discount, because the cache portion is not discounted.

If the cache misses on the same request, those 30,000 tokens are billed at the model’s discounted input price. Whether this saves money depends on comparing the model discount, cache write cost, and the number of repeated reads — you cannot compare official prices alone. For configuration and verification methods, see Prompt Caching .

The Claude API comes from official subscription account pools. Calls made through Claude Code do not include any additional content. Other clients (SDK, curl, and third-party tools) attach a system prompt to every request, billed as input tokens: approximately 350 tokens for Sonnet 4.6 and approximately 500 tokens for the 5.x series. This portion is counted together with your own content in the response usage’s input_tokens.

Measured on 2026-10-15 by sending “Reply with just: ok” via curl:

Modelcount_tokens CountActual input_tokensAttached System Prompt (Approx.)
Sonnet 4.619370350 tokens
5.x series18–19510–530~500 tokens
  • count_tokens only counts what you send and does not include this system prompt. When estimating costs with the SDK, curl, or third-party tools, add the numbers from the table above; Claude Code does not need this.
  • The input tokens recorded in the call log already include this portion; recalculating with the formula above will match the charges in the log.
  • The shorter the request, the higher this portion’s share; in long-context requests it is a very small fraction.
  • Charges are calculated using the USD formula above and deducted from your account balance. Balances are denominated in USD.
  • Top-up principal is credited in USD; payment processing service fees are listed separately and are non-refundable. Available payment methods and amount limits are subject to the wallet order page.

First check the model’s input/output discount, then calculate input, output, cache read, and cache write separately. Each charge can be recalculated in the call log using the corresponding unit price.

Same task — why is this time more expensive than last time?

The most common reason is a cache miss: too much time elapsed between the two requests (default cache is 5 minutes), the first part of the context changed, or the model was switched. Open the call log and compare the cache read tokens of the two entries to see.

Are cached tokens discounted too?

No discount. Cache reads and cache writes are billed at the official list price; input and output are billed at each model’s discount.

Why is input_tokens larger than what I sent?

Calls made through Claude Code do not include any additional content. Other clients (SDK, curl, and third-party tools) attach a system prompt to every request, billed as input tokens: approximately 350 tokens for Sonnet 4.6 and approximately 500 tokens for the 5.x series. Measured data is in System Prompt Billing .

How do I verify a charge?

Find the entry in the call log, plug the four token counts and the unit prices from the pricing page into the formula above; the result should match the charge in the log. If it does not match, send us the timestamp and model of that log entry.