On a subscription, Claude Code costs $20, $100, or $200 a month flat and your marginal cost per session is zero. On the API you pay per token, and Anthropic's own documentation puts the average across enterprise deployments at about $13 per developer per active day and $150 to $250 per developer per month, with 90 percent of users staying under $30 per active day (as of August 2026). Individual sessions range from a few cents for a small Sonnet fix to more than $20 for a long Opus run over a large repo. Model choice, context re-sent per turn, and turn count are what move the number.
- Anthropic publishes the number: about $13 per developer per active day and $150 to $250 per developer per month on metered billing, as of August 2026.
- On a subscription the cost is fixed and known. The only variable is whether you meet a usage window.
- On the API, model choice is the biggest lever: Opus 5 output is 5x Haiku 4.5 output per token.
- Agent loops re-send context every turn, so cost grows closer to turns squared than linearly.
- Cache reads cost a tenth of base input. A long session with a stable prefix is far cheaper than its raw token count suggests.
- The break-even against Max 5x lands near $100 of API spend a month, which daily agent users typically pass in a week.
The short answer, in numbers
There are two answers because there are two billing systems, and confusing them is why every thread about this contradicts itself.
Claude Code cost by billing system, checked August 2026.
| Billing | What you pay | Per-session cost | Risk |
|---|---|---|---|
| Claude Pro | $20/mo ($17/mo billed annually) | $0 | You meet a usage window |
| Claude Max 5x | $100/mo | $0 | You meet a usage window less often |
| Claude Max 20x | $200/mo | $0 | Rarely, but weekly caps still exist |
| Team standard seat | $20/seat/mo annual, $25 monthly | $0 | Shared with chat and Cowork |
| Anthropic API key | Per token, no ceiling | $0.04 to $25+ | An invoice you did not model |
Set that against the plans and the arithmetic decides itself. $150 to $250 a month of metered spend is one to two and a half times the price of Max 5x. If your usage looks like the average developer in that dataset and your work is interactive, the subscription wins and it is not close.
The two cost models, and why answers differ so much
- Subscription. You pay $20, $100, or $200 a month and run until you hit a usage window. Marginal cost per session is zero. Your risk is interruption, not a bill.
- API. You pay per token with no windows and no ceiling. Marginal cost per session is real. Your risk is a bill, not interruption.
Someone says a session cost them eleven dollars. Someone else says their whole month was twenty. Both are telling the truth and they are on different systems.
The third case: usage credits
Since usage credits shipped, the wall at the end of a subscription is optional. On Pro and Max you can turn on credits and keep working past your included limit; that overage is billed at standard API rates, with a monthly spending cap, optional auto-reload, and a $2,000 daily redemption limit (as of August 2026). Run /usage-credits in Claude Code to manage them. This makes a hybrid the common shape now: a flat subscription for the bulk of the work, metered spend for the tail.
Measured cost by task type
The figures below are API-rate equivalents for common task shapes at Sonnet 5 standard rates ($3 input, $15 output per million). They are what you would pay on a key, or the notional value of what you consumed on a subscription.
Typical API-rate cost per task, uncached. Ranges reflect repo size and how much the agent read before it could act.
| Task | Model | Rough tokens | API-rate cost |
|---|---|---|---|
| Explain a file you paste in | Sonnet 5 | 8k in / 1k out | $0.04 |
| Fix a failing test you already located | Sonnet 5 | 30k in / 4k out | $0.15 |
| Add a small feature across 3 files | Sonnet 5 | 120k in / 15k out | $0.59 |
| Same feature, exploring an unfamiliar repo | Sonnet 5 | 400k in / 25k out | $1.58 |
| Refactor a module, 12 files touched | Sonnet 5 | 900k in / 60k out | $3.60 |
| Same refactor on the biggest model | Opus 5 | 900k in / 60k out | $6.00 |
| Mechanical edit across many files | Haiku 4.5 | 200k in / 40k out | $0.40 |
| Long autonomous run, large repo, many tool calls | Opus 5 | 4M in / 200k out | $25.00 |
Why the range is so wide
Three variables, in order of how much they move the number:
- Model. Opus 5 output is $25 per million against Sonnet 5 at $15 and Haiku 4.5 at $5. Same task, three prices, and for a large class of work the cheaper models finish it correctly. Anthropic's own guidance is to reserve Opus for complex architectural decisions and multi-step reasoning.
- Context re-sent per turn. An agent loop sends the accumulated conversation again on every turn, and every tool result triggers another request carrying that whole batch. A 30-turn session does not send context once, it sends a growing prefix thirty times. This is the term people forget, and it is why cost grows roughly with the square of turn count.
- Turn count, which is driven by how well specified the task was. A vague prompt that sends the agent exploring costs multiples of a precise one that names the files.
The arithmetic that decides your plan
Take your realistic weekly pattern, price it at API rates, and compare against the flat fee. The crossover points are unambiguous.
Break-even against each tier, at the API-rate equivalents above.
| If your month looks like | API-rate cost | Cheapest option |
|---|---|---|
| A handful of small fixes a week | Under $15 | API, or Pro if you also use Claude chat |
| An hour of agent work most days | $40 to $90 | Pro at $20, if you can live with the window |
| The published average developer day | $150 to $250 | Max 5x at $100 |
| Several hours a day, Sonnet first | $150 to $400 | Max 5x at $100 |
| All-day work, Opus heavy, parallel sessions | $600 to $2,000+ | Max 20x at $200 |
| Bursty: nothing for weeks, then a heavy project | Highly variable | API, or one month of Max |
| Scripted or CI runs on a schedule | Whatever it is | API. Subscriptions are for interactive use |
The pattern is that subscriptions win decisively for anyone who codes with an agent most days, and the API wins for everyone whose usage is spiky, low, or programmatic. The middle is thin.
Where the money actually goes
When people finally look at a breakdown, the same four surprises come up.
Reading costs more than writing
Output tokens are priced five times higher than input, so intuition says output dominates. It does not. A coding agent reads far more than it writes: file contents, command output, test logs, search results. A typical session is 90 to 97 percent input tokens. Even at a fifth of the price, that wins.
The consequence is that anything reducing what the agent reads is worth more than anything reducing what it writes. A precise prompt naming three files beats a vague one that greps the repo.
A few sessions dominate the month
Spend is not evenly distributed. In most months a small number of long, exploratory, Opus-driven sessions account for the majority of the total. To cut a bill, find those sessions rather than trimming everything uniformly.
Cache misses are a real line item
Anthropic documents the mechanism directly: your first message after a break longer than the cache lifetime misses the cache and reprocesses your full context at full input price. The lifetime is an hour on a subscription and five minutes by default on an API key or a cloud provider. Leaving a large session open over lunch and then asking one more question is a genuinely expensive habit on a key.
Tool output is a cost you control
Every command the agent runs returns output that becomes input tokens on the next turn. An agent that runs a full test suite and reads 4,000 lines of output has paid for 4,000 lines of output. Scoping test runs to the relevant file is a direct, measurable saving, and a PreToolUse hook that filters test output to failures only turns tens of thousands of tokens into hundreds.
Seeing your own number
Do not budget off this page. Measure a week of your own work, then decide.
Run /usage inside Claude Code
The Session block shows token counts and a locally computed dollar figure for the current session. On a paid plan the same screen adds usage bars plus an attribution breakdown by skill, subagent, plugin, and MCP server, and flags any behavior accounting for 10 percent or more of recent usage. Press d or w to toggle between the last 24 hours and the last 7 days.
/usage. Totals reset when /clear starts a new session.Total cost: $0.55
Total duration (API): 6m 20s
Total duration (wall): 6h 33m 10s
Total code changes: 0 lines added, 0 lines removed
Usage by model:
claude-sonnet-4-6: 1.2k input, 5.3k output, 940.0k cache read, 50.0k cache write ($0.55)
Check what is in your context
Run /context for a live breakdown by category, including which CLAUDE.md and memory files loaded. Anything sitting there permanently is a cost you pay on every turn of every session.
Confirm which credential is actually billing
Run /status. A stray ANTHROPIC_API_KEY in your environment silently routes subscription work onto a metered key, which is the single most common way people discover an invoice they did not expect.
echo "$ANTHROPIC_API_KEY" # empty means subscription billing
unset ANTHROPIC_API_KEY # for shells where you want the subscription
Aggregate across days and repos
The /usage figures are approximate and computed from local session history on that one machine, so a second laptop or claude.ai usage is not included. For a real monthly number you need something that reads the session files across machines and prices them at event time.
Cutting the number without cutting the work
- Default to Sonnet, escalate deliberately. The single biggest lever. Use
/modelto switch mid-session when a task turns out to be hard, andmodel: haikufor simple subagents. - Name the files. Every turn the agent spends locating something is a turn you pay for. "Fix the retry logic in
client/http.ts" is measurably cheaper than "fix the retry bug". - Run
/clearbetween unrelated tasks. Context carries forward. Asking a new question in a session with 200k tokens of unrelated history pays for that history on every subsequent turn, and makes the answer worse. - Scope what commands return. Run the one test file, not the suite. A
PreToolUsehook that greps test output for failures cuts a 10,000-line log to a handful of lines before the model ever sees it. - Move instructions out of CLAUDE.md into skills. CLAUDE.md loads at session start and is present even for unrelated work; skills load on demand. Anthropic's guidance is to keep CLAUDE.md under 200 lines.
- Turn extended thinking down for simple work. Thinking tokens bill as output. Lower the effort level with
/effort, or setMAX_THINKING_TOKENSon models with a fixed budget. - Delegate verbose reads to subagents. The log stays in the subagent context; only the summary comes back into yours.
- Use plan mode for anything large. Agreeing the approach before edits prevents the expensive failure: a long confident run in the wrong direction that you then pay to undo.
Applied together these routinely halve a bill without changing what gets built. The first three are worth more than the rest combined.
Questions people ask
On a subscription, $20 for Pro, $100 for Max 5x, or $200 for Max 20x, flat. On metered API billing Anthropic reports an average of $150 to $250 per developer per month across enterprise deployments, or about $13 per developer per active day, with 90 percent of users under $30 per active day (as of August 2026).
Not for real work. It ships with paid Claude plans starting at Pro at $20 a month, or you pay per token through the API. The free Claude.ai plan does not include Claude Code access, per Anthropic's setup docs as of August 2026.
Almost always because an agent loop re-sends the accumulated context on every turn, and every tool result triggers another request carrying that whole batch. A thirty-turn session sends a growing prefix thirty times, so cost grows closer to the square of turn count than to a straight line. Cache misses after a break add to it: the cache lifetime on an API key is five minutes by default.
No. It is included with Pro, Max, and the seat-based Team and Enterprise plans, and the allowance is shared with Claude chat and Cowork. The only extra is optional usage credits, which let you keep working past the included limit at standard API rates.
Haiku 4.5 at $1 input and $5 output per million tokens. It is genuinely good at mechanical, well-specified edits. Sonnet 5 is the sensible default for real work at $3 and $15 standard (on introductory pricing of $2 and $10 through 31 August 2026), and Opus 5 at $5 and $25 is worth it for hard reasoning rather than bulk.
Yes, in three places. On the API, set workspace spend limits in the Claude Console; Claude Code gets its own auto-created workspace on first sign-in. On Team and Enterprise, set usage-credit spend limits at the organization, group, or member level in the admin console. On Pro and Max, set a monthly spending cap on usage credits.
Run /usage inside Claude Code. The Session block shows token counts by model plus a dollar figure computed locally at list rates. Note that it resets on /clear, covers only that machine, and on a subscription no money actually moved.
Different shape rather than different price. Cursor and Copilot sell seats with request or premium-request allowances; Claude Code sells token headroom. At the $20 tier they are comparable; above it Claude Code on Max buys far more agent runtime than a seat upgrade elsewhere, and on an API key it can cost several times more than either.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.