View all connectors

Claude Code

By integrating Claude Code with DX, you can analyze AI coding assistant usage metrics, including daily user metrics, tool acceptance rates, model breakdowns, and overall developer productivity insights.

DX imports Claude Code metrics using the Claude Code Analytics API. The data available in DX is restricted to what this API endpoint provides, including daily aggregated user activity, productivity metrics, tool usage statistics, and model-specific token consumption and costs.

Note: This integration only captures data from Claude Code workspaces. The Claude Code Analytics API specifically tracks usage within Claude Code workspace environments, as designed by Anthropic’s claude-code-analytics-api implementation.

Please refer to the API documentation below and our schema explorer to see what data DX imports.

Prerequisites

To connect Claude Code to DX, you need:

  • an Anthropic account with organization-level access
  • administrative access to your Anthropic organization settings
  • an Anthropic Admin API key with usage data permissions

Setup instructions

Follow the steps below to connect Claude Code to DX.

Step 1

Log in to your Anthropic organization dashboard and navigate to your organization’s API settings.

Step 2

Go to the API Keys section within your organization settings.

Step 3

Generate a new Admin API key. Ensure the key has permissions to access daily usage data for your organization.

Step 4

Copy the generated Admin API key and store it securely.

Step 5

  • Navigate to the connections page in DX and select “+ Connection” in the top right.
  • Select “Claude Code” as the connector type.
  • Enter your Admin API key in the credentials field.
  • Test the connection to ensure proper authentication.

API reference

The table below lists the specific API endpoints that are used by DX.

Endpoint Documentation
GET /v1/organizations/usage_report/claude_code Link
GET /v1/organizations/users Link

Testing your connection

You can test the Claude Code Analytics API endpoint directly using the following curl command:

curl "https://api.anthropic.com/v1/organizations/usage_report/claude_code?starting_at=2025-10-01&limit=20" \
  --header "anthropic-version: 2023-06-01" \
  --header "x-api-key: YOUR_ADMIN_API_KEY"

Replace YOUR_ADMIN_API_KEY with your actual Admin API key and adjust the starting_at date to a recent date when you expect Claude Code activity. A successful response will return usage data, while an empty data array indicates no Claude Code usage activity for that date.

Errors

The table below lists potential error codes when adding a connection in DX.

Error Description
invalid_credentials Your Admin API key is not valid or has expired.
invalid_permissions Your Admin API key does not have permissions to access organization usage data.
no_resources No Claude Code usage activity was found for your organization. This can occur if Claude Code has not been used yet or if there is no recent usage data available.