Claude Code Cost
- Source
- openrouter.ai
- Author
- OpenRouter editorial sitemap
- Date

Context
Claude Code itself is free. The bill is for the model it calls, and according to OpenRouter's analysis, most of that bill is Claude Code's own setup rather than the user's prompt. OpenRouter sent a one-word request through Opus 5.5 in an empty folder: the reply was four , but the session wrote 17,047 tokens of Claude Code's and tool definitions to the prompt cache, which cost $0.085 at Opus's cache-write price of $5 per million tokens. A prompt cache stores text the model has already processed so later requests can reuse it, and reading from it on Opus costs $0.20 per million tokens, 25 times less than writing. The first turn is therefore the expensive one, and costs climb again as Claude Code reads more files, because each new file is written to the cache once and read back on every later turn.
OpenRouter's figures are medians of real Claude Code sessions on its service in the 30 days to October 18, so they describe pay-per-token use on an API key, not Claude subscriptions, which cover usage up to a limit. Model choice moves cost the most: a session of 2 to 9 turns had a median cost of $0.31 on Anthropic's Opus 5.5, $0.16 on Sonnet 5.5 and under a cent on Haiku 5.5, and a single-turn session on Claude Fable 5.1 cost more than a long Haiku session. Within one model, length comes next: a 10-to-49-turn Opus session cost about ten times a one-turn session ($1.39 against $0.136). At 20 short sessions a workday over 22 workdays, OpenRouter estimates $134 a month on Opus and $68 on Sonnet, and notes that codebase size can push real costs either way.
The levers follow from that. OpenRouter says switching an all-Opus default to Sonnet roughly halves the bill, and Sonnet fixed the same three bugs as Opus in its controlled test, the one behind its three-tier Claude comparison. It also recommends sending background jobs and sub-agents to Haiku, starting a fresh session or compacting context when moving to an unrelated task, and setting a credit limit on the key. Claude Code's own cost figure is unreliable for model names it does not recognize, because it guesses from Anthropic's built-in price table: in OpenRouter's runs it reported $0.16 to $0.31 for Haiku sessions that cost about half a cent and overstated Opus sessions by about 50%.
- In OpenRouter's test, a one-turn Opus 5.5 session replying 'ok' wrote 17,047 tokens of Claude Code's own system prompt and tool definitions to the prompt cache, about $0.085, before any project files were read.
- Cache reads on Opus 5.5 cost $0.20 per million tokens, 25 times less than cache writes, so later turns add less than the first; costs climb again as each newly read file is written to the cache once and re-read every turn.
- In OpenRouter's 30-day session data, model choice outweighs session length: a one-turn Fable 5.1 session at a $0.342 median costs more than a 10-to-49-turn Haiku 5.5 session at $0.053.
- In a controlled three-bug fix test, Opus, Sonnet and Haiku 5.5 all fixed every bug; Sonnet cost about two thirds of Opus and Haiku about a twelfth of Sonnet, though back-to-back runs shared a warm cache.
- OpenRouter warns that Claude Code's own total_cost_usd guesses prices for unrecognized model names: it reported $0.16 to $0.31 for Haiku sessions that cost about half a cent and overstated Opus sessions by about 50%.
- context window — The maximum amount of text a model can consider at once — its working memory for the current conversation or task.
- token — The chunk of text a model reads and writes in — roughly three-quarters of a word — and the unit AI usage is billed in.
- system prompt — The standing instructions a model receives before any user input — defining its role, rules, tools, and tone for the whole conversation.
Checking sign-in…
Loading comments…





