Claude API billing: what every model costs in 2026
Updated 2026-07-15
Claude bills per token, with separate rates for input and output and a different price for each model tier. On the official 2026 list that runs from $1 in / $5 out per million tokens on Haiku 4.5 up to $5 in / $25 out on Opus 4.7.
Quick answer: how Claude billing works
Claude API billing is prepaid and metered per token. You load credits into the Anthropic Console, and every request deducts input tokens (everything you send: system prompt, conversation history, tool definitions) at one rate and output tokens (everything the model writes back, including thinking tokens on extended-thinking requests) at a higher rate. Each model tier has its own pair of rates, so the same request costs five times more on Opus 4.7 than on Haiku 4.5. Three mechanics catch most people out. First, output is five times the input price on every current Claude tier, so long responses dominate small-input workloads. Second, chat is stateless: each turn resends the entire history as input, so per-message cost grows as a conversation gets longer. Third, prompt caching and the Batch API are billing features, not just performance features, and using them changes what you pay per token. The rest of this page covers the exact per-model prices, how to estimate a request before sending it, the caching math, and the levers that actually reduce a Claude bill.
Claude price table: official list vs gateway
These are the current USD prices per million tokens for the three active Claude tiers. The official column is what Anthropic bills through its Console; the gateway column is what the same models cost through APIsRouter, an OpenAI-compatible gateway that lists global models at 20% below official pricing, doubles your first top-up with a 100% balance bonus, and sells access pay-as-you-go with no subscription (pay at /topup, the key arrives by email). Whichever route you bill through, the metering is identical: the same request consumes the same token counts, and the model IDs (claude-opus-4-7, claude-sonnet-4-6) stay explicit in every call.
| Model | Official (input / output per 1M) | Via APIsRouter (input / output per 1M) |
|---|---|---|
| Claude Opus 4.7 | $5.00 / $25.00 | $4.00 / $20.00 |
| Claude Sonnet 4.6 | $3.00 / $15.00 | $2.40 / $12.00 |
| Claude Haiku 4.5 | $1.00 / $5.00 | $0.80 / $4.00 |
Estimate a request before you send it
A token is roughly four characters or three quarters of an English word, so 1,000 words of prompt is about 1,300 tokens. To estimate a request, add up everything in the input (system prompt, history, the new user message) and guess the response length. Worked example on Sonnet 4.6 at official rates: a chat turn with a 1,500-token system prompt, 5,500 tokens of accumulated history, and a 500-token reply. Input is 7,500 tokens, which costs 7,500 / 1,000,000 x $3.00 = $0.0225. Output is 500 tokens at $15.00 per million, which is $0.0075. Total: $0.03 for that turn. At 300 such turns a day you are near $9.00 per day, around $270 a month, and the history term keeps growing unless you trim it. The same arithmetic works for any model: swap in the rates from the table above. A three-line helper makes it repeatable:
PRICES = { # USD per 1M tokens, official list
"claude-opus-4-7": (5.00, 25.00),
"claude-sonnet-4-6": (3.00, 15.00),
"claude-haiku-4-5": (1.00, 5.00),
}
def cost(model: str, input_tokens: int, output_tokens: int) -> float:
in_rate, out_rate = PRICES[model]
return input_tokens / 1e6 * in_rate + output_tokens / 1e6 * out_rate
print(round(cost("claude-sonnet-4-6", 7_500, 500), 4)) # 0.03
print(round(cost("claude-opus-4-7", 7_500, 500), 4)) # 0.05Prompt caching math: when it pays off
Anthropic prices cached prefixes with two multipliers on the base input rate: writing a prefix into the cache costs 1.25x (for the default 5-minute cache, refreshed every time it is hit; a 1-hour cache costs 2x to write), and reading it back on later requests costs 0.1x. Output tokens are unaffected. Prefixes below the minimum cacheable length (1,024 tokens on Opus and Sonnet) are not cached at all. Worked example: an 8,000-token stable prefix (system prompt plus tool definitions) hit 50 times within the cache window on Sonnet 4.6. Uncached, that is 400,000 input tokens at $3.00 per million, so $1.20. Cached, you pay one write (8,000 tokens at $3.75 per million, $0.03) plus 49 reads (392,000 tokens at $0.30 per million, about $0.12), roughly $0.15 total. The prefix cost drops to about an eighth of the uncached figure. The break-even is fast: a write costs 1.25x, a read saves 0.9x, so a prefix that gets reused even twice inside the window already comes out ahead. Caching only loses money when prefixes change on nearly every request, because each change forces a fresh 1.25x write.
| Model | Base input / 1M | Cache write, 5 min (1.25x) | Cache read (0.1x) |
|---|---|---|---|
| Claude Opus 4.7 | $5.00 | $6.25 | $0.50 |
| Claude Sonnet 4.6 | $3.00 | $3.75 | $0.30 |
| Claude Haiku 4.5 | $1.00 | $1.25 | $0.10 |
Audit what you were billed: the usage object
Every Claude response includes a usage block with the exact token counts you were charged for, so you never have to guess. Send a metered test call:
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 200,
"messages": [
{"role": "user", "content": "Explain prompt caching in one line."}
]
}'Six ways to reduce a Claude bill
Applied together on a chat-style workload, tier routing plus history trimming plus caching typically cuts more cost than switching billing providers ever could, because they shrink the token counts themselves rather than the rate applied to them.
- Tier down when quality allows. Haiku 4.5 handles classification, routing, and extraction at a fifth of the Opus input rate. Reserve Opus 4.7 for the reasoning-heavy fraction of traffic and default to Sonnet 4.6.
- Cap max_tokens. Output costs five times input on every Claude tier, so an uncapped rambling answer is the most expensive failure mode. Set a ceiling that matches the task.
- Trim or summarize history. Because each turn resends the whole conversation, a rolling summary that replaces old turns caps input growth instead of letting it climb linearly.
- Cache stable prefixes. System prompts, tool schemas, and reference documents over 1,024 tokens should be cache-marked; the math in the previous section applies to every repeated call.
- Use the Batch API for offline work. Anthropic bills batch requests at half the interactive rate, which suits evaluation runs, backfills, and nightly jobs that can tolerate delayed results.
- Route non-Claude-critical steps elsewhere. Drafting, tagging, and retrieval reranking often run fine on deepseek-v4-flash at $0.126 / $0.252 per million tokens, keeping Claude for the final prose where its quality matters.
FAQ
How does Claude API billing work?
It is prepaid and per token. You buy credits, and each request deducts input tokens and output tokens at the rates for the model you called. There is no monthly fee and no per-request charge beyond the tokens; every response returns a usage block showing exactly what was counted.
How much does the Claude API cost per 1,000 tokens?
Divide the per-million rates by 1,000. Officially, Haiku 4.5 is $0.001 in / $0.005 out per 1K tokens, Sonnet 4.6 is $0.003 / $0.015, and Opus 4.7 is $0.005 / $0.025. Most price pages quote per million tokens, so a rate that looks big usually is not.
Does a Claude Pro subscription include API credits?
No. Claude Pro and Max are subscriptions for the claude.ai apps and are billed separately from API credits in the Anthropic Console. Building against the API means funding API credits (or a pay-as-you-go gateway balance); the chat subscription cannot be spent through the API.
Why is my Claude API bill higher than I expected?
The usual causes: conversation history is resent as input on every turn, output tokens cost five times input, and extended-thinking tokens bill as output even though you may not display them. Check the usage block on real responses; the counts there almost always explain the gap.
Does prompt caching always save money?
No. A cache write costs 1.25x the base input rate, so a prefix that changes on nearly every request costs slightly more with caching turned on. It pays off once a stable prefix of 1,024+ tokens is reused at least twice within the cache window, and long-lived agents recoup it many times over.
Are failed Claude API requests billed?
Requests rejected before processing, such as rate-limit 429s and authentication errors, do not consume tokens. Requests the model actually processes are billed for the tokens used, including responses cut off by max_tokens, so a truncated answer still costs what was generated.