Skip to content

feat(claude_code): support Claude Console organizations via usage_report/claude_code endpoint#8978

Open
salim8898 wants to merge 1 commit into
apache:mainfrom
salim8898:feat/claude-console-api-support
Open

feat(claude_code): support Claude Console organizations via usage_report/claude_code endpoint#8978
salim8898 wants to merge 1 commit into
apache:mainfrom
salim8898:feat/claude-console-api-support

Conversation

@salim8898

Copy link
Copy Markdown

Support Claude Console organizations in the Claude Code plugin.

Claude Console (platform.claude.com) Admin API keys (sk-ant-admin01-...) use a different analytics endpoint than Claude Enterprise (claude.ai) keys. Previously, the plugin only called the Enterprise endpoints (/v1/organizations/analytics/users, /v1/organizations/analytics/summaries, /v1/organizations/analytics/connectors), which require read:analytics scope. Console Admin keys have full access but to a different endpoint: /v1/organizations/usage_report/claude_code.

This PR detects the key type from its prefix at runtime:

  • sk-ant-admin01-... (Console) → calls v1/organizations/usage_report/claude_code with starting_at query param, parses the Console response schema
  • sk-ant-api01-... (Enterprise) → existing behavior unchanged

For Console orgs, CollectActivitySummary and CollectConnectorUsage are skipped gracefully since those endpoints have no Console equivalent. All Claude Code core metrics (sessions, commits, PRs, lines of code, tool actions) are available in the Console API and mapped to the existing ClaudeCodeUserActivity model. Chat metrics are 0 for Console users.
Does this close any open issues: #8977

Other Information:
Anthropic documentation references:

@salim8898 salim8898 changed the title feat:allow claude organization support feat(claude_code): support Claude Console organizations via usage_report/claude_code endpoint Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant