Claude API Cost Calculator
Estimate what a Claude API call costs before it surprises you on the bill. Pick a model, enter your input and output tokens, and see the cost per run and projected per month. Prices are editable — adjust them if Anthropic's rates have changed.
A calculator assumes you know your token counts. You usually don't — long sessions, subagents, and context re-sends inflate them quietly. Tokipet reads your Claude Code session logs locally and shows your actual cost per repo, per model, per day. Local-first; your code never leaves your machine.
Get Tokipet →How Claude API pricing works
The Claude API charges per token, split into input tokens (everything you send — prompt, files, conversation history) and output tokens (what the model generates), each priced per million tokens (MTok). Output is far more expensive than input, and rates differ sharply by model: Opus costs roughly 5× Sonnet, which costs roughly 4× Haiku. Matching the model to the task is the single biggest lever on your bill.
Why your real cost is usually higher than the estimate
This calculator takes a fixed token count per run, but in practice token usage grows: every turn in a session re-sends the prior context, large files get re-read, and subagents multiply calls. That's why a per-call estimate and your end-of-month invoice rarely match — and why tracking actual usage beats estimating it. See where Claude Code cost actually goes →
Default rates reflect commonly published Claude API pricing and may not be current — always confirm against Anthropic's official pricing page, and edit the rate fields above to match.