Claude Code is free to install. You pay either a flat Claude subscription (Pro, Max 5x, Max 20x, Team or Enterprise) with usage limits, or per token through an API key with no ceiling. On the API, re-sent context drives the bill: one real 938-turn session cost $154 on Sonnet and $771 on Opus at list prices.
Two ways to pay for Claude Code
A subscription caps your spend but can stop you mid-task. An API key never stops you but never caps you. More in subscription vs API key.
| Claude subscription | Anthropic API key | |
|---|---|---|
| What you pay | Flat monthly plan price | Per token, per request |
| What limits you | 5-hour window and weekly cap | Your budget and rate limits |
| How you check it | /status | /cost and the Console |
| Cost of a heavy day | Nothing extra, until you hit the limit | Grows with every turn |
| Fits best | One person coding most days | Light, bursty or automated use |
Claude Code pricing on a subscription
Pro, Max 5x and Max 20x include Claude Code; prices vary by region, so check Anthropic's pricing page. What you buy is an allowance shared with claude.ai, metered over a five-hour window and a weekly cap.
- 1Pro
The base allowance. Opus draws it down faster than Sonnet.
- 2Max 5x and Max 20x
Named for usage relative to Pro. See is Claude Max worth it.
- 3The limits
How the windows work: weekly and 5-hour limit explained.
Claude Code cost per token on the API
The API bills four token types at different rates. Claude Code caches automatically, so almost everything it reads is a cache write or read (full breakdown).
| Token type | What it is | Relative price |
|---|---|---|
| Input | New context not read from cache | Base rate |
| Cache write | Context stored for reuse on later turns | Slightly above input |
| Cache read | Context re-read from the cache | Steep discount to input |
| Output | The model's reply, including tool calls | Several times input |
What real Claude Code sessions cost
The first ten steps of a 200-turn session cost about a dollar; all 200 cost about thirty times that, because each step carries everything before it.
What drives the Claude Code bill
Session length matters most, then context size, and model choice multiplies both. The replies people price in their heads are a minority.
- cache read67.7%
- cache write18.9%
- output13.2%
- uncached input0.2%
Claude Code tokens to dollars: estimating your own cost
- 1Price each tier
Tokens per tier times its rate, or just read
/coston an API key. - 2Scale to a month
Typical task cost times tasks per day times working days, plus retries.
- 3Count per finished task
A cheaper model that needs more turns can cost more. See cost per task vs cost per token and cost per developer.
How to lower Claude Code cost
/clear between tasks, lean CLAUDE.md and MCP, Sonnet for routine work (full list). condense compresses the re-read history those habits miss.
| Session | List price | Through condense |
|---|---|---|
| 938 turns, Sonnet | $154 | $43 (72.3% less) |
| 938 turns, Opus | $771 | $214 (72.3% less) |
| 200 turns, Opus | $33.61 | $18.53 (45% less) |
Under roughly 20 turns there is little to gain; on a subscription it means up to 3× more work from your plan. Free tier with 25M saved tokens a week, paid tiers from $5 a month, 15% of savings on the API (pricing). Install with curl -fsSL https://cli.condense.chat/unix | sh and run dense claude.
Frequently asked questions
How much does Claude Code cost per month?
On a subscription, the plan price on Anthropic's pricing page. On an API key it depends on usage; one long session we measured cost $154 at Sonnet list prices.
Is Claude Code free?
The CLI is free, but it needs a paid Claude plan or an API key with credit to do any work.
How do I see what a Claude Code session cost?
Run /cost on an API key. On a subscription, /status shows plan usage instead of dollars.
Why is my Claude Code bill so high when the answers are short?
Each turn re-sends the whole session. Across twelve sessions, cache reads were 67.7% of spend and output only 13.2%.
Is Opus much more expensive than Sonnet in Claude Code?
Yes. The same 938-turn session cost $154 on Sonnet and $771 on Opus at the list prices of the time.