How Claude Code Billing and Usage Limits Work in 2026

Quick answer. Claude Code is included in every paid Claude plan — Pro from $17/month, Max from $100/month — with usage metered by rolling five-hour and weekly windows rather than published token counts. Past the limit you either wait for the reset or turn on usage credits, which bill at standard API rates. Anthropic's June 2026 plan to meter scripted usage separately was cancelled.

Claude Code billing confuses people for a specific reason: the thing you pay for (a monthly subscription) and the thing that gets consumed (tokens) are measured in completely different units, and Anthropic deliberately does not publish the exchange rate. This page is the current reference on how the two connect — what each plan actually buys, where the limits sit, when the API is genuinely cheaper, and what happened to the June 15 change that a lot of coverage still describes as though it shipped.

Everything below was re-verified against Anthropic's own pricing and documentation on 31 August 2026.

What does Claude Code cost today?

There are two entirely separate ways to pay for Claude Code, and they do not mix on a single session.

Route one — a Claude subscription. You sign in with your claude.ai account and Claude Code draws on your plan's usage allowance. No per-token bill. Per claude.com/pricing:

PlanPriceClaude Code included?
Free$0No
Pro$17/mo billed annually ($200 up front), or $20/mo monthlyYes
MaxFrom $100/mo — choose 5× or 20× Pro's usageYes
Team$20–25 per seat/mo (Standard and Premium seats)Yes, plus Cowork
EnterpriseSeat price + usage at API ratesYes

Route two — an API key. You set ANTHROPIC_API_KEY and pay per token at list price, with no subscription involved. Current rates from Anthropic's pricing docs, per million tokens:

ModelInputOutputCache readCache write (5m / 1h)
Claude Fable 5$10$50$1$12.50 / $20
Claude Opus 5$5$25$0.50$6.25 / $10
Claude Sonnet 5$2$10$0.20$2.50 / $4
Claude Haiku 4.5$1$5$0.10$1.25 / $2

One rate change worth flagging, because a lot of published comparisons are now wrong on it: Sonnet 5's $2/$10 pricing was announced as introductory pricing due to expire on 31 August 2026, and Anthropic has confirmed it is now the standard price. The scheduled increase to $3/$15 will not happen. Sonnet 5 is permanently 2.5× cheaper than Opus 5 on both input and output.

Two more pricing facts that matter for a coding workload specifically. The full 1M-token context window is included at standard pricing on Claude 4.6 and later — a 900k-token request bills at the same per-token rate as a 9k one, with no long-context premium. And models from Claude 4.7 onward use a newer tokenizer that produces roughly 30% more tokens for the same text, so a token count measured on Sonnet 4.6 is not comparable to one measured on Opus 5.

Is Claude Code included in my Claude subscription?

Yes on every paid tier — but which models you get differs, and this is the single most under-reported part of Claude Code billing today. From Anthropic's model configuration docs:

PlanDefault modelModels available
Max, Team Premium, Enterprise, APIOpus 5Fable 5, Opus 5, Sonnet 5, Opus 4.8, Haiku
Pro, Team StandardSonnet 5Sonnet 5, Haiku — Opus 5 only with usage credits
Amazon Bedrock / Google CloudOpus 5Opus 5, Sonnet 4.5, Haiku
Microsoft FoundrySonnet 4.5Opus 4.6, Sonnet 4.5, Haiku

So a $20 Pro plan gets you Claude Code with Sonnet 5 as the daily driver. Reaching for Opus 5 on Pro triggers usage credits — metered spend at API rates, on top of the subscription. The same applies to Fable 5 on any plan (the model picker shows "Requires usage credits" and prompts for consent before spending), and to the 1M-token window for Opus on Pro. On Max, Team, and Enterprise, Opus and the 1M window are included in the allowance.

Your subscription allowance is also shared. Claude Code, claude.ai chat, and Cowork all draw from the same pool — a heavy afternoon in the browser eats into your terminal budget and vice versa.

Plan or API: which is cheaper for a real coding workload?

Anthropic publishes the number you need to run this calculation. Across enterprise deployments, Claude Code costs about $13 per developer per active day and $150–250 per developer per month, staying under $30 per active day for 90% of users. Those are metered API figures, which makes them a clean yardstick for what a subscription is worth.

Work the break-even from there. At $13 per active day:

You payBreak-evenVerdict
Pro, $20/mo~1.5 active days/monthPays for itself in a single afternoon of real use
Max, from $100/mo~7.7 active days/monthWins for anyone coding more than two days a week
API key, pay-as-you-goCheaper only below ~1.5 days/month, or when you need per-project cost attribution

A developer using Claude Code daily generates $150–250/month of API-list consumption. On a $100 Max plan that is roughly 1.5–2.5× the list value of the tokens — which is the honest reason the subscription exists and the honest reason limits exist alongside it.

The picture flips in three specific cases:

  • Genuinely occasional use. A few sessions a month is cheaper metered than on any subscription.
  • You need per-project or per-client cost attribution. Subscription usage is not metered in dollars, so there is nothing to allocate. API and cloud-provider billing gives you a per-token trail.
  • CI and automation. This is the one to watch. Scripted runs are still billed against your subscription today, but Claude Code's recommended mode for scripts, --bare, explicitly does not use your subscription login — it never reads OAuth credentials or the keychain and requires ANTHROPIC_API_KEY. Anthropic's docs state --bare "will become the default for -p in a future release." When that lands, the default billing route for headless runs changes from subscription to API key without any pricing announcement at all.

What are Claude Code's usage limits right now?

Anthropic publishes the shape of the limits, not the token counts. Any article giving you a hard "X million tokens per week per plan" number invented it. What is documented:

WindowHow it worksShared with
SessionRolling five-hour windowclaude.ai chat and Cowork
WeeklyWeekly window, resets on your plan's scheduleclaude.ai chat and Cowork
Per-model (Opus / Sonnet)Separate weekly limits per model familySame pool, model-scoped

On Team and Enterprise plans the same two windows apply as a per-seat allowance, sized by seat tier (Standard or Premium). Where you see your own numbers: run /usage in Claude Code, or open Settings → Usage on claude.ai, both of which show progress bars for the five-hour session and the weekly window.

The /usage breakdown is worth knowing about. It attributes recent usage to individual skills, subagents, plugins, and MCP servers as percentages, flags behaviours accounting for 10%+ of consumption (long context, cache misses), and lists your heaviest scheduled tasks by total tokens. That is the fastest way to find out what is actually eating your allowance.

What happens when you hit a limit?

Claude Code shows one of four messages, and the difference between them determines your recovery move:

  • "You've hit your session limit" / "You've hit your weekly limit" — a seat-based window, shared across all models. Switching model with /model does not restore access. The message tells you when the window resets.
  • "You've hit your Opus limit" / "You've hit your Sonnet limit" — model-family specific. Switching to a model outside that family does keep you working. This is the single most useful distinction to internalise.

Three ways forward:

  1. Wait for the reset. On Claude Code v2.1.234+, the CLI can wait and automatically continue the interrupted task once the window resets — either on its own or via /rate-limit-options.
  2. Turn on usage credits. Run /usage-credits. Usage past your plan limit then bills at standard API rates, with an optional monthly spend cap and a $2,000 daily redemption limit. Available on Pro, Max 5x and Max 20x; Team and Enterprise admins enable it org-wide with per-group or per-member spend limits.
  3. Move up a tier, if you are hitting the wall every week.

One catch worth planning for: the moment you start drawing on usage credits, your prompt-cache TTL drops from one hour to five minutes, because you are now being billed for that usage. That makes an already-expensive mode more expensive on every pause longer than five minutes. You can override it — see below.

For everything that isn't a billing limit — 429s, auth failures, /doctor checks — see our Claude Code common errors and troubleshooting guide.

How do you reduce your Claude Code burn?

Six levers, ordered by how much they actually move the number.

1. Protect the prompt cache — this is the whole game. Claude Code re-sends your full conversation on every turn; caching is what stops that from costing full price each time. A cache read bills at 10% of the standard input rate. On Opus 5, a session running at a 91% cache hit rate (the figure in Anthropic's own /usage example output) has an effective blended input rate of about $0.91 per million tokens instead of $5 — roughly an 82% reduction, calculated as (0.91 × $0.50) + (0.09 × $5.00).

The cache is a prefix match, so a change anywhere near the front of the request recomputes everything after it. Actions that invalidate it mid-session: switching model, changing effort level, turning on fast mode, connecting or disconnecting a non-deferred MCP server, adding a bare tool-name deny rule, running /compact, and upgrading Claude Code. Actions that keep it: editing files, invoking skills and commands, changing permission mode, /recap, and /rewind. Pick your model and effort at the top of a session and leave them alone. Our prompt caching cost guide covers the underlying mechanism.

2. Set the cache TTL explicitly if you're on an API key or usage credits. On a subscription within your plan allowance, your main conversation gets a one-hour TTL. On an API key, a cloud provider, or once you're spending usage credits, it defaults to five minutes. Set promptCacheTtl to 1h (or CLAUDE_CODE_PROMPT_CACHE_TTL=1h) to buy back the hour. Subagents sit in a separate bucket that defaults to five minutes even on a subscription — subagentPromptCacheTtl controls that one. Both need v2.1.242+.

3. Match the model to the job. Opus 5 is 2.5× Sonnet 5's rate on input and output; Haiku 4.5 is half Sonnet again. Sonnet handles most coding work. Use opusplan to get Opus for planning and Sonnet for execution automatically — but note that toggling plan mode under opusplan is a model switch, so it starts a fresh cache each time.

4. Turn effort down where it doesn't buy anything. Effort defaults to high, and thinking tokens bill as output. The ladder runs lowmediumhighxhighmax, with max showing diminishing returns and a tendency to overthink. Set it with /effort at session start.

5. Clear between unrelated tasks. /clear costs nothing and resets the context. /compact is a large request in its own right — it re-reads the conversation it is summarising — so run it at natural breaks rather than letting auto-compaction fire mid-task.

6. Watch the multipliers. Agent teams use roughly 7× the tokens of a standard session when teammates run in plan mode, since each maintains its own context window. Scheduled tasks and cross-session messages fire on their interval and send your full context even while the session sits idle. Prefer CLI tools (gh, aws) over MCP servers where both exist, and move rarely-needed CLAUDE.md content into skills that load on demand.

What happened to Anthropic's June 15 billing change?

This is the history that explains the current state, and it is still widely misreported. The timeline:

DateWhat happened
14 May 2026Anthropic announces that Claude Agent SDK, claude -p, Claude Code GitHub Actions, and third-party apps authenticating via the Agent SDK will move off subscription limits and onto a separate dollar-denominated monthly credit, metered at API list prices.
Early June 2026Claim emails go out to eligible users for the announced credit.
15 June 2026Anthropic cancels the change on the day it was due to take effect.
31 August 2026Still cancelled. Nothing comparable has replaced it.

Anthropic's Help Center article on using the Agent SDK with your Claude plan is unambiguous, and still reads the same way today: "We're pausing the changes to Claude Agent SDK usage described below. For now, nothing has changed: Claude Agent SDK, claude -p, and third-party app usage still draw from your subscription's usage limits." The article adds that the previously announced monthly credit "isn't available."

So: no separate meter for programmatic usage exists today, and no equivalent has shipped in the two and a half months since. Programmatic Claude Code usage draws on exactly the same allowance as your interactive terminal work.

What did happen instead is more interesting, and it is why this history still matters. Rather than a single credit pool for programmatic usage, Anthropic put usage credits behind specific capabilities — Opus 5 on Pro, Fable 5 on any plan, the 1M-token window on Pro and Team Standard. The metered-overflow idea survived; it was applied per-capability rather than per-execution-mode. And the --bare default change flagged earlier will, when it lands, move headless runs to API-key billing as a side effect of an authentication default rather than a billing announcement. Neither is the June 15 change, but both point the same direction: the line between "included in your plan" and "metered at API rates" keeps moving, and it moves through product defaults rather than press releases.

The consumer-side counterpart to this story — how usage credits work for chat, Projects, and Research on Pro and Max — is covered in our companion piece on Claude usage credits. For what Opus 5 changed on the model side, see the Claude Opus 5 launch guide.

How does Claude Code pricing compare to Codex, Cursor, and Copilot?

Headline prices are the least useful part of this comparison, because all four vendors meter in a different unit. Prices below are from each vendor's own pricing page.

ToolEntry paidHigher individual tiersTeamMetering unit
Claude CodePro $17–20/moMax from $100/mo (5× / 20× Pro)Team $20–25/seatRolling 5-hour + weekly windows, then usage credits at API rates
OpenAI CodexGo $8/mo, Plus $20/moPro $100–200/mo (5× / 20× Plus)Business $20/user/mo annualLocal messages per 5-hour window, then credits
CursorPro $20/moPro+ (3× Pro agent limits), Ultra (20× Pro)Teams $40/user/moIncluded model usage, then on-demand billed in arrears
GitHub CopilotPro $10/moPro+ $39/mo, Max $100/moBusiness $19/seat, Enterprise $39/seatMonthly AI credits

Three things fall out of that table that a price-only comparison misses.

Claude Code and Codex have converged on the same structure. Both sell a ~$20 entry tier and a top tier at $100–200 offering "5× or 20×" the entry allowance, and both meter on a rolling five-hour window. Codex publishes message counts per window (Plus: 10–2,000 depending on model; Pro: 50–40,000), where Anthropic publishes only the window. Codex's numbers look more transparent, but a "message" spans a 400× range across models, so it is not a directly usable budget either.

Copilot is the only one that gives you a countable monthly number. Pro is 1,500 AI credits/month (1,000 base + 500 flex), Pro+ 7,000, Max 20,000, Business 1,900 per user, Enterprise 3,900 per user. If your organisation needs to forecast spend on a spreadsheet, that is a real advantage — separate from any judgement about output quality.

Cursor is the cheapest way to run multiple model vendors, since it bundles frontier model access and bills overage in arrears. But that is also the model with the least predictable monthly bill, because on-demand usage has no window to hide behind.

On cost per unit of agentic work specifically, Claude Code's advantage is structural rather than headline: prompt caching is aggressive and automatic, the 1M context window carries no premium, and Sonnet 5 at $2/$10 is now permanently priced below where Sonnet 4.6 sits. The disadvantage is equally structural — you cannot see, in advance, how much work your plan buys.

Companion guide

For how Claude Code compares to Cursor, Codex, Aider and the rest of the field on capability rather than price — agent loops, tool use, and where each one fits — see our AI coding agents complete guide for 2026.

Which billing setup should you actually pick?

A decision rule rather than a recommendation:

  • Coding most days, one person: Max. The break-even is under eight active days a month, and you get Opus 5 and the 1M window inside the allowance instead of on credits.
  • Coding a couple of days a week: Pro, and stay on Sonnet 5. It clears its cost in an afternoon. Add usage credits with a monthly cap rather than upgrading, and watch whether the cap gets hit two months running before you move.
  • A team that needs cost attribution: API key or a cloud provider, with OpenTelemetry export — it is the only route that gives per-user token and cost metrics in your own observability stack regardless of provider.
  • CI and automation: use a dedicated API key today rather than a subscription seat. It is billable, attributable, and it is where the --bare default is heading anyway.

Whichever route you take, run /usage once a week for a month before changing anything. The attribution breakdown will usually tell you that one MCP server, one scheduled task, or one never-cleared session is responsible for a disproportionate share — and fixing that is cheaper than upgrading.

FAQ

How much does Claude Code cost?

It is included in every paid Claude plan: Pro at $17/month billed annually or $20/month monthly, Max from $100/month with 5× or 20× Pro's usage, and Team at $20–25 per seat. You can also skip the subscription and pay per token with an API key. Anthropic reports that metered Claude Code usage averages about $13 per developer per active day, or $150–250 per developer per month.

Is Claude Code included in my Claude subscription?

Yes on Pro, Max, Team and Enterprise — not on Free. Which models you get differs: Max, Team Premium and Enterprise default to Opus 5 with Fable 5, Sonnet 5 and Haiku available. Pro and Team Standard default to Sonnet 5, and reaching for Opus 5 there requires usage credits billed at API rates on top of the subscription.

What are Claude Code's usage limits?

Two windows — a rolling five-hour session limit and a weekly limit — plus separate weekly limits per model family for Opus and Sonnet. All of them are shared with claude.ai chat and Cowork. Anthropic publishes the windows but not absolute token counts, so check your own consumption with /usage in Claude Code or Settings → Usage on claude.ai.

What happened to Anthropic's June 15 billing change?

It was cancelled on the day it was due to take effect. The plan, announced 14 May 2026, would have moved Agent SDK, claude -p, GitHub Actions and third-party app usage onto a separate dollar credit at API rates. Anthropic's Help Center confirms nothing changed and the announced credit isn't available. As of 31 August 2026 no comparable change has shipped.

Is the API cheaper than a Claude plan for coding?

Rarely, if you code regularly. At Anthropic's own $13-per-active-day average, Pro breaks even at about 1.5 active days a month and Max at about 7.7. The API wins in three cases: genuinely occasional use, when you need per-project cost attribution that subscription usage cannot provide, and for CI or automation you want billed and tracked separately from a human seat.

How do I reduce my Claude Code usage?

Protect the prompt cache first — a cache read costs 10% of standard input, so a high hit rate can cut effective input cost by around 80%. Don't switch model or effort mid-session, both of which invalidate it. Then: use Sonnet instead of Opus where it suffices, drop effort below the high default, /clear between unrelated tasks, and check /usage attribution for a runaway MCP server or scheduled task.

Does Claude Code work with an API key instead of a subscription?

Yes. Set ANTHROPIC_API_KEY and Claude Code bills per token at list rates with no plan limits. Note that --bare mode, recommended for scripts and CI, never reads OAuth credentials or the system keychain and therefore requires an API key. Anthropic's docs state --bare will become the default for -p in a future release.

What happens to prompt caching when I run out of plan usage?

Your main conversation's cache TTL drops from one hour to five minutes the moment you start drawing on usage credits, because that usage is now billed. Any pause longer than five minutes then reprocesses your full context at full input price. Set promptCacheTtl to 1h, or the CLAUDE_CODE_PROMPT_CACHE_TTL environment variable, to keep the hour. Requires Claude Code v2.1.242 or later.