What you will be able to do
- Decide when a full OpenTelemetry pipeline is justified and when the Usage & Cost API, the analytics dashboard or session usage totals already answer the question
- Use the Usage & Cost API's granularities and grouping to attribute spend by workspace
- Get per-user spend attribution and caps for Claude Code on Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry
- Size organization TPM and RPM allocations from the per-user figure for the right team-size tier
1.When OpenTelemetry is more than you need
Choose a monitoring tool by starting from the question you need answered. An OpenTelemetry pipeline means running a collector and a backend and making content decisions. It is worth that cost when you need per-user token counts, costs and tool activity, or traces of individual runs. Many questions need far less. Spend per workspace, how many developers used Claude Code this week, or what one agent session cost can each be answered with no collector at all.
The lightweight options are already built in. The Agent SDK message stream reports token and cost data your application can read directly. A Managed Agents session carries a usage object with its token counts, active seconds and list cost. A session.usage event delivers the same snapshot on the stream, so you don't need to poll. For an organization, the Usage & Cost API returns usage and cost by workspace, model and API key. For Claude Code on a Team or Enterprise plan, the analytics dashboard covers adoption.
| Question | Tool | Needs your own backend? |
|---|---|---|
| What did this one agent session cost? | Session usage field or session.usage event | No |
| What is each workspace spending, by model? | Usage & Cost API (cost_report, usage_report/messages) | No |
| How many developers are using Claude Code? | Analytics dashboard (daily active users, sessions) | No |
| Which user, team or tenant used which tools, and why did a run fail? | OpenTelemetry metrics, events and traces | Yes |
Checkpoint 1 of 5· Check yourself
A platform team runs Claude Managed Agents. Finance wants to know what each individual agent session cost, updated as sessions finish. The team does not need per-user tool activity or traces. Which approach answers this with the least infrastructure?
Each Managed Agents session reports its own token counts, active time and list cost. The session.usage event delivers that snapshot on the stream, so you need no collector and no polling. The Usage & Cost API reports by workspace, model and API key, not by session. An OpenTelemetry pipeline is only worth its cost for per-user tool activity or traces of runs.
“You don't have to poll the session to observe these totals. The session.usage event carries the same cumulative snapshot on the session stream”Source: platform.claude.com
2.Attributing spend with the Usage & Cost API
The Usage & Cost API answers organization-level questions with an Admin API key and no infrastructure. It has two endpoints. usage_report/messages returns token counts in 1-minute, 1-hour or 1-day buckets. cost_report returns costs in USD and supports daily buckets only. To build workspace chargebacks, group costs by workspace_id and description. Usage attributed to the Default Workspace appears with a null workspace_id.
curl "https://api.anthropic.com/v1/organizations/cost_report?\
starting_at=2025-01-01T00:00:00Z&\
ending_at=2025-01-31T00:00:00Z&\
group_by[]=workspace_id&\
group_by[]=description" \
-H "anthropic-version: 2023-06-01" \
-H "x-api-key: $ANTHROPIC_ADMIN_KEY"The API's limits show when it is the wrong tool. Data usually appears within about five minutes of a request, and the API supports polling once per minute over sustained use. That suits dashboards and budget alerts, but not debugging live. It also has no concept of an individual user. The Console's usage and cost pages cannot break spend down by user, and issuing one API key per developer to fake it runs into performance limits. For per-user Claude Code costs, use the Claude Code Analytics API instead.
Checkpoint 2 of 5· Check yourself
An analyst wants hourly dollar figures per workspace from the cost endpoint to catch a spend spike within the day. What will they find?
cost_report supports daily granularity only. Hourly or per-minute resolution exists on usage_report/messages, which reports token counts rather than dollars.
“Time buckets: Daily granularity only (1d)”Source: platform.claude.com
3.Per-user attribution on Bedrock, Agent Platform and Foundry
Where Claude Code is billed decides which monitoring tools can see it. Each Anthropic-hosted view covers only its own billing channel. The org analytics spend report covers usage-credit spend on Team and Enterprise plans. Console workspace spend limits govern Console API usage. /usage-credits opens claude.ai or organization usage settings, or sends a request to your admins. When requests go to Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry, none of these sees the traffic.
| Setup | See spend | Cap spend | Per-user reporting |
|---|---|---|---|
| Claude for Teams or Enterprise | Spend report in org analytics | Spend limits in admin settings | Spend report CSV; Enterprise Analytics API on Enterprise |
| Claude Console (API) | Console usage page | Workspace spend limits | Console dashboard, Claude Code Analytics API |
| Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry | Your cloud billing console | Your cloud's budget controls | OpenTelemetry or an LLM gateway |
On these providers, the right tool depends on whether you need caps or only visibility. OpenTelemetry exported from each machine gives per-user token counts, costs and tool activity whatever the provider, but it can only report a cap, not enforce one. To split those figures by developer and team, set OTEL_RESOURCE_ATTRIBUTES, the variable that attaches your own key=value tags, such as team.id=platform, to the metric datapoints Claude Code exports. The value is comma-separated pairs with no spaces. A self-hosted Claude apps gateway placed in front of the provider adds per-user usage attribution, OTLP token metrics and per-user spend limits it enforces. When a developer passes their cap, the gateway blocks their requests until the period resets. A generic LLM gateway such as LiteLLM tracks spend per key. It is unaffiliated with Anthropic and has not had a security audit.
Checkpoint 3 of 5· Check yourself
Your developers' Claude Code requests are billed through Amazon Bedrock. Finance wants token and cost figures broken down by developer and team. They don't need to block anyone yet. Which tool gives them this?
The cloud billing console shows total spend but not who used it, and Anthropic-hosted reports and limits never see Bedrock traffic. OpenTelemetry from each machine reports token and cost counters whatever the provider, and your resource attributes appear on every datapoint, so you can split the figures by user and team. Enforcing a cap would need a gateway instead.
“Include keys from OTEL_RESOURCE_ATTRIBUTES as attributes on metric datapoints”Source: code.claude.com
Checkpoint 4 of 5· Exam question
A company runs Claude Code through Amazon Bedrock and notices that, unlike their Claude Console workspace, no per-developer cost or token metrics appear in any Anthropic-hosted dashboard. Finance still wants per-user spend attribution and enforceable per-user caps. What should the platform team deploy to get this?
Correct answer: A — A self-hosted Claude apps gateway in front of Bedrock, which adds per-user usage attribution, OTLP token metrics, and per-user spend limits that Bedrock itself does not send to Anthropic
- A. Correct. On Bedrock, Vertex, and Foundry, Claude Code does not send metrics from the cloud provider back to Anthropic, so a self-hosted Claude apps gateway is the documented way to get per-user usage attribution, OTLP metrics with token counts, and per-user spend limits for those deployments.
- B. The analytics dashboard's contribution and spend tracking is built around Claude Console and claude.ai organizations; it is not documented to aggregate Bedrock-side spend automatically.
- C. /usage-credits governs monthly usage-credit limits on Pro/Max plans for an individual account, not organization-wide per-user attribution across a Bedrock fleet.
- D. Workspace spend limits apply to the Claude Code workspace used for Console-authenticated traffic; Bedrock-routed traffic does not flow through that workspace, so this control would not see or cap it.
4.Sizing TPM and RPM allocations by organization size
Rate limits are set at the organization level, so a Claude Code rollout needs one total allocation, not a set of individual ones. To size it, multiply the headcount by the per-user tokens-per-minute (TPM) and requests-per-minute (RPM) figures for your team-size tier. The per-user figure falls steeply as the team grows, so a figure taken from a small pilot overstates what a large organization needs per developer.
| Team size | TPM per user | RPM per user |
|---|---|---|
| 1-5 users | 200k-300k | 5-7 |
| 5-20 users | 100k-150k | 2.5-3.5 |
| 20-50 users | 50k-75k | 1.25-1.75 |
| 50-100 users | 25k-35k | 0.62-0.87 |
| 100-500 users | 15k-20k | 0.37-0.47 |
| 500+ users | 10k-15k | 0.25-0.35 |
Here is a worked case. A 15-developer pilot sits in the 5–20 tier at 100k–150k TPM per user. Scaling to 300 developers with that figure gives 30M–45M TPM. The 100–500 row is the correct one for 300 developers: 15k–20k TPM and 0.37–0.47 RPM per user, or roughly 4.5M–6M TPM and 111–141 RPM in total. Once usage comes from Console accounts, Claude Code gets its own workspace with its own usage and rate limits, separate from your other workloads. Workspace limits can be set lower than the organization's limits, but not higher.
Checkpoint 5 of 5· Exam question
An organization is scaling its Claude Code rollout from 15 developers to roughly 300 developers and wants to set organization-level Tokens-Per-Minute and Requests-Per-Minute allocations. A junior admin proposes simply multiplying the 15-user TPM-per-user figure by 300. Why is this the wrong approach, and what should the admin do instead?
Correct answer: A — Per-user TPM/RPM shrinks as org size grows since fewer users are concurrently active at scale, so the admin should multiply by the lower per-user figure for the 300-user tier, not the 15-user figure
- A. Correct. The documented guidance shows per-user TPM and RPM recommendations decreasing as team size grows (e.g. 200k-300k TPM/user at 1-5 users down to 10k-15k TPM/user at 500+ users) because concurrent usage doesn't scale linearly with headcount, so scaling from the 15-user tier's figure would drastically over-provision.
- B. The recommendation table explicitly decreases per-user TPM and RPM as organization size increases; treating it as flat leads to requesting far more capacity than the organization will concurrently use.
- C. Rate limits apply at the organization level, not per individual user, which is precisely why naive per-user multiplication overstates the real requirement and why aggregate, tier-aware planning matters.
- D. The TPM/RPM sizing guidance applies broadly to planning Claude Code capacity for teams regardless of which provider handles the underlying API traffic, so it cannot be dismissed for Console-authenticated organizations.
Sources
(8)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Track cost and usage: read token and cost data from the message stream without an external backend.”
↩︎ When OpenTelemetry is more than you need - 2.
“The session.usage event carries the same cumulative snapshot on the session stream and in the event history.”
↩︎ When OpenTelemetry is more than you need“You don't have to poll the session to observe these totals. The session.usage event carries the same cumulative snapshot on the session stream”
↩︎ Checkpoint - 3.https://code.claude.com/docs/en/costsOfficial docs
“the analytics dashboard shows daily active users, sessions, and contribution metrics”
↩︎ When OpenTelemetry is more than you need“This gives you per-user token counts, costs, and tool activity regardless of provider.”
↩︎ Per-user attribution on Bedrock, Agent Platform and Foundry“The report covers usage-credit spend and appears once usage credits are turned on.”
↩︎ Per-user attribution on Bedrock, Agent Platform and Foundry“a self-hosted Claude apps gateway provides per-user usage attribution, OTLP metrics with token counts, and per-user spend limits on these providers.”
↩︎ Per-user attribution on Bedrock, Agent Platform and Foundry“100-500 users | 15k-20k | 0.37-0.47”
↩︎ Sizing TPM and RPM allocations by organization size“a self-hosted Claude apps gateway provides per-user usage attribution, OTLP metrics with token counts, and per-user spend limits on these providers.”
↩︎ Exam trap 1“100-500 users | 15k-20k | 0.37-0.47”
↩︎ Exam trap 2“Your cloud billing console | Your cloud’s budget controls | OpenTelemetry or an LLM gateway”
↩︎ Prediction - 4.
“Time buckets: Daily granularity only (1d)”
↩︎ Attributing spend with the Usage & Cost API“Usage and cost data typically appears within 5 minutes of API request completion”
↩︎ Attributing spend with the Usage & Cost API“provides per-user estimated costs and productivity metrics without the performance limitations of breaking down costs by many API keys”
↩︎ Attributing spend with the Usage & Cost API - 5.https://support.claude.com/en/articles/9534590-cost-and-usage-reporting-in-the-claude-consoleOfficial docs
“not possible to break down usage or cost by individual users”
↩︎ Attributing spend with the Usage & Cost API - 6.https://code.claude.com/docs/en/monitoring-usageOfficial docs
“Include keys from OTEL_RESOURCE_ATTRIBUTES as attributes on metric datapoints”
↩︎ Per-user attribution on Bedrock, Agent Platform and Foundry“Format: must be comma-separated key=value pairs: key1=value1,key2=value2”
↩︎ Per-user attribution on Bedrock, Agent Platform and Foundry - 7.https://support.claude.com/en/articles/8243635-our-approach-to-rate-limits-for-the-claude-apiOfficial docs
“Rate limits are set at the organization level and depend on your usage tier.”
↩︎ Sizing TPM and RPM allocations by organization size - 8.
“It isolates Claude Code's API keys, usage, and rate limits from your other workloads.”
↩︎ Sizing TPM and RPM allocations by organization size