⚡ Running Claude Code across an engineering team?Cap Claude Code Spend. Inspect the live prepaid wallet & token ledger demoLive Demo

Home › Free Tools › Claude Code API Cost & Token-Burn Calculator

Free engineering calculator

Claude 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 editable
Verified Anthropic Standard API Pricing (2026-11-14) Peak prompt: –

Anthropic 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.

Cost per task – –
Per developer / workday – –
Team monthly API spend – –
Prompt cache hit share – Warm reads vs cold cache writes

2. Session & context mechanics

Startup prefix + per-turn tool output accumulation
Selecting a verified model loads its 2026-11-14 list rates below.
System prompt, root CLAUDE.md, git status, and loaded MCP tool schemas.
File reads, grep results, bash test output, and assistant diff history.
Each agentic step resends the accumulated prompt window.
Code edits, tool-call JSON arguments, and concise explanations.
Added to visible output and billed once at the output rate (tuned via /effort).

3. Prompt cache TTL, compaction & subagent fanout

API keys default to a 5-minute cache TTL
Set CLAUDE_CODE_PROMPT_CACHE_TTL=1h to opt API sessions into 1h TTL.
Pauses longer than TTL, mid-task /model switches, or /fast toggles.
Set e.g. 12–15 to summarize history before context snowballs.
Compacted conversation summary retained alongside startup context.
Explore/Plan/search subagents each open an isolated context & cache.
Typical read-only search subagent runs 3–6 rapid tool turns.
Initial prompt + subset of read/search tool schemas per subagent.
Inheriting Opus 5.5 or Fable 5.2 bills search loops at frontier rates.

4. Engineering team & monthly scaling

Scale from 1 developer to 500+ engineers
Active developers using Claude Code via API keys.
Distinct coding sessions per engineer per active workday.
20–22 workdays is standard for monthly engineering budgets.
5. Per-1M rate overrides, >200k long-context tiering & custom tariff comparison (Editable Assumptions)
1.0x flat on Sonnet/Opus 5.5; 5.0x >100k on Haiku 5.5.
Defaults to 0%. Test a contracted enterprise or gateway rate card.
Anthropic bills 1.1x on Claude Sonnet 5.5 and newer models when strict US-only inference routing is requested.

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:

Combined non-overlapping workflow impact (illustrative) –
Projected monthly spend with habits applied –

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:

Turn 1 (initial cache build): prompt_1 = B + G cost_1 = (prompt_1 * rate_cache_write + (O_visible + O_thinking) * rate_output) / 1,000,000 Turn t >= 2 (warm cache hit inside 5m or 1h TTL): prompt_t = prompt_(t-1) + G cost_t = (prompt_(t-1) * rate_cache_read + G * rate_cache_write + O_total * rate_output) / 1,000,000 Turn t >= 2 (cold-cache reset after >TTL idle pause or /model switch): cost_t = (prompt_t * rate_cache_write + O_total * rate_output) / 1,000,000

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):

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.

Create Workspace Explore Live Demo Book a Free 360° Cost Report

Related guides & tools