Updated July 2026. The exact formula, a worked example for Opus, Sonnet and Haiku, the token rules of thumb, and a free calculator that does the math for you.
Claude bills per token, with input and output priced separately — so a Claude API cost estimate comes down to four numbers: your input tokens, your output tokens, and the two per-million rates for your model. This guide shows the formula, works a real example, and points you at a free Claude token cost calculator so you never have to do the arithmetic by hand.
Claude API cost for a single call is:
cost = (input_tokens ÷ 1,000,000 × input_rate) + (output_tokens ÷ 1,000,000 × output_rate)
Rates are quoted per million tokens. For Claude Opus 4.8 the input rate is $5 and the output rate is $25. For Claude Haiku 4.5 it is $1 and $5. Output is about 5× input on every Claude model, so your output length drives most of the bill.
You need a token count for both your prompt and the expected answer. Quick rules of thumb for English:
Don't forget the parts that are easy to overlook: your system prompt, any retrieved context or documents, and the conversation history you resend each turn all count as input. Non-English text (Cyrillic, CJK) uses 2–4× more tokens — see AI token cost explained for why.
Example on Claude Opus 4.8 ($5 / $25), a 2,000-token prompt and a 500-token answer:
Run the same call on Haiku 4.5 ($1 / $5) and it drops to $0.0045 — five times cheaper. That is the value of estimating before you ship: you can see whether a cheaper model covers the job.
Multiply per-call cost by monthly volume. At 100,000 calls/month, the Opus example above is $2,250; the Haiku version is $450. This is where a calculator earns its keep — small per-call differences become large monthly ones.
Doing this by hand for every model gets old fast. The gpt-cost.com calculator is free, needs no signup, and does all three steps at once:
Want to weigh Claude against another provider? The compare pages put two models side by side, and the model list shows every current rate.
Count input and output tokens, multiply each by its per-million rate, and add them. On Opus 4.8 ($5 / $25), a 2,000-token prompt with a 500-token answer costs $0.0225 per call.
Yes — the gpt-cost.com calculator is free and needs no signup. Pick a Claude model, enter or paste your prompt, and it shows per-call and monthly cost.
Roughly 1 token per 4 characters or 0.75 words of English; a 750-word prompt is about 1,000 tokens. Non-English text uses more.
Multiply per-call cost by calls per month. The calculator has a requests-per-month field that shows the at-scale total directly.
Prices synced from Anthropic's official pricing page, July 2026. For exact billing, use Anthropic's official token counting.