Claude Code Analytics Admin API does not return subscription/OAuth users
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The Claude Code Analytics Admin API (GET /v1/organizations/usage_report/claude_code) only returns records with customer_type: "api". Users who authenticate to Claude Code via OAuth (claude.ai subscription login) do not appear in the API response at all.
The official documentation states that customer_type can be "api" or "subscription" and the FAQ explicitly says:
How are users identified in the data? -user_actor: Containsemail_addressfor users who authenticate via OAuth (most common) - Thecustomer_typefield indicates whether the usage is fromapicustomers (API PAYG) orsubscriptioncustomers (Pro/Team plans).
However, no subscription records are ever returned. This has been reported before in #9700 and #20819, both of which were auto-closed by a bot without any response from Anthropic.
What Should Happen?
The API should return usage records for all Claude Code users in the organization, including those who authenticate via OAuth with their Claude.ai Team/Max subscriptions. These records should have customer_type: "subscription".
Evidence
Our organization ("Fi", org ID 0fb033ef-a1f3-466e-a534-70ff75162401) has 7 admin users and previously had ~15+ engineers using Claude Code via per-user API keys. We can confirm:
- December 2025: When engineers used API keys, we saw 9+ unique users in the API response (all
customer_type: "api") - February 2026: After migrating engineers to OAuth/subscription auth (and archiving the API keys), the API only returns 1-2 actors — effectively losing visibility into the entire team's usage
- Zero
subscriptionrecords have ever been returned across any date range we've queried
We confirmed the org has active users via the /v1/organizations/users endpoint — the users exist, they're using Claude Code daily, but their usage simply doesn't appear in the analytics API.
Impact
This bug makes the Analytics API unusable for organizations whose engineers authenticate via OAuth, which the docs describe as "most common." The only workaround is to switch engineers back to API key auth, which bills against API credits instead of their subscription allowances — defeating the purpose of having subscriptions.
Steps to Reproduce
- Have org members authenticate to Claude Code via Claude.ai (OAuth/subscription)
- Use Claude Code throughout the day
- Query
GET /v1/organizations/usage_report/claude_code?starting_at=<date>with an Admin API key - Observe: only
customer_type: "api"records appear; subscription users are missing
Previous Issues
- #9700 — auto-closed after 60 days with no Anthropic response
- #20819 — auto-closed as duplicate of #9700
Claude Model
Opus (claude-opus-4-6)
Claude Code Version
Latest
Platform
macOS
19 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
we are seeing a similar issue, and this makes it really hard to understand spending. would be great to have this resolved
Tripling down on this.... Went to build a spending reporting app and was shocked to find this information isn't available
Same issue here: OAuth/subscription users are still missing from the Analytics Admin API on our side too, so this is clearly not an isolated case. At this point, months of silence and auto-closed reports make it look less like a bug and more like a deceptive, self-serving failure to provide basic transparency.
I'm finding it frustratingly difficult to get basic per user usage/cost data for Enterprise subscriptions. Wouldn't most every organization be needing this? Are people solving this in some other way? This API would seem the simple answer to my needs, but...it doesn't work as advertised.
Here's a response I got from Anthropic in January:
@holkeri Do you know if is possible to bring the metrics information for claude.ai subscription? Because the only way to create a API key admin is inside platform.claude.com/settings/admin-keys website.
I did not find any other way to create an admin key in claude.ai.
@matheuspalhares-ar, The way I understand it, the Analytics API doesn't support claude.ai.
Here's Anthropic's response to my follow-up question:
Pro/Team customers?
We need this too. Or at least add an export functionality to the cost explorer in claude.ai. It's been too hard to track usage since we moved to an enterprise plan.
+1
Adding a Team-plan perspective on the same root problem — per-user usage visibility for non-API-key (subscription/OAuth) users.
Team plan admins are hit harder than Enterprise, because we don't have access to the Admin API at all. Our only tools are two CSV exports from the admin Analytics page, and both are structurally unable to answer "who uses heavily?" and "who doesn't use their seat?":
Lines this Monthonly. Silently undercounts every non-coding use case (security review, threat modeling, architecture design, pentest analysis, code critique, documentation, planning).The data clearly exists — the admin Analytics page renders daily aggregate charts (unique users, sessions, lines of code per day) that can only be computed from per-user daily data. It's just not exposed at per-user granularity anywhere a Team plan admin can reach.
Concrete example from my team this month (identifiers redacted):
| Metric | Value |
|---|---:|
| Lines of code this month | 63 |
| Overage spend (90 days) | $76.56 — highest on team |
| Requests | 660 |
| Prompt tokens | ~84M |
By the Lines export this user barely exists. By the Spend export they look like the most reckless spender on the team. Reality: heavy, legitimate non-coding usage (review, design, threat modeling). No export I have access to can represent this user honestly — and this is exactly the kind of user an admin most needs visibility into for capacity and budget planning.
The pattern across #9700, #20819, and now this issue is consistent: per-user usage for subscription/OAuth users is the single most-requested admin gap, and each prior issue has been auto-closed without an Anthropic response. Would appreciate even a one-line acknowledgement on direction here — is this on the roadmap, declined, or still unscoped?
For what it's worth, the Team-plan version of this ask is small in scope: a per-user, per-day CSV export (email, date, product, model, requests, tokens, sessions) on the existing admin Analytics page would be sufficient. No API required.
+1 We have a lot of developers on subscription plan that we can't track if the seat is being used correctly since all our usage reports are $0.00 for them. They are also missing in the tokens report. We have gone completely blind metrics-wise.
+1 The teams plan is lacking token level and model level metrics. API access to non-platform accounts would be great. fwiw @denisurbanavicius cost data for individuals on teams is available here:
https://claude.ai/api/claude_code/metrics_aggs/users?start_date=2026-04-01&end_date=2026-04-30&limit=10&offset=0&sort_by=total_lines_accepted&sort_order=desc&organization_uuid=<org uuid>&customer_type=claude_ai&subscription_type=teamInserting your org_uuid (and assuming you're logged in). This is the endpoint the Claude Code analytics dashboard uses, it does return course spend data that isn't currently rendered in the UI.
@chanian That worked! Thank you so much!
I've been able to fetch per user cost metrics via:
https://api.anthropic.com/v1/organizations/analytics/user_cost_reportYou can create an analytics API key which is different from the admin API key from claude.ai/analytics/api-keys.
EDIT: I also found this article. Seems like this endpoint has not been documented yet in the API reference or at least I did not find it.
@damyan-hristov-t212 Does your org have an Enterprise account? That api-keys provisioning page doesn't seem to exist on individual or teams account. If so, yes - these specific api endpoints are seemingly available to enterprise users only.
+1
+1 from a 123-person org on the Team plan.
We're building an internal AI-spend dashboard and want per-developer Claude Code metrics (sessions, LoC, commits, PRs, tokens) straight from the Claude Code Analytics API rather than inferring them from GitHub commit messages. The blocker is exactly this issue: our developers authenticate Claude Code via their claude.ai subscription seats (OAuth), and the
/v1/organizations/usage_report/claude_codeendpoint returns onlycustomer_type: "api"records — so our entire developer population is invisible to the API.The public docs list
customer_type: subscriptionanduser_actor(OAuth) as supported, which contradicts the behaviour reported here. Could you clarify whether subscription-seat coverage is (a) intended and buggy, or (b) intentionally Enterprise-only? For mid-sized orgs on Team this is the difference between having real Claude Code adoption data and having none.The risky part here is not just missing rows, but that the omission is silent. A usage dashboard consuming
GET /v1/organizations/usage_report/claude_codewill naturally read "no subscription/OAuth rows" as "zero usage", which is very different from "this population is not covered by this credential/API."A more robust contract would make coverage explicit:
included_customer_typesandexcluded_customer_types, with machine-readable reasons.customer_typeon every row.user_actoridentity for OAuth users, ideally email where the admin surface permits it, otherwise a stable hashed user id.source/coveragefields so consumers can distinguish API-key, subscription, Enterprise-only, unavailable, and partially-covered data.If subscription/OAuth Claude Code usage is intentionally unavailable for a given admin key, returning that as structured metadata, or as a
4xx/feature_not_enabledresponse, would be much safer than returning an empty-looking report.One implementation lesson from ax: local transcript and OTLP ingestion can recover useful per-machine analytics like sessions, tools, cost, latency, churn, and routing. But provider-side user/org identity and coverage boundaries are exactly the pieces local tooling cannot reconstruct reliably.
Concrete ask: either include subscription/OAuth Claude Code rows in this report, or make the response self-describing about why those users are excluded.
---
_Generated with ax._