Claude Code API Integration

Last updated: September 23, 2026

Overview

Span supports ingesting Claude Code usage data directly via the Anthropic API, providing an alternative to the previously used OpenTelemetry (OTel) instrumentation approach.

Integrating Claude via API

  1. Generate a new Admin API key (See more details here: https://platform.claude.com/docs/en/build-with-claude/administration-api)

  2. Go to Settings -> Integrations in Span

  3. Find the Claude Code integration card under Available integrations and click "Connect"

  4. Set your Admin API key and click to save the connection

What Data Is Available?

The Anthropic API integration provides base usage metrics — 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.

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.


Summary

Feature

API 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)