Skip to content

Claude Code Analytics Admin API does not return subscription/OAuth users #27780

Description

@jbensamo

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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: Contains email_address for users who authenticate via OAuth (most common)
  • The customer_type field indicates whether the usage is from api customers (API PAYG) or subscription customers (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 subscription records 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

  1. Have org members authenticate to Claude Code via Claude.ai (OAuth/subscription)
  2. Use Claude Code throughout the day
  3. Query GET /v1/organizations/usage_report/claude_code?starting_at=<date> with an Admin API key
  4. Observe: only customer_type: "api" records appear; subscription users are missing

Previous Issues

Claude Model

Opus (claude-opus-4-6)

Claude Code Version

Latest

Platform

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions