Claude Code usage: limits, tracking, and per-developer costs
Claude Code usage is either drawn from a Claude plan's limits or billed per API token. How to check it with /usage, track it per developer, and cap it.
- Published
- Reading time
- 14 min read
In short
- Claude Code usage is metered by the credential a session signs in with. A Pro, Max, Ultra, Team, or Enterprise login draws from plan limits shared with Claude chat. An API key, a Console login, or cloud credentials bill every token to an organization.
- Run /usage to see a session's token counts, an estimated cost, plan usage bars, and what is consuming the plan. /cost and /stats are aliases. Every dollar figure in the client is an estimate at list price.
- Anthropic's own per-developer reports depend on the setup: the claude.ai spend report for Team and Enterprise, the Console dashboard and Claude Code Analytics API for API billing, and nothing at all for Bedrock or Google Cloud.
- OpenTelemetry export works on every setup and streams per-user cost and token metrics. A gateway with one virtual key per developer adds the one control the client cannot provide: a budget that stops requests.
Claude Code usage is metered in one of two ways, decided by the credential a session signs in with. A claude.ai login on a Pro, Max, Ultra, Team, or Enterprise plan draws from usage limits that reset on a schedule. An API key, a Claude Console login, or cloud credentials bill every token to an organization's account.
Everything else follows from that choice: which limit a developer can hit, what /usage shows, and which report an admin opens to see spend per person. This guide covers both modes, the built-in ways to check usage, and how a team tracks and caps cost per developer, including through a gateway such as Bifrost, an open-source AI gateway by Maxim AI.
How Claude Code usage is billed
Claude Code usage is billed either against a subscription's included limits or per token at API rates. Anthropic's cost guide splits the setups like this:
| Sign-in | How usage is metered | What runs out |
|---|---|---|
| Pro, Max, or Ultra | Included in the plan, shared with Claude chat | A five-hour session limit and a weekly limit |
| Team or Enterprise seat | A per-seat allowance shared with Claude chat and Cowork | A rolling five-hour window and a weekly window |
| Claude Console | Per token, billed to the API organization | Workspace and organization spend limits |
| Amazon Bedrock, Google Cloud, or Microsoft Foundry | Per token, billed to the cloud account | Your cloud's budget controls |
On the individual plans, the Claude Help Center says the limits "are shared across Claude and Claude Code," so a long chat in the browser leaves less for the terminal. Verified Ultra accounts have no five-hour limit, only a weekly one, and Max and Ultra have a separate weekly limit for Fable. Anthropic publishes no token or message counts for any of these limits, so plan from what /usage reports rather than from a number.
Past the limit, a subscriber can turn on usage credits, which bill further work at API rates. On Team and Enterprise, the size of the seat allowance depends on the seat tier, Standard or Premium, and admins can let members continue past it with usage credits and spend limits set per organization, group, or member.
For budgeting API usage, Anthropic reports that across enterprise deployments the average is around $13 per developer per active day and $150 to $250 per developer per month, with 90% of users below $30 per active day. Treat those as a starting point for a pilot, not a forecast for your team.
Which credential Claude Code uses, and when an API key takes over
Claude Code picks one credential in a fixed order, and the first one present decides the billing. The authentication docs list it:
- Cloud provider credentials, when
CLAUDE_CODE_USE_BEDROCK,CLAUDE_CODE_USE_VERTEX, orCLAUDE_CODE_USE_FOUNDRYis set ANTHROPIC_AUTH_TOKEN, sent as a bearer token, for gatewaysANTHROPIC_API_KEY, sent asx-api-key- The output of an
apiKeyHelperscript CLAUDE_CODE_OAUTH_TOKEN, a one-year subscription token fromclaude setup-token- Anthropic profiles and federation credentials
- The subscription login from
/login
The trap is step 3. A Claude Code API key exported in a shell profile outranks the subscription login. In interactive mode Claude Code asks once whether to use the key and remembers the answer; in non-interactive mode with -p, it uses the key without asking. Once the key is in use, the work is billed to the API organization and the plan's included usage sits idle.
The reverse case matters for CI. claude setup-token prints a long-lived OAuth token that authenticates with the subscription, so a pipeline can run on a plan rather than an API key. It can only make model requests, and bare mode does not read it.
For API billing with many developers, a Console admin can invite people with the Claude Code role, which can only create Claude Code API keys. The first Console sign-in creates a workspace named "Claude Code" in the organization, and Claude Code mints a per-user key in it. Nobody can create keys in that workspace by hand, and a key stops working when its owner leaves the workspace.
How to check Claude Code usage with /usage
/usage is the built-in command for checking Claude Code usage, and /cost and /stats are aliases for it. The commands reference describes it as showing "session cost, plan usage limits, and activity stats." It runs immediately, even while Claude is responding.
The Session block lists the current session's token counts by model, an estimated cost, and API and wall-clock duration:
Estimated 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)Claude Code computes that dollar figure on the laptop from token counts at list price, and the totals reset when /clear starts a new session. For subscribers the figure has no billing meaning. Since v2.1.251 the block also carries a Prompt cache (main) line with the share of input served from cache and the number of misses, which is the quickest check on whether caching is working. Prompt caching explains why a miss is expensive.
On a paid plan, the same screen shows plan usage bars and a breakdown of what is consuming them:
- Attribution: the share of recent usage spent by skills, subagents, plugins, and individual MCP servers
- Recommendations: rows such as trimming an oversized
CLAUDE.md, each tagged with the share of usage it applies to, which is not the amount it saves - Loops: the heaviest
/loopand scheduled tasks, with run counts and tokens per run
Press d or w to switch between the last 24 hours and the last 7 days. The breakdown is computed from session history on this machine, so usage from another laptop or from claude.ai is not in it.
Two more views exist. The status line receives cost.total_cost_usd and, for Pro, Max, and Ultra subscribers, rate_limits.five_hour.used_percentage and rate_limits.seven_day.used_percentage, so the remaining allowance can sit on screen all day. /insights writes an HTML report on how you work across recent sessions, and its own analysis counts against your usage.
{
"statusLine": {
"type": "command",
"command": "jq -r '\"5h: \\(.rate_limits.five_hour.used_percentage // \"-\")% · $\\(.cost.total_cost_usd)\"'"
}
}Which Claude Code usage limit a developer hit
A Claude Code limit message names one of four different ceilings, and each has a different fix. The cost guide maps them:
| Message | What ran out | What to do |
|---|---|---|
| "You've hit your session limit" or "weekly limit" | The plan's five-hour or weekly window, across all models | Wait for the reset shown, or request usage credits with /usage-credits |
| "You've hit your Opus limit" or "Sonnet limit" | A model-specific allowance | Switch to a model outside that family with /model |
| "individual spend limit", "org's monthly spend limit", or "team's shared budget" | A usage-credits cap an admin set | Raise the named limit in Organization settings > Usage |
| A context or auto-compact warning | Room in the context window, not usage | /clear or /compact |
/rate-limit-options lists the ways to keep working when a plan limit blocks a request. From v2.1.234, Claude Code can wait for the reset and continue the interrupted task, which admins can control fleet-wide with autoContinueAtUsageLimit in managed settings.
How to track Claude Code usage per developer
Anthropic offers per-developer reporting for every first-party setup, but each setup has its own report, and cloud-provider usage gets none. The cost guide's summary, condensed:
| Setup | See spend | Cap spend | Per-developer numbers |
|---|---|---|---|
| Team or Enterprise | Spend report in org analytics | Spend limits in admin settings | Spend report CSV; Enterprise Analytics API on Enterprise |
| Claude Console | Console Cost page | Workspace spend limits | Console dashboard; Claude Code Analytics API |
| Bedrock, Google Cloud, or Foundry | Cloud billing console | Cloud budget controls | OpenTelemetry or a gateway |
On Team and Enterprise, the spend report lists token usage and estimated spend per user and per model, updated daily, but only for usage-credit spend. Usage inside the seat allowance is not metered in dollars. The analytics dashboard adds active users, sessions, accepted lines, and, with the GitHub app installed, PRs with Claude Code.
On the Console, the dashboard at platform.claude.com/claude-code has a team insights table with spend and lines accepted per member. The Claude Code Analytics API returns the same data per day with an Admin API key, with up to a one-hour delay:
curl "https://api.anthropic.com/v1/organizations/usage_report/claude_code?starting_at=2026-11-20" \
-H "anthropic-version: 2026-10-21" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY"Each record names an actor, by email for OAuth users or by key name for API key users, with tokens and an estimated_cost.amount in cents per model. It covers only usage authenticated against the Console organization, so subscription seats need the Enterprise Analytics API or the claude.ai reports instead.
The Console is also where API spend gets capped. The Claude Code workspace is the only workspace that supports per-user monthly spend limits, and admins can give it its own rate limit so a busy week of coding sessions does not eat the organization limit that production traffic depends on. Virtual keys covers why caps measured in tokens and caps measured in dollars behave differently.
Bedrock, Google Cloud, and Foundry are the gap. Claude Code sends no usage from those providers back to Anthropic, so the dashboards and the Analytics API show nothing, and the cloud bill shows one account's total rather than per-developer spend.
Export per-developer Claude Code metrics with OpenTelemetry
OpenTelemetry export is the one per-developer source that works on every setup, plan, and provider. Each Claude Code client sends metrics and events to a collector you run. Deliver the settings through managed settings so every machine reports and no developer can redirect it. The monitoring guide gives this block:
{
"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_EXPORTER_OTLP_HEADERS": "Authorization=Bearer example-token"
}
}Metrics export every 60 seconds by default. The ones that matter for cost:
| Metric | Unit | What it counts |
|---|---|---|
claude_code.cost.usage | USD | Estimated cost, incremented after each API request, with model and query_source |
claude_code.token.usage | tokens | Tokens by type: input, output, cacheRead, cacheCreation |
claude_code.session.count | count | Sessions started, fresh or resumed |
claude_code.active_time.total | seconds | Active time, split into user and CLI |
Every series carries user.email when available, user.account_uuid, organization.id, and session.id, which is enough to group cost by developer. To group by team, set OTEL_RESOURCE_ATTRIBUTES="team.id=platform,cost_center=eng-123" per group of machines. Each custom key becomes a label on every series, so keep the values low in cardinality. The claude_code.api_request event carries cost_usd and token counts per request for teams that want rows rather than counters.
Three limits apply. The cost is an estimate at list price, so set the modelPricing managed setting to your contracted rates if the figures should match the invoice. The data is reported by the client, so a machine without the managed settings does not appear at all. And OpenTelemetry can observe spend but cannot stop it. LLM observability covers what else to record, and what to keep out of logs.
Per-developer keys, budgets, and logs with Bifrost
A gateway gives a team per-developer Claude Code usage tracking that does not depend on each laptop's settings, plus a budget that stops requests when it runs out. Bifrost does this with one virtual key per developer. The settings that point Claude Code at a gateway are covered in Claude Code gateway, and key hierarchy and budget design in virtual keys. This section covers what each gives you for usage tracking.
One key, one developer. Each developer gets a Bifrost virtual key that lists the providers and models it may reach. Access is deny by default, and turning on enforce_auth_on_inference rejects any request without a valid key. The key can belong to a team, and a team to a customer, so one developer's spend rolls up to their team.
A budget in dollars. Each key takes one or more budgets, set as max_limit in dollars and reset_duration values such as 1d, 1w, or 1M, plus token and request rate limits through token_max_limit and request_max_limit. A request is checked against the key's budget and against the team and customer budgets above it. When any of them is spent, Bifrost answers 402 with the type budget_exceeded, and the message names the tier that ran out.
A log row per request. Bifrost's Logs page shows each Claude Code request with its virtual key, provider, model, token usage, latency, and cost. The /api/logs endpoint filters by provider, model, time range, and cost. For dashboards, Bifrost's Prometheus metrics include bifrost_cost_total and input and output token counters, and most request-level metrics carry virtual_key_name and team_name labels by default. A team that already runs Grafana can chart spend per developer without exporting anything from the laptops.
Subscription seats too. A gateway does not require moving everyone to API billing. Bifrost's Claude Code guide supports a mode where the developer keeps the /login subscription and sends only the virtual key as a custom header:
{
"env": {
"ANTHROPIC_BASE_URL": "https://bifrost.example.com/anthropic",
"ANTHROPIC_CUSTOM_HEADERS": "x-bf-vk: sk-bf-your-virtual-key"
}
}In this mode the plan's limits and billing still apply, and the gateway adds the per-developer log. Do not also set ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, or apiKeyHelper, because any of them replaces the subscription login.
Bifrost Enterprise adds the parts a larger rollout asks for. bifrost auth login signs developers in through the company identity provider, so the log shows the person rather than a key name. Alerting evaluates rules such as a budget_usage_percent threshold on a virtual key or team, and notifies Slack, Microsoft Teams, PagerDuty, or a webhook before the budget is spent. The open-source core is free to self-host under Apache 2.0, Enterprise is custom-priced with a 14-day trial, and a team can run either inside its own infrastructure.
One detail is easy to miss. Claude Code retries transient failures with backoff, so test what a developer actually sees when their key's budget runs out, before the first person hits it.
Which Claude Code usage source to trust
Each source answers a different question, so most teams use two: the provider's report for the invoice, and OpenTelemetry or a gateway for per-developer detail in near real time.
| Source | Covers | Per developer | Delay | Can stop spend |
|---|---|---|---|---|
/usage and the status line | One machine | Only your own | Live | No |
| claude.ai spend report and dashboard | Team and Enterprise seats | Yes | Daily | Through spend limits on usage credits |
| Console dashboard and Analytics API | Console API usage | Yes | Up to one hour | Through workspace spend limits |
| OpenTelemetry export | Every setup | Yes | About a minute | No |
| A gateway such as Bifrost | Traffic through the gateway | Yes, per key | Per request | Yes, per key and team |
The client figures, the Console spend figures, and OpenTelemetry cost are all estimates. The invoice is the provider's Cost page or your cloud bill. When the numbers disagree, reconcile against that, and check modelPricing and the credential order first. LLM cost optimization covers how to bring the total down once you can see where it goes.
Frequently asked questions
How do I check my Claude Code usage?
Run /usage at the Claude Code prompt. It shows the current session's tokens by model and an estimated cost, and on a paid plan it also shows plan usage bars and a breakdown of what consumed them over the last 24 hours or 7 days. /cost and /stats open the same screen.
Does Claude Code usage count against my Claude chat limits?
Yes, on a subscription. Pro, Max, and Ultra limits are shared across Claude and Claude Code, and Team and Enterprise seat allowances are shared with Claude chat and Cowork. With an API key or cloud credentials, Claude Code is billed per token and does not touch the plan.
What are the Claude Code usage limits on Pro and Max?
Pro and Max have a five-hour session limit and a weekly limit, and Max also has a separate weekly limit for Fable. Anthropic does not publish token or message counts for them. /usage and the status line's rate_limits fields show the percentage of each window used and when it resets.
How do I use Claude Code with an API key?
Set ANTHROPIC_API_KEY to a Claude Console key and start claude. In interactive mode it asks once whether to use the key. The key outranks a subscription login, so all usage is then billed at API rates. For a gateway that reads bearer tokens, use ANTHROPIC_AUTH_TOKEN instead, and for rotating keys use an apiKeyHelper script.
How much does Claude Code cost per developer?
Anthropic reports an average of around $13 per developer per active day and $150 to $250 per month across enterprise deployments, with 90% of users below $30 per active day. Model choice, session length, and parallel agents move the figure, so run a pilot and measure before rolling out.
How do I track Claude Code usage per developer?
Use the report for your setup: the claude.ai spend report on Team and Enterprise, or the Console dashboard and Claude Code Analytics API for API billing. For every setup, including Bedrock and Google Cloud, export OpenTelemetry metrics through managed settings, or route Claude Code through a gateway with one virtual key and budget per developer.
Sources
- 01Manage costs effectivelyClaude Code docs
- 02CommandsClaude Code docs
- 03AuthenticationClaude Code docs
- 04MonitoringClaude Code docs
- 05Track team usage with analyticsClaude Code docs
- 06Customize your status lineClaude Code docs
- 07Using Claude Code with your Pro or Max planClaude Help Center
- 08Claude Code Analytics APIClaude API docs
- 09WorkspacesClaude API docs
- 10Claude CodeBifrost docs
- 11Virtual keysBifrost docs
- 12Built-in observabilityBifrost docs
- 13PrometheusBifrost docs
- 14AlertingBifrost docs