Claude Code cost: how billing works and how to track spend per developer
Claude Code cost depends on which credential a developer signs in with: a Claude subscription covers Claude Code up to the plan's usage limits, while a Claude Console API key, Amazon Bedrock, Google Cloud, or Microsoft Foundry bills every token. Within any of those routes, the same task can cost very different amounts depending on the model, the size of the context Claude Code carries, and how often that context is re-sent.
This guide covers each billing route, the mechanisms behind token use, the built-in usage tools, ways to cut spend, and per-developer tracking with an AI gateway. Prices and plan limits are as Anthropic listed them in November 2026 and change often, so confirm them on the linked pages before you budget. For the wider category of tools, see our AI coding agents hub.
How much does Claude Code cost?#
As of November 2026, Claude Code costs $20 a month on Claude Pro, $100 on Max, and $200 on Ultra, and Team seats start at $20 per seat per month billed annually. API keys and cloud providers bill per token instead, and Anthropic reports that enterprise deployments average about $13 per developer per active day.
That average comes from Anthropic's Claude Code cost documentation, checked on November 16, 2026, which also puts monthly spend at $150 to $250 per developer and says 90% of users stay below $30 per active day. Spend varies with model choice, codebase size, and automation, so Anthropic recommends a small pilot group to set a baseline before a wider rollout.
A budget therefore has two parts: the fixed price of a plan or seat, and the variable cost of tokens beyond what the plan includes.
How Claude Code is billed#
Claude Code is billed through one of three routes. A Claude subscription draws on plan usage limits that reset every five hours and every week. A Claude Console API key bills each token at API rates. Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry bill tokens to your cloud account at the cloud provider's prices.
| Billing route | How you pay | What it meters | Where you see spend | Where you cap spend |
|---|---|---|---|---|
| Pro, Max, or Ultra subscription | Monthly plan price | Share of five-hour and weekly usage limits; optional usage credits at API rates past the limit | /usage, claude.ai Settings > Usage |
Plan limits; a monthly spend limit on usage credits |
| Team plan | Price per Standard or Premium seat | Per-seat allowance shared with chat and Cowork; usage credits past it | Spend report in org analytics | Spend limits per organization, group, or member |
| Enterprise, usage-based | Seat fee plus usage at API rates | Tokens at API rates, no per-seat usage cap | Org analytics, Enterprise Analytics API | Admin spend limits per user and organization |
| Claude Console API key | Prepaid or invoiced API usage | Input, output, cache-write, and cache-read tokens | Console Cost page, Claude Code dashboard | Workspace spend limits and rate limits |
| Bedrock, Agent Platform, or Foundry | Your cloud bill | Tokens at the cloud provider's prices | Cloud billing console | Cloud budget controls |
If an organization mixes sign-in methods, each developer is metered according to the method they authenticated with, so the credential on each machine is the first thing to check when a bill looks wrong.
Subscription plans that include Claude Code#
Claude Code is included in every paid Claude plan, and the Free plan does not include it. Terminal sessions, IDE sessions, and chats draw from one usage pool, so a long coding day also reduces what is left for chat. Anthropic's pricing page listed these plans on November 16, 2026:
| Plan | Price | Usage | Notes |
|---|---|---|---|
| Pro | $20 per month, or $17 per month billed annually ($200 up front) | Baseline | Fable models paid with usage credits |
| Max | $100 per month | 5x Pro, every five hours and every week | Fable up to half the weekly limit; $100 per month in Claude Platform API credits |
| Ultra | $200 per month | 10x Pro weekly; no five-hour limit for verified accounts | $200 per month in Claude Platform API credits |
| Team Standard | $25 per seat per month, or $20 billed annually | More than Pro | 2 to 150 seats; Claude Code and Cowork included |
| Team Premium | $125 per seat per month, or $100 billed annually | 5x a Standard seat | Seat types can be mixed |
| Enterprise | $20 per seat per month billed annually, 20-seat minimum, plus usage at API rates | Usage-based | Admin spend limits, SCIM, audit logs |
At a limit, a subscriber can wait for the reset, move to a larger plan, or turn on usage credits, which bill further work at standard API rates. The /usage-credits command opens those settings from Claude Code, or sends a request to an admin for Team and Enterprise members without billing access.
Claude Code Enterprise and Team seats#
On Team plans, each member's Claude Code usage draws from a per-seat allowance that resets on a rolling five-hour window and a weekly window, and the allowance is shared with Claude chat and Cowork. Admins can turn on usage credits and set spend limits per organization, group, or member. Anthropic's support article on Team and Enterprise seats says new and self-serve Enterprise plans include Claude Code with a single seat type and have no per-seat usage limits; usage is billed at API rates instead. Older seat-based Enterprise plans keep included allowances.
The monthly API credits that come with a Team plan cannot be spent in Claude Code, according to the same support article. The org spend report also shows dollars for usage-credit spend only, because usage inside a seat allowance is not metered in dollars.
Pay-as-you-go API usage through the Claude Console#
A Claude Console API key bills every request at API rates, with no plan limits. Each request is metered in four token types: base input, cache writes, cache reads, and output. On November 16, 2026, Anthropic listed these prices per million tokens for its current models:
| Model | Input | 5-minute cache write | 1-hour cache write | Cache read | Output |
|---|---|---|---|---|---|
| Claude Fable 5.2 | $8 | $10 | $16 | $0.20 | $40 |
| Claude Opus 5.5 | $4 | $5 | $8 | $0.20 | $20 |
| Claude Sonnet 5.5 | $2 | $2.50 | $4 | $0.10 | $10 |
| Claude Haiku 5.5, prompts up to 100,000 tokens | $0.10 | $0.125 | $0.20 | $0.01 | $0.50 |
Haiku 5.5 prompts over 100,000 tokens cost $0.50 input and $2.50 output per million. US-only inference multiplies every token category by 1.1, and fast mode on Claude Opus 5.5 costs $8 input and $40 output per million. Output costs five times input on each model here, and extended thinking tokens bill as output, so reasoning settings matter as much as context size.
When a developer first signs in to Claude Code with a Console account, Anthropic creates a workspace called Claude Code that holds the organization's Claude Code usage. Claude Code mints a per-user API key there at sign-in, and Anthropic's workspaces documentation says it is the only Console workspace that supports per-user monthly spend limits.
Amazon Bedrock, Google Cloud, and Microsoft Foundry#
Setting CLAUDE_CODE_USE_BEDROCK=1, CLAUDE_CODE_USE_VERTEX=1, or CLAUDE_CODE_USE_FOUNDRY=1 sends Claude Code's requests to Amazon Bedrock, Google Cloud's Agent Platform (formerly Vertex AI), or Microsoft Foundry, and the cloud provider bills the tokens at its own prices. Anthropic's pricing docs note that regional and multi-region endpoints on Bedrock and Google Cloud carry a 10% premium over global endpoints for Claude 4.5 models and later.
Claude Code does not send cloud-provider usage back to Anthropic, so the Console dashboard and the Claude Code Analytics API do not cover it. Per-developer attribution on these routes needs OpenTelemetry, Anthropic's self-hosted Claude apps gateway, or another LLM gateway. The Bedrock setup page also warns that an unpinned primary model defaults to Opus and bills at Opus rates, and it suggests a dedicated AWS account for Claude Code to simplify cost tracking.
Which credential gets billed#
Claude Code picks one credential when several are present, and that choice decides who pays. Cloud provider variables rank first, followed by ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, and an apiKeyHelper script, and a subscription login from /login ranks last, per the authentication docs. A Max subscriber with a stray ANTHROPIC_API_KEY in their shell is billed at API rates once they approve the key. Running /status shows which credential is active.
What drives token use in Claude Code#
Claude Code token use grows with the context it re-sends. Every request carries the system prompt, tool definitions, CLAUDE.md, and the full conversation, including every file and tool result read so far. Model choice, extended thinking, subagents, and long or idle sessions multiply that base, and prompt caching discounts the repeated part only while the cache stays warm.
Context size and repeated file reads#
The model keeps no memory between requests, so Claude Code re-sends the entire context each time, and each round of tool calls adds another request carrying the new results. A file read early in a session is billed again on every later request, at the cache-read rate when the cache is warm, until the conversation is cleared or compacted. Near the limit of the context window, Claude Code runs automatic compaction. A broad request to improve a codebase triggers wide scanning; naming the file and function keeps reads small.
Tool output#
Test runs, build logs, and command output enter the context in full unless something trims them first. The cost guide shows a PreToolUse hook that keeps only the last 100 lines of test output, and suggests hooks that filter a large log for error lines before Claude reads it, which can shrink tens of thousands of tokens to hundreds.
Subagents and agent teams#
A subagent runs in its own context window and sends its own requests, which count toward the same plan limits or API bill as the main conversation. Delegating a verbose job keeps the main context small because only a summary returns, but the subagent's work is still billed. Agent teams go further: Anthropic's docs say they use about 7 times the tokens of a standard session when teammates run in plan mode, because each teammate is a separate Claude instance with its own context.
Model choice and extended thinking#
Opus 5.5 costs twice as much per token as Sonnet 5.5, and since Claude Code version 2.1.280 the default model setting resolves to Opus 5.5 on Pro, Max, Ultra, Team, Enterprise, and the Anthropic API, according to the model configuration docs. Extended thinking is on by default, its tokens bill as output, and Anthropic notes the default budget can reach tens of thousands of tokens per request. Thinking cannot be turned off on Opus 5.5, Sonnet 5.5, Haiku 5.5, or the Fable models, so the effort level is the control there; Fable 5.2 and the 5.5 models default to medium.
MCP tool definitions and CLAUDE.md#
Tool definitions sit at the front of every request. Claude Code defers Model Context Protocol tool definitions by default through tool search, so only tool names and server instructions load at session start and a full definition loads when Claude uses that tool. Each connected server still adds its listing, while command-line tools such as gh or aws add none. CLAUDE.md, the project instruction file that works like AGENTS.md, loads into every session, so workflow-specific instructions in it cost tokens during unrelated work. Anthropic suggests keeping CLAUDE.md under 200 lines and moving specialized instructions into skills, which load only when invoked.
Long and idle sessions#
A long session costs more per question, because a one-line prompt in a session that has been open all day still re-sends the whole conversation. Cache expiry adds a second cost: the first message after a break longer than the cache lifetime reprocesses the full context at the uncached rate. Scheduled /loop tasks, goal check-ins, session recaps, and idle compaction can also send requests while the developer is away, and /compact itself is a large request because it reads the conversation it summarizes.
How prompt caching reduces repeat input costs#
Prompt caching lets the API reuse the unchanged start of a request, called the prefix, and bill it at the cache-read rate: 0.05 times the base input price on Opus 5.5 and Sonnet 5.5, and 0.1 times on most other models. Claude Code manages caching automatically and orders each request so content that rarely changes comes first. The match is exact, so a change anywhere in the prefix reprocesses everything after it.
Cache writes cost more than base input: 1.25 times for the five-minute cache and 2 times for the one-hour cache. According to Anthropic's prompt caching guide for Claude Code, Claude Code requests the one-hour cache for the main conversation only on a subscription within plan usage. With an API key, a cloud provider, or usage credits it defaults to five minutes, and the promptCacheTtl setting changes that. Actions that invalidate the cache include switching models, toggling fast mode, adding or removing MCP servers when tools load upfront, compaction, and, on most models, changing the effort level. Anthropic's advice is to pick the model and effort level at the start of a session and compact at natural breaks between tasks.
How to check Claude Code usage#
Claude Code has three built-in views of usage: the /usage command (also opened by /cost and /stats), the /context grid, and a configurable status line. All three are local estimates at list price for one machine. Organization-wide numbers come from OpenTelemetry export, the Claude Console dashboard and Analytics API, or Team and Enterprise analytics.
| Tool | Scope | Covers | Who uses it |
|---|---|---|---|
/usage and the status line |
One session on one machine | Any billing route, estimated at list price | Every developer |
| OpenTelemetry export | Per user, near real time | Every billing route | Admins, through managed settings |
| Console dashboard and Claude Code Analytics API | Per user, daily | Console API usage only | Console roles with usage access; Admin API key |
| Team and Enterprise analytics | Per user, daily spend report | Usage-credit spend; Enterprise usage via the Analytics API | Admins and Owners |
| Cloud billing console | Per account or project | Bedrock, Agent Platform, Foundry | Cloud admins |
| AI gateway logs | Per request, per key | Any traffic routed through the gateway | Gateway admins |
The /usage, /cost, and /context commands#
/usage shows the session's estimated total cost, API time, lines changed, and tokens per model, split into input, output, cache read, and cache write. Since version 2.1.251 it adds a prompt cache line with the share of input served from cache and recent misses. On a subscription it also shows plan usage bars and a breakdown of recent usage by skills, subagents, plugins, and individual MCP servers, with a recommendation for any behavior behind 10% or more of that usage. /context draws the current context as a colored grid and flags heavy tools and memory files.
The dollar figure is computed locally at list price, so it will not match a contracted rate. The modelPricing managed setting makes /usage, the status line, and OpenTelemetry report at the organization's own rates; it changes the estimate, not the charge.
Status line#
The status line runs a script you configure and passes it session data as JSON on stdin, including cost.total_cost_usd, context_window.used_percentage, and, for Pro, Max, and Ultra subscribers, rate_limits.five_hour.used_percentage and rate_limits.seven_day.used_percentage. That puts the session's estimated cost and remaining plan headroom on screen at all times. Running /statusline with a short description generates a script.
OpenTelemetry export#
OpenTelemetry export is, per Anthropic's docs, the only built-in option that streams per-user token and cost metrics into your own observability stack in near real time, and it works on every billing route. Administrators enable it in managed settings so every machine reports to the same collector. This block follows the example in the monitoring docs, with resource attributes added for team attribution:
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_METRICS_EXPORTER": "otlp",
"OTEL_LOGS_EXPORTER": "otlp",
"OTEL_EXPORTER_OTLP_PROTOCOL": "grpc",
"OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.example.com:4317",
"OTEL_RESOURCE_ATTRIBUTES": "department=engineering,team.id=platform,cost_center=eng-123"
}
}The two cost metrics are claude_code.cost.usage, in US dollars, and claude_code.token.usage, split by type into input, output, cacheRead, and cacheCreation. Both carry model and attribution fields such as agent.name, skill.name, and mcp_server.name, and every metric carries session.id, organization.id, user.account_uuid, and user.email when available. OTEL_RESOURCE_ATTRIBUTES adds labels such as team or cost center. Metrics export every 60 seconds by default, and Anthropic describes the cost metrics as approximations, so reconcile them against the invoice. Our guide to LLM observability covers backends and dashboards for this data.
Console, Team, and Enterprise reporting#
Console organizations see spend and lines accepted per member on the Claude Code dashboard, and the Claude Code Analytics API returns daily per-user records with input, output, and cache tokens and estimated cost per model, with up to an hour of delay. It needs an Admin API key and covers only usage on the Claude API. Workspace spend limits cap monthly Claude Code spend, and a workspace rate limit keeps Claude Code from crowding out production API traffic in the same organization.
Team and Enterprise admins get the claude.ai analytics dashboard for daily active users, sessions, and contribution metrics, plus a spend report with per-user and per-model CSV export. On Enterprise, the Enterprise Analytics API returns per-user usage and cost reports across Claude surfaces, including Claude Code.
How to track Claude Code spend per developer#
Per-developer tracking needs a data source that knows who sent each request. Claude Code attaches the account to its OpenTelemetry metrics, Anthropic's consoles report per-user spend for Console and subscription usage, and a gateway with one key per developer logs every request. On cloud providers, only OpenTelemetry and a gateway give per-user numbers.
OpenTelemetry shows what each developer spent, and on which model, skill, or MCP server, in near real time. Anthropic's consoles show what the invoice will say for Console and subscription usage. A gateway shows which request cost what, and it is the only one of the three that can stop a request before it reaches the provider.
Anthropic ships its own option for cloud-provider deployments. The Claude apps gateway is a self-hosted service built into the claude binary that signs developers in through your identity provider, holds the upstream credential, relays OTLP metrics, and enforces daily, weekly, or monthly spend caps for each developer, set per user, per identity-provider group, or as an organization default.
For sizing organization rate limits, Anthropic's cost guide suggests per-user token-per-minute allowances that fall as teams grow, from 200,000 to 300,000 for 1 to 5 users down to 10,000 to 15,000 above 500 users, because fewer developers run Claude Code at the same moment in large organizations.
How to reduce Claude Code cost#
The largest savings come from matching the model to the task, keeping the context small, and keeping the prompt cache warm. Use Sonnet or Haiku where Opus is not needed, clear between unrelated tasks, keep CLAUDE.md and the MCP server list lean, lower the effort level on simple work, and avoid switching models in the middle of a task.
- Choose the model per task.
/modelswitches models, and theopusplanalias uses Opus in plan mode and Sonnet for execution, though each plan-mode toggle starts a fresh cache. Setmodel: haikuin a subagent's configuration for simple delegated work, or set a default withCLAUDE_CODE_SUBAGENT_MODEL. Admins can restrict choices with theavailableModelsmanaged setting. - Clear and compact on purpose.
/clearstarts a new conversation at no cost and suits a switch to unrelated work./compactaccepts focus instructions, such as/compact Focus on test output and code changes, and costs least while the cache is warm. - Keep CLAUDE.md short. Move instructions for specific workflows, such as reviews or migrations, into skills.
- Trim MCP servers. Disable unused servers in
/mcp, prefer command-line tools where they exist, and run/contextto see what fills the window. - Limit thinking on simple work. Lower the level with
/effort, setMAX_THINKING_TOKENSon models with a fixed thinking budget, or cap a fleet with themaxEffortLevelmanaged setting. - Filter tool output. Trim test and log output with hooks, and send verbose jobs to a subagent on a smaller model.
- Protect the cache. Choose the model, effort level, and fast mode at the start of a session. API-key users who often step away can set
promptCacheTtlto1h, paying a 2x write price to avoid full reprocessing. - Cap automation. In print mode,
--max-budget-usdstops a run when estimated spend reaches a limit, and--max-turnscaps agent turns. Spend can pass the cap, so leave headroom.
Our guide to context engineering covers the same decisions in more depth, including what enters the window, what gets compressed, and what runs in a separate context.
Team controls: an AI gateway with one key per developer#
An AI gateway sits between Claude Code and the model provider and gives each developer or team its own virtual key. The gateway then enforces budgets and rate limits per key, logs every request with its tokens and cost, and applies the same rules whether the upstream is Anthropic's API, Bedrock, or Google Cloud.
Claude Code connects to a gateway through ANTHROPIC_BASE_URL plus a gateway credential in ANTHROPIC_AUTH_TOKEN or an apiKeyHelper script. Anthropic's LLM gateway docs describe the rollout: give the gateway the provider credential, issue each developer a gateway credential so usage is attributed and offboarding revokes one key, and distribute the configuration through managed settings. While a gateway credential is active, subscription limits do not apply, and the traffic is billed per token to whoever owns the upstream credential. The gateway must also forward Claude Code's cache_control markers: per Anthropic's caching guide, a gateway that silently strips them bills the whole conversation history as uncached input on every turn. Our explainer on what an AI gateway is covers the architecture in general.
Bifrost, the open-source (Apache 2.0) AI gateway from Maxim AI, is one example of this pattern. Its documented features for Claude Code traffic include:
- Virtual keys with budgets. Each
sk-bf-*virtual key carries its own budget and allowed providers and models. Budgets also exist for teams, customers, and provider configs; every applicable budget is checked independently, and budgets reset daily, weekly, monthly, quarterly, or yearly. - Rate limits. Request and token limits over windows such as a minute, an hour, or a day apply at the provider-config, virtual-key, team, and customer levels.
- Alerting. Bifrost Enterprise evaluates alert rules over budget and rate-limit usage every 60 seconds and notifies Slack, Microsoft Teams, PagerDuty, or a webhook.
- Per-request logs. The built-in log store records tokens, cost, and latency for each request and filters by model, provider, and cost range.
- Cache-friendly routing. Session affinity keeps a Claude Code session, including its subagents, on the same provider and key, so the provider's prompt cache keeps hitting.
The Bifrost CLI launches Claude Code with the gateway URL, credential, and model already set for that session, without editing ~/.claude/settings.json:
bifrost context add production --base-url https://bifrost.example.com --use
printf '%s\n' "$BIFROST_VIRTUAL_KEY" | bifrost auth set-virtual-key --stdin
bifrost claude --model anthropic/claude-sonnet-4-6Teams that want to keep subscription billing can still route through the gateway for logs and governance. Bifrost's Claude Code guide describes signing in with /login and sending the virtual key in an x-bf-vk header through ANTHROPIC_CUSTOM_HEADERS, in which case the subscription's usage limits still apply.
Where to go next: our comparison of AI coding agents covers how Claude Code differs from other terminal, IDE, and cloud agents, our Claude Code vs Cursor comparison sets the two plans side by side, and the AI coding tools directory lists the products by surface, model choice, and license.
Frequently asked questions
How much does Claude Code cost per month?
- As of November 2026, Claude Code is included in Claude Pro at $20 a month, Max at $100, and Ultra at $200, with Team seats from $20 per seat per month billed annually. Pay-as-you-go use through an API key is billed per token instead. Anthropic's documentation reports that enterprise deployments average $150 to $250 per developer per month, so heavy users on API billing can pass the price of a subscription.
Is Claude Code free?
- No. Claude Code is not included in the Free Claude plan. It comes with every paid plan, including Pro, Max, Ultra, Team, and Enterprise, and it can also run on pay-as-you-go API credits from a Claude Console account or on Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry, where the cloud provider bills each token. Every route therefore draws on either a paid plan's usage limits or per-token billing.
Is a Claude subscription or the API cheaper for Claude Code?
- A subscription is usually cheaper for a developer who uses Claude Code most working days, because the plan price is fixed and usage limits reset every five hours and every week. API billing suits occasional use, automation, and teams that need per-token accounting and no plan limits. Anthropic's enterprise averages of $150 to $250 per developer per month are a useful break-even reference against the $100 Max plan.
How do I check my Claude Code usage?
- Run /usage inside Claude Code. It shows the session's estimated cost and tokens per model, the prompt cache hit rate, and, on a subscription, plan usage bars with a breakdown by skills, subagents, plugins, and MCP servers. /cost and /stats open the same screen. /context shows what fills the context window, and a custom status line can display cost and context use continuously.
How much does Claude Code Enterprise cost?
- Anthropic's pricing page listed Claude Enterprise at $20 per seat per month, billed annually with a 20-seat minimum, plus usage charged at API rates, on November 16, 2026. Claude Code is included with the seat, and usage-based Enterprise plans have no per-seat usage limits. Admins set spend limits per user and for the organization, and volume or committed-spend discounts are negotiated with Anthropic's sales team.
How do I track Claude Code usage per developer?
- Enable OpenTelemetry export through managed settings, which sends per-user token and cost metrics from every machine to your own collector on any billing route. Console organizations also get per-member spend on the Claude Code dashboard and the Claude Code Analytics API, and Team or Enterprise admins get a per-user spend report. An AI gateway with one virtual key per developer adds per-request logs and budgets.
Terms in this guide
Cite this guide
The AI Engineering Editors. "Claude Code cost: how billing works and how to track spend per developer." The AI Engineering, updated Nov 20, 2026. https://theaiengineering.com/articles/claude-code-cost
- Title
- Claude Code cost: how billing works and how to track spend per developer
- Author
- The AI Engineering Editors
- Publisher
- The AI Engineering
- Published
- Updated