Claude Code API Integration
Last updated: April 6, 2026
Overview
Span supports ingesting Claude Code usage data directly via the Anthropic API, providing an alternative to (or complement to) the OpenTelemetry (OTel) instrumentation approach.
Integrating Claude via API
Generate a new Admin API key (See more details here: https://platform.claude.com/docs/en/build-with-claude/administration-api)
Go to Settings -> Integrations in Span
Find the Claude Code integration card under Available integrations and click "Connect"
Set your Admin API key and click to save the connection
What Data Is Available?
The Anthropic API integration provides the same usage data as the OTel integration — including AI code suggestions, acceptance rates, and related activity metrics — with the limitations noted in the Supported Accounts section below.
Supported Accounts
The API integration supports:
API users — accounts billed on a usage/API basis (i.e., without a subscription plan)
Non-personal (organizational) accounts — consistent with our other API-based integrations
Individual/personal accounts: If you need to track individual personal accounts, please use the OTel integration instead. Personal accounts are not accessible via the Anthropic API, but are fully supported through OTel.
Using Both API and OTel Together
If your organization uses both integrations simultaneously, data is handled gracefully — there is no conflict. Span deduplicates and normalizes data using the following priority rule:
For each (email, date) combination, API data takes precedence over OTel data. OTel data is used as a fallback when API data is not available.
This means you can safely run both integrations in parallel without risking duplicate or inconsistent metrics.
Historical Data / Backfill
The Anthropic API integration supports backfilling historical data up to 1 year back from the time of setup.
Known Limitations: Subscription-Based Accounts
⚠ Important: If your organization has a subscription-based Anthropic plan (i.e., a license cost is associated with your Claude usage), data may be incomplete or unavailable through the API integration. This is a known bug on Anthropic's side, and the timeline for a fix is currently unknown.
Our recommendation: Organizations with subscription-based Anthropic plans should also set up the OTel integration to ensure complete data coverage. The two integrations work complementarily — OTel data will automatically fill in any gaps not covered by the API.
Summary
Feature | API Integration | OTel Integration |
Same metrics as OTel | ✅ | ✅ |
Organizational accounts | ✅ | ✅ |
Personal/individual accounts | ❌ | ✅ |
Subscription-based accounts | ⚠ Limited (Anthropic bug) | ✅ |
Historical backfill | ✅ Up to 1 year | ❌ |
Can run alongside OTel | ✅ (API takes priority) | ✅ |
Recommendation
For API-billed organizations: The Anthropic API integration is the easiest path to full coverage. OTel can be added for individual accounts.
For subscription-billed organizations: Set up both integrations to maximize coverage until the Anthropic API limitation is resolved.