Home › Free Tools › Claude Code API Cost & Token-Burn Calculator
Free engineering calculatorClaude Code API Cost & Token-Burn Calculator
Single-turn token calculators drastically underestimate agentic coding CLI spend. Model how Claude Code actually bills on API keys: multi-turn file accumulation, 5-minute vs 1-hour prompt cache TTLs, cold-cache rewrites after idle pauses, /compact intervals, extended thinking, and subagent fanout.
1. Load a realistic Claude Code workflow preset
1-click baselines — every field stays editableAnthropic API standard list pricing (verified 2026-11-14): $2.00/MTok input, $2.50 5m write, $4.00 1h write, $0.10 cache read (0.05x), $10.00 output incl. thinking; flat 1.0x across 1M context.
2. Session & context mechanics
Startup prefix + per-turn tool output accumulation/effort).
3. Prompt cache TTL, compaction & subagent fanout
API keys default to a 5-minute cache TTLCLAUDE_CODE_PROMPT_CACHE_TTL=1h to opt API sessions into 1h TTL.
/model switches, or /fast toggles.
4. Engineering team & monthly scaling
Scale from 1 developer to 500+ engineers5. Per-1M rate overrides, >200k long-context tiering & custom tariff comparison (Editable Assumptions)
Illustrative What-If Workflow Lever Simulator
Before changing providers, engineering teams usually recover the largest share of Claude Code spend from session hygiene. Every figure below is computed directly from your active inputs above as an illustrative workflow simulation — never a guaranteed discount:
Step-by-step arithmetic disclosure
Every dollar in the summary cards traces directly to integer token counts divided by 1,000,000 and multiplied by the active per-1M rate:
| Billing bucket | Tokens / task | Exact formula | Cost / task |
|---|
Inspect turn-by-turn prompt accumulation & cache ledger
| Turn | Cache / context event | Total prompt | Cache read | Write / uncached | Turn (cumulative) |
|---|
How the Claude Code cost model works
Unlike single-turn API calls, an agentic coding session compounds context on every tool turn. On turn t, Claude Code sends startup prefix B (CLAUDE.md, system instructions, and MCP tool schemas) plus cumulative file reads and command output t × G:
- The 5-minute API TTL trap: Claude Code subscriptions get a 1-hour prompt cache TTL on main sessions, whereas API keys and gateways default to a 5-minute TTL unless
CLAUDE_CODE_PROMPT_CACHE_TTL=1his configured. On Claude Sonnet 5.5 ($0.10read vs$2.505m write) and Claude Opus 5.5 ($0.20read vs$5.005m write), pausing 6 minutes to review a diff causes a 25x jump on the entire accumulated prefix. In our Cold-Cache / >200k Context Thrash preset, three idle pauses at turns 10, 20, and 26 turn a$2.0910warm session into$3.4326— adding $1.3416 of pure cache-rewrite waste in one task. Read our forensic breakdown of why Claude Code burns tokens so fast. - How
CLAUDE.mdactually affects caching: Editing rootCLAUDE.mdmid-session does not invalidate your active running session's cache because Claude Code loads startup memory once per session. However, a bloatedCLAUDE.mdor twenty idle MCP servers inflateBon every session start,/clear, cold-cache miss, and spawned subagent. - Extended thinking & subagent cliffs: Extended thinking tokens are billed once inside
output_tokens(see our guide to controlling reasoning and thinking token spend). Pinning read-only Explore subagents to Haiku cuts per-turn cost sharply as long as prompts stay under 100k tokens — see Claude Haiku 5.5's 100K-token 5x pricing cliff. - Published developer benchmarks & adjacent calculators: Anthropic's Claude Code documentation notes an average API cost near ~$13 per developer per active day (with 90% of users under $25/day), or roughly $150–$250/developer/month on Sonnet 5.5 when cache hit rates stay healthy. For non-CLI workloads, use our general OpenAI/Claude/Gemini monthly prompt-caching calculator, audit exported usage CSVs in Bill X-ray, or review broader patterns for cutting production Anthropic API costs (including Message Batches) and capping custom AI agent loops.
Verified Anthropic API model rates used in this calculator
Default presets load standard Anthropic API per-1M-token rates verified on 2026-11-14 (see full Claude Sonnet 5.5, Opus 5.5 & Haiku 5.5 API pricing reference). Overriding any rate or enabling optional modifiers automatically switches the status badge to Editable Assumption:
| Model | Base input | 5m write (1.25x) | 1h write (2.0x) | Cache read | Output + thinking | Context tier rule |
|---|---|---|---|---|---|---|
| Claude Sonnet 5.5 | $2.00 | $2.50 | $4.00 | $0.10 (0.05x) | $10.00 | 1M flat (1.0x) |
| Claude Opus 5.5 | $4.00 | $5.00 | $8.00 | $0.20 (0.05x) | $20.00 | 1M flat (1.0x) |
| Claude Haiku 5.5 | $0.10 | $0.125 | $0.20 | $0.01 (0.10x) | $0.50 | 1M window; 5.0x >100k prompt |
| Claude Fable 5.2 | $8.00 | $10.00 | $16.00 | $0.20 (0.025x) | $40.00 | 1M flat (1.0x) |
| Claude Sonnet 4.6 | $3.00 | $3.75 | $6.00 | $0.30 (0.10x) | $15.00 | 1M flat (1.0x) |
| Claude Opus 4.6 / Opus 5 | $5.00 | $6.25 | $10.00 | $0.50 (0.10x) | $25.00 | 1M flat (1.0x) |
Hard budget guardrails & native Anthropic routing on apicuts
Workflow discipline lowers per-session burn, while workspace budget controls prevent runaway agent loops from turning into a surprise month-end invoice. Follow our setup guide to connect Claude Code, Codex CLI, Cursor and Aider (ANTHROPIC_BASE_URL setup):
- Native
POST /v1/messagessupport: PointANTHROPIC_BASE_URL="https://apicuts.ai"(without/v1) to preserve Anthropic prompt caching (cache_control), tool-use loops, streaming SSE, and extended thinking blocks without translation loss. - Prepaid workspace wallet: Top up confirmed workspace funds in
/app/fundingafter signing up — traffic stops cleanly when confirmed funds run out instead of accruing unbounded postpaid overages. - Per-squad or per-repo keys: Issue separate revocable
ack_...keys per squad, repository, or CI runner in/app/keys, or explore the interactive demo dashboard with sample data before signing up.
Rolling out Claude Code across multiple squads? Follow our Claude Code team cost governance guide or explore more calculators in Free Tools.
Frequently asked questions
Why does Claude Code burn more API tokens than single-turn chat?
Every tool call in Claude Code resends your startup prompt (CLAUDE.md, system instructions, and MCP tool schemas) plus all prior file reads, command output, and edits accumulated so far. A 30-turn refactor that starts at 45,000 tokens and adds 8,000 tokens per turn sends more than 5 million cumulative prompt tokens before completion.
Why do idle pauses spike Claude Code API bills so sharply?
When running Claude Code on API keys or a gateway, prompt caching defaults to a 5-minute TTL unless CLAUDE_CODE_PROMPT_CACHE_TTL=1h is configured. On Claude Sonnet 5.5 and Claude Opus 5.5, warm cache reads cost 0.05x of base input ($0.10 and $0.20 per 1M tokens), whereas a 5-minute cache write after an idle pause costs 1.25x ($2.50 and $5.00 per 1M tokens) — a 25x jump on the entire accumulated context.
Are extended thinking tokens billed separately from output tokens?
No. Anthropic bills extended thinking tokens once inside total output_tokens at the standard output rate ($10.00 per 1M tokens on Claude Sonnet 5.5 and $20.00 per 1M tokens on Claude Opus 5.5). This calculator separates visible output and thinking tokens as additive inputs so you can size reasoning effort without double-counting.
Does crossing 200,000 tokens double the per-token price on Claude Sonnet 5.5 or Opus 5.5?
On standard Anthropic API pricing, Claude Sonnet 5.5, Opus 5.5, and Fable 5.2 offer a 1-million-token context window at flat 1.0x per-token rates. Crossing 200,000 tokens still accelerates spend because auto-compaction waits until roughly 967,000 tokens by default and any cold-cache reset rewrites hundreds of thousands of tokens at 1.25x. By contrast, Claude Haiku 5.5 applies a 5.0x tier across all token categories above 100,000 prompt tokens.
How can engineering teams cap Claude Code API spend per project or squad?
Combine session hygiene (/clear between unrelated tasks, /compact before long sessions snowball, and lean CLAUDE.md files) with hard workspace budget boundaries. On apicuts, teams fund a prepaid workspace wallet that stops cleanly when confirmed funds run out and issue separate ack_... API keys per squad, repo, or environment over native POST /v1/messages.
Put a hard prepaid ceiling on team coding spend
Route Claude Code through native https://apicuts.ai Messages with prepaid wallet boundaries, separate ack_... keys per squad or repo, and content-free request accounting — or bring your usage CSV for a free 360° cost review.