Claude Code Token Cost Calculator

Model your real Claude Code API spend per turn, session, and month across Opus 4, Sonnet 4, Haiku 3.5, and hybrid routing. Drag the sliders below to see how Anthropic 90% prompt caching shifts your break-even against Claude Max $100 and $200 plans.

Interactive calculator

Claude Code StackPer TurnPer DayPer MonthBest Fit

Frequently asked questions

How much does Claude Code cost per hour on the API?

A typical Sonnet 4 session at 80 turns/day and 48K context with 85% prompt caching runs roughly $1.50 to $3.50 per active hour, or $80 to $140 per month.

When does Claude Max $100 or $200 beat direct API billing?

Once your monthly API projection crosses $100 for Sonnet-heavy work or $200 for Opus-heavy work, Claude Max flat-rate plans usually cost less per developer.

How do I cap Claude Code spend per session automatically?

Install a PreToolUse and PostToolUse hook like cost_guard.py that reads cumulative session token usage and exits with code 2 when your dollar cap is reached.

All calculations run 100% locally in your browser with zero external API calls. Pricing and rate limits reflect published 2026 provider rate cards.