VOOZH about

URL: https://platform.claude.com/docs/en/manage-claude/analytics-api

⇱ Analytics APIs - Claude API Docs


Analytics APIs
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Anthropic provides two analytics APIs, and which one you use depends on which Claude product your organization manages:

  • The Claude Code Analytics API reports daily Claude Code productivity metrics for organizations that use the Claude Platform. It is part of the Admin API and uses an Admin API key.
  • The Claude Enterprise Analytics API reports organization-wide engagement, adoption, and cost data across Claude products (chat, projects, Claude Code, and more) for Claude Enterprise organizations. It uses an Analytics API key created in claude.ai.

The two APIs use different key types, created in different places by different roles. This page describes which API fits your organization and how to create the right key.

Which API do you need?

APIKey typeCreated inWho can create itWhat it covers
Claude Code Analytics APIAdmin API key (sk-ant-admin01-...)Claude Console > Settings > Admin keysOrganization adminDaily Claude Code metrics per user: sessions, lines of code, commits, pull requests, tool acceptance, and estimated cost by model
Claude Enterprise Analytics APIAnalytics API keyclaude.ai > Organization settings > APIPrimary ownerOrganization-wide engagement and adoption (user activity, active-user summaries, project, skill, and connector usage), plus cost and usage reports

The key types are not interchangeable: an Admin API key cannot call the Claude Enterprise Analytics API, and an Analytics API key cannot call the Admin API. Both APIs appear under the Admin API reference, but they are separate APIs with separate key types. If your organization uses both the Claude Platform and Claude Enterprise, you can provision both keys and use each API for its own data.

Looking for API usage and cost data rather than product analytics? See the Usage and Cost API, which explains the right path for both Claude Console and Claude Enterprise organizations.

Get access to the Claude Code Analytics API

The Claude Code Analytics API is available to every organization with access to the Admin API, and is free to use.

  1. Sign in as an organization admin

    Only organization members with the admin role can create Admin API keys. See Organization roles and permissions for the full role list.

  2. Create an Admin API key

    Go to Claude Console > Settings > Admin keys, click Create key, name the key, and click Create. Copy the displayed secret key (starting with sk-ant-admin01-) and store it in your secrets manager. The full secret is displayed only once.

  3. Call the API

    Pass the key in the x-api-key header:

    curl "https://api.anthropic.com/v1/organizations/usage_report/claude_code?starting_at=2025-09-08" \
     --header "anthropic-version: 2023-06-01" \
     --header "x-api-key: $ADMIN_API_KEY"

For the available metrics, request parameters, and response schema, see the Claude Code Analytics API guide and the API reference.

Get access to the Claude Enterprise Analytics API

The Claude Enterprise Analytics API is available to Claude Enterprise organizations. Engagement and adoption data is available on all Enterprise plans. The cost and usage endpoints apply to usage-based Enterprise plans; for seat-based Enterprise plans, they reflect usage credits only.

  1. Sign in as the primary owner

    Only the primary owner of the organization can enable API access and create Analytics API keys.

  2. Enable API access and create a key

    Go to claude.ai > Organization settings > API and enable public API access, then create an Analytics API key. Keys carry the read:analytics scope. Copy the displayed secret and store it in your secrets manager.

  3. Call the API

    Pass the key in the x-api-key header. Endpoints live under https://api.anthropic.com/v1/organizations/analytics/. For request examples, parameters, and response schemas, see the Claude Enterprise Analytics API reference.

The Claude Enterprise Analytics API provides:

  • User activity: per-user daily metrics across chat (conversations, messages, projects, files, artifacts), Claude Code (sessions, commits, pull requests, lines of code, tool actions), and other Claude products
  • Activity summaries: organization-level daily, weekly, and monthly active users, seat counts, and pending invites
  • Project, skill, and connector usage: adoption breakdowns for chat projects, skills, and connectors
  • Cost and usage reports: per-user and organization-level token usage and cost over time (usage-based Enterprise plans)

For an overview of the engagement and adoption data, see Claude Enterprise Analytics API: access, engagement, and adoption data. For endpoint details, parameters, and response schemas, see the Claude Enterprise Analytics API reference.

Next steps

Claude Code Analytics API

Track Claude Code sessions, code changes, and tool usage with an Admin API key.

Usage and Cost API

Track API token usage and costs for your organization.

Claude Enterprise Analytics API reference

Endpoint reference for engagement, adoption, and cost data.

Get access to the Compliance API

Audit and compliance data uses its own key types.

Was this page helpful?