There are two ways to pay for Claude Code. A Claude subscription (Pro, Max, Ultra, Team, Enterprise) includes it. Its usage limits reset on a rolling five-hour window, and a weekly cap sits on top. An API key, through the Claude Console or a cloud provider, bills every token at list price. The only ceilings are the ones you set. Anthropic publishes averages for API use, and they are the best starting point for a budget. All prices and limits below are as of October 2026.
| Figure (Anthropic, "Manage costs effectively") | Value |
|---|---|
| Average cost per developer per active day, enterprise deployments | around $13 |
| Average cost per developer per month | $150–250 |
| Share of users under $30 per active day | 90% |
| Background token use per session, with no interaction | typically under $0.04 |
| Agent teams versus a standard session | approximately 7x more tokens, with teammates in plan mode |
Source for every row: Manage costs effectively. The same page adds that per-developer costs "vary widely based on model selection, codebase size, and usage patterns such as running multiple instances or automation." An older "$6 per developer per day" figure still circulates in blog posts. It is not on the current page. The old URL now redirects, so we could not confirm it was ever there. Plan with the $13 figure.
Subscription plans
Anthropic's pricing page says "Claude Code is included in all paid plans". It adds that Claude Code "shares the same usage limits as the rest of your plan." Limits "reset on a rolling five-hour session window, and paid plans add weekly limits on top."
| Plan | Price | Usage, as Anthropic describes it | Claude Code |
|---|---|---|---|
| Pro | $20/month, or $17/month billed annually | "More usage than Free"; at least 5x Free per session at peak; roughly 45 short messages per five hours | Included |
| Max | $100/month | "5x Pro usage every 5 hours and every week"; help centre: at least 225 messages per five hours | Included |
| $200 tier | $200/month | Pricing page: "10x Pro usage every week", "No 5-hour limit". Help centre: "20x more usage per session than Pro", at least 900 messages per five hours | Included |
| Team Standard | $20/seat/month annual, $25 monthly | "more usage than Pro"; per-seat five-hour and weekly windows | Included on every seat |
| Team Premium | $100/seat/month annual, $125 monthly | "5x more usage than standard seats" | Included on every seat |
| Enterprise | $20/seat/month annual, 20-seat minimum; usage billed at API rates on top | Per-seat windows on seat-based plans; usage-based plans have no per-seat limits | Included |
The $200 tier goes by two names. The pricing page calls it "Ultra". The help centre still calls it "Max 20x" and gives a different multiplier (20x per session rather than 10x per week). Both are official Anthropic pages, fetched on the same day. Because they disagree, the multiplier that applies today is not settled. A post from the @claudeai account on 30 October 2026 explains the gap. The Max 20x plan was renamed Ultra and prices are unchanged. The five-hour limit is being removed for verified Ultra accounts.
We're renaming our Max plans: Max 5x → Max Max 20x → Ultra Max is still $100/month, and Ultra is still $200. If you're a subscriber, there's nothing you need to do. We're also removing the 5-hour limit for verified Ultra accounts, starting today with most existing subscribers. New…
— Claude (@claudeai) October 30, 2026
Three details affect cost. First, Claude chat and Claude Code share the limits (and so does Cowork on Team and Enterprise seats). A long chat session eats into the terminal budget. Second, the message "You've hit your session limit" refers to a seat-based window shared across all models. Switching with /model does not restore access. Only the model-specific "You've hit your Opus limit" can be worked around by moving to another model family. Third, Pro, Max, Team and Enterprise default to Opus 5.5, the most expensive of the three everyday models.
Every paid plan can turn on usage credits for work past the limit (older pages say "extra usage"). Credits are "billed at standard API rates" and cover both chat and Claude Code. Settings holds a monthly spending cap, auto-reload and alerts, and /usage-credits opens it from the terminal. Team owners set caps for the whole organisation, per seat group and per member. A member who reaches a cap has credits paused until the end of the month. Once Claude Code draws on credits, it drops the main conversation from the one-hour to the five-minute cache lifetime. It does so because you now pay per token.
API billing
On an API key, "Claude Code charges by API token consumption." The three models Claude Code resolves its aliases to (opus, sonnet, haiku) are priced per million tokens as follows.
| Model | Input | Cache write, 5 min | Cache write, 1 hour | Cache read | Output |
|---|---|---|---|---|---|
| Opus 5.5 | $4 | $5 | $8 | $0.20 | $20 |
| Sonnet 5.5 | $2 | $2.50 | $4 | $0.10 | $10 |
| Haiku 5.5, prompt up to 100k tokens | $0.10 | $0.125 | $0.20 | $0.01 | $0.50 |
| Haiku 5.5, prompt over 100k tokens | $0.50 | $0.625 | $1 | $0.05 | $2.50 |
A cache read costs 0.05x the input price on Opus 5.5 and Sonnet 5.5, and 0.1x on Haiku 5.5. Thinking tokens are billed as output. None of these three models lets you turn thinking off. Opus and Sonnet 5.5 bill the full 1M context at the standard rate; Haiku 5.5 moves to the higher row once a prompt passes 100k tokens. The October 2026 pricing snapshot has the rest of the price list.
How caching applies in Claude Code
Claude Code sends the whole conversation on every request. Without caching, "the API would reprocess your full history on every turn." Caching changes how the request is laid out. Stable content goes first (system prompt and tool definitions, then CLAUDE.md and rules, then the conversation). The API re-reads the unchanged prefix at the cache rate and processes only the new part in full.
| Request type | Subscription, within plan limits | Usage credits, API key or cloud provider |
|---|---|---|
| Main conversation | One-hour cache lifetime | Five-minute cache lifetime |
| Subagents, compaction, titles and other helpers | Five minutes | Five minutes |
The one-hour lifetime charges more per write (2x input instead of 1.25x) but survives a coffee break. From Claude Code v2.1.242, promptCacheTtl and subagentPromptCacheTtl override both defaults. Each model keeps its own cache. A /model switch therefore re-reads the whole history uncached, and so does every opusplan hop between planning and execution. Compacting, turning on fast mode and upgrading Claude Code also invalidate the stored prefix. So does adding or removing an MCP server whose tools load upfront. Editing files, editing CLAUDE.md mid-session, changing permission mode, invoking skills and spawning a subagent leave it intact.
Worked example of one 40-turn session
The example rests on four assumptions. Each turn is one API request, and a tool-call round-trip counts as a turn. The context grows evenly from 20k tokens at turn 1 to 120k at turn 40, about 2.6k tokens per turn. Each turn produces 2k output tokens, thinking included. All requests fall within the five-minute cache lifetime (API-key billing). Across the 40 requests, the model processes 2.8M input tokens in total. Caching writes 120k of those tokens once; the remaining 2.68M are cache reads.
| Line | Sonnet 5.5, no cache | Sonnet 5.5, cached | Opus 5.5, no cache | Opus 5.5, cached |
|---|---|---|---|---|
| Uncached input | 2.8M × $2 = $5.60 | – | 2.8M × $4 = $11.20 | – |
| Cache write (5 min) | – | 0.12M × $2.50 = $0.30 | – | 0.12M × $5 = $0.60 |
| Cache read | – | 2.68M × $0.10 = $0.27 | – | 2.68M × $0.20 = $0.54 |
| Output, 80k tokens | $0.80 | $0.80 | $1.60 | $1.60 |
| Session total | $6.40 | $1.37 | $12.80 | $2.74 |
The arithmetic shows two things. Caching cuts the session bill by about 4.7x on both models. A cached Opus session ($2.74) also costs less than an uncached Sonnet session ($6.40). The one-hour lifetime raises the write rate from 1.25x to 2x input. That adds $0.18 on Sonnet and $0.36 on Opus. After any gap longer than the lifetime, the next request re-writes the full context. At turn 40 that is a 120k-token write, about $0.30 on Sonnet and $0.60 on Opus. This is why "/compact costs the most when you resume an old session."
The first cached block is slightly dearer than the second because it includes the initial 20k-token write. After that, the cached figure per block barely moves, while the uncached one climbs with every turn.
What drives the bill
The reasons below come from Anthropic's costs page, from its list of why usage climbs in a long session and from its tips section. One pattern sits behind all of them. Claude Code sends the whole context on every request.
- Long context: "a one-line question in a session that has been open all day still draws usage for the whole conversation."
- Cache misses: "your first message after a break longer than the cache lifetime misses the cache and reprocesses your full context."
- Large files and verbose tool output: reading a 10,000-line log pulls tens of thousands of tokens into context, and every later turn re-reads them.
- Subagents and workflows: "every subagent, and every agent a dynamic workflow spawns, sends its own requests on top of the main conversation's." A subagent starts cold, because its prefix differs from the parent's.
- Agent teammates: "each active teammate keeps consuming tokens until it exits", and teams use about 7x the tokens of a standard session when teammates run in plan mode.
- Compaction: "/compact reads the conversation it summarizes, so compacting a large context is itself a large request." By default Claude Code compacts when the conversation reaches the model's context limit, with a few per-model exceptions. Setting
autoCompactWindow(100k to 1M) changes that point. - Idle work: scheduled tasks, cross-session messages and goal check-ins each start a new turn with the full context while you are away.
- Thinking: billed as output, with a default budget that "can be tens of thousands of tokens per request depending on the model."
The same page gives a blunt admin-side diagnosis. Unexpectedly high spend on an API or cloud-provider plan "usually traces back to long sessions that were never cleared or to Opus left as the default model."
Keeping a month under budget
- Watch the numbers.
/usage(aliases/costand/stats) shows session tokens and cost at list price, plus the plan-limit breakdown. From v2.1.251 it also reports a "Prompt cache (main)" hit ratio. It attributes usage to skills, subagents and MCP servers, with suggestions such as "Trim ~/code/api/CLAUDE.md"./contextshows what fills the window. The--max-budget-usdflag in print mode (claude -p) stops the run once estimated spend reaches a dollar figure. - Set caps. Pro and Max: a monthly spending cap on usage credits. Team and seat-based Enterprise: caps organisation-wide, per seat group and per member. API: only the auto-created "Claude Code" Console workspace supports per-user monthly spend limits. It can also take a rate limit "to cap Claude Code's share and protect other production workloads." Organisation-wide limits always apply on top.
- Clear between tasks. "/clear costs nothing" and resets the counters. Run
/renamefirst so you can/resumelater. Give/compactan instruction such as "Focus on code samples and API usage". - Match the model to the task. "Sonnet handles most coding tasks well and costs less than Opus." Use
model: haikufor simple subagents. A switch to Opus also applies to subagents that inherit the session's model. - Keep CLAUDE.md under 200 lines and move specialised instructions into skills, which load only when invoked. Prefer CLI tools (
gh,aws,gcloud) over MCP servers, and disable servers you are not using with/mcp. - Keep noisy output out of context. Let hooks grep a log and return only matching lines; send test runs and documentation fetches to a subagent so only the summary comes back.
- Protect the cache. Do not switch models mid-session without a reason. On older models a change of effort level also resets the cache; on the 5.5 generation and Fable 5.1 it does not. Avoid
opusplanon API billing if you toggle plan mode often. Lower effort with/effortfor simple tasks. - Keep teams small, run teammates on Sonnet, and shut them down when their work is done.
Subscription versus API
The two billing routes suit different usage levels. The API column below is plain arithmetic on Anthropic's published averages. The subscription column lists the plans that include Claude Code at that level. Anthropic does not publish how many hours of Opus or Sonnet a plan's limits cover, so the comparison stops at prices.
| Usage level | API-key estimate | Subscription options | What tips the choice |
|---|---|---|---|
| Light: a few sessions a week, about 5 active days a month | 5 × $13 = $65 at the average day; one cached 40-turn Sonnet session is about $1.37 | Pro $20 | API wins only if sessions are short and cached; otherwise Pro is the floor |
| Daily: 20 active days a month | 20 × $13 = $260 at the average; 20 × $30 = $600 at the $30 day that 90% of users stay under | Max $100, Ultra $200 | A subscription is cheaper than the average API month if its limits hold for your workload; usage credits cover the overflow at API rates |
| Heavy: parallel sessions, agent teams, automation | 7x tokens for agent teams makes the $13 average meaningless; measure with /usage |
Ultra $200 plus usage credits, or API with a workspace spend limit | API gives per-user caps in the Claude Code workspace; OpenTelemetry metrics work on either; a plan gives a predictable base |
| Team of developers | Anthropic's enterprise average: $150–250 per developer per month | Team Standard $20–25/seat, Premium $100–125/seat, Enterprise $20/seat plus API-rate usage | Seat plans bundle chat and Cowork; the API route needs the Console workspace for cost attribution |
API versus subscription covers the general version of this question. For Claude Code, one fact decides it. Opus 5.5 is the default model on every plan and on the Anthropic API. A subscriber pays nothing extra for that default until the limit. An API user pays double Sonnet's rate from the first token.
Other coding agents
| Tool | Plans and prices | Notes | Source |
|---|---|---|---|
| Claude Code | Pro $20, Max $100, Ultra $200, Team $20–125/seat, Enterprise $20/seat plus usage; or API per token | Five-hour and weekly windows; usage credits at API rates | claude.com/pricing |
| OpenAI Codex | Included in ChatGPT Free, Go, Plus, Pro, Business and Enterprise; press reports Plus $20, Pro $100 (5x) and $200 (20x) | Five-hour window, weekly limits may apply; Business and new Enterprise moved to token-style credit pricing from 2 April 2026; the dollar amounts did not render on OpenAI's own pricing page | Codex pricing, MacRumors, 9 Apr 2026 |
| Cursor | Plus $8, Premium $30 (4x), Super $100 (15x), Ultra $200 (50x); Teams $30, $100 or $200 per seat | Third-party models (Claude, GPT, Gemini) billed at API list price from prepaid credit on Premium and above; Teams add $0.25/M | Cursor pricing |
| Gemini CLI | Free with a Google account: 1,000 model requests per user per day; AI Pro 1,500; AI Ultra 2,000 | "Gemini CLI was replaced by Antigravity CLI on June 18th, 2026" for the unpaid tier and Google One users; unpaid API key: 250 requests per day, Flash only | Quota and pricing |
| GitHub Copilot | Pro $10 (1,500 AI credits), Pro+ $39 (7,000), Max $100 (20,000), Business $19/seat (1,900 pooled), Enterprise $39/seat (3,900 pooled) | Overage $0.01 per AI credit on Business and Enterprise; "All plans include Copilot CLI" | Copilot plans |
A fuller comparison of the IDE and agent tools is in the cost-efficient coding IDE guide. The budget guardrails for agents in general, including loops and parallel runs, are in how not to overspend with AI agents.
What to do next
- Run
/usageat the end of your next three sessions and note the cache hit ratio and the cost line. Those figures make a better baseline than the $13 average. - If you are on an API key, open the Console, find the "Claude Code" workspace and set a monthly spend limit and a per-user limit before anyone else joins.
- Change the default model to Sonnet 5.5 in
/configand switch to Opus with/modelonly for the tasks that need it. - Trim CLAUDE.md to the essentials and move the rest into skills; check the result with
/context. - If the bill is still unclear after a month, we audit Claude Code and agent spend as part of a wider LLM cost audit.