Claude API Cost Calculator
Estimate Anthropic Claude API cost from input and output tokens, with prompt-caching and batch discounts.
Formula last reviewed 4 August 2026 · How we verify our calculators
Total cost (USD)
$10.5000
- Input cost
- $3.0000
- Output cost
- $7.5000
- Subtotal (before batch)
- $10.5000
Updates live as you type
Frequently asked questions
Cost is (input tokens × input rate + output tokens × output rate), priced per million tokens. Output tokens are billed at a higher rate than input on every Claude model.
Cached input tokens are billed at a steep discount (commonly around 90% off), so reusing a long system prompt or document across calls dramatically cuts input cost.
The Batch API processes non-urgent requests asynchronously at roughly half price — ideal for bulk jobs like evaluations, summarisation or data labelling.
Haiku is cheapest and fastest for simple tasks, Sonnet balances cost and capability, and Opus is most capable for hard reasoning. Match the model to task difficulty to control cost.
Two discounts, two very different savings on the identical workload
Claude Sonnet 4.6, 1,000,000 input tokens, 500,000 output tokens, no discounts: input cost is 1 × $3 = $3, output cost is 0.5 × $15 = $7.50, for a total of $10.50. Switch on prompt caching, and the 90%-off cached-input discount drops input cost to $0.30, cutting the total to $7.80 — a 26% saving. Switch on the Batch API instead, with caching left off, and the 50% discount applies to the entire subtotal, halving $10.50 to $5.25 — nearly 50% off, and cheaper than caching alone in this case, because batch discounts the output cost too while caching only ever touches input.
Why these two discounts aren't interchangeable
Prompt caching only reduces the cost of input tokens that were already cached, so its impact scales with how much of your input is a repeated static prefix — a long system prompt or reference document reused across calls. The Batch API instead applies a flat discount to the whole request, input and output together, which is why it beat caching in the example above where output cost already dominated the bill. Picking the right one — or both together — depends on whether a workload's cost is concentrated in a repeated prompt or spread across a large, non-urgent volume of requests.
The lever that usually matters more than either discount
Model choice tends to move the needle further than caching or batching alone: Haiku for simple, high-volume tasks, Sonnet for a balance of cost and capability, Opus reserved for genuinely hard reasoning. Routing simple classification or extraction work to a cheaper model while keeping Opus only for what actually needs it can cut a workload's blended cost dramatically — often by more than either discount achieves on its own, and stacking model choice with caching or batching compounds the savings further.
Pricing as of June 2026. LLM rates change frequently — verify current prices on the provider's official pricing page before budgeting.