Choosing the right Claude Code Integration
Last updated: October 29, 2026
Span can read Claude Code data three ways: the Claude Code API connection, the Claude Code Enterprise connection, and agent traces. Which one you need depends on your Anthropic plan.
Why it matters
Each source covers different accounts. Pick the wrong one and some developers never appear in Tool utilization or AI Spend, even though they use Claude Code every day. This article helps you choose, explains how the sources combine, and shows how to confirm the data is arriving for every developer.
How it works
Claude Code API | Claude Code Enterprise | Agent traces | |
|---|---|---|---|
Best for | Organizations on Anthropic's API plan (usage-billed, no per-seat license) | Organizations on Claude Enterprise | Detailed session data, and developers on plans the two connections don't cover |
How it connects | Admin API key from the Claude Console, entered in Span settings | Analytics API key with the | A small agent on each developer machine, pushed through MDM |
Team, Max, and individual plans | Not covered | Not covered | Covered |
Usage in Tool utilization | Yes | Yes | Yes |
Spend in AI Spend | Overage only | Base and overage | No |
History | Up to 1 year | From January 1, 2026 at the earliest | From installation onward |
Claude Code API reads Anthropic's daily Claude Code usage report: sessions, lines added and removed, commits and pull requests by Claude Code, and estimated cost per model. It covers API users only. See Claude Code API Integration.
Claude Code Enterprise reads Claude Enterprise analytics: per-person sessions, lines, commits, and pull requests, plus token usage and cost by product and model. It is the only source of Claude Code base spend (seat cost). It also includes Claude.ai chat, which Span counts under Claude Code, and Claude Cowork, which Span shows separately.
Agent traces record each Claude Code session on the developer's machine through Claude Code's hooks and local transcripts, then join sessions to pull requests. They feed Tool utilization and the AI Effectiveness pages. See Understanding Agent Traces in Span (auspex).
When sources overlap, Span keeps one row per person, tool, and day:
If Claude Code API and Claude Code Enterprise both report the same person and day, Enterprise wins.
If agent traces cover a person and day, Tool utilization uses the trace data for that day and fills other days from the connections.
Span's OpenTelemetry endpoint is deprecated. Span used to collect Claude Code's OpenTelemetry metrics at otel.span.app. No Span report reads from it anymore. Tool utilization reads Claude Code data from the two connections and agent traces. AI Spend reads only the two connections. Agent traces are not the same thing as Claude Code's OpenTelemetry export: they record sessions rather than metric counters.
Setup
Claude Code API
Have an organization admin create an Admin API key in the Claude Console (it starts with
sk-ant-admin).In Span, go to Settings → Integrations, find Claude Code API, click Connect, and paste the key into Admin API Key.
Claude Code Enterprise
Have a Primary Owner create an API key with the
read:analyticsscope at claude.ai/analytics/api-keys.In Span, go to Settings → Integrations, find Claude Code Enterprise, click Connect, and paste the key into Analytics API Key.
Optional: under AI Spend Integration Settings, set your Enterprise price per developer (default $18) and billing date.
Agent traces
Your Span team walks you through the install. Claude Code needs version 2.1.139 or later, or 2.1.242 or later if you use Claude Code remote settings.
Moving off the OpenTelemetry endpoint
Connect Claude Code API or Claude Code Enterprise (or both) using the steps above.
Remove
otel.span.appand theX-Span-Tokenheader from your Claude Code OpenTelemetry settings. If you want to keep the raw metrics for your own reporting, point the export at your own OpenTelemetry Collector instead. It doesn't affect Span.
Rotate a key
You can replace the key on an existing connection without disconnecting it, so your history stays in place.
Create the new key in Anthropic (Claude Console for Claude Code API, claude.ai/analytics/api-keys for Claude Code Enterprise).
In Span, go to Settings → Integrations and open the connection.
Open the ⋮ menu on the connection, choose Edit, and paste the new key. Span checks the key with Anthropic before saving it.
Revoke the old key in Anthropic.
Verify the data
Go to Settings → Integrations. Each connected integration shows a health indicator; hover over it to see when data last arrived.
Open AI Effectiveness → AI insights → Tool utilization and click Integrations near the top of the page. Select Claude Code to see the status of each Claude connection.
Check the People tabs. Active lists people seen in the data recently. Missing lists people in Span who haven't appeared. Unknown lists emails or API keys that match no one in Span. Change the time window to look further back.
For a missing person, compare the email they sign in to Claude with the email on their Span record, or add their API key name to their record.
Things to know
Emails must match. Both connections match people by email (the Claude Code API also matches API key names). A developer who signs in to Claude with a personal or alias email lands in Unknown.
Chat counts as Claude Code activity with Enterprise. A person who only uses Claude.ai chat appears as an active Claude Code user when you connect Claude Code Enterprise.
The API connection can't see subscription users. Enterprise, Team, Max, and individual users don't appear in Anthropic's API usage report.
Spend needs a connection. Agent traces add usage, not AI Spend totals. For seat cost, connect Claude Code Enterprise.
OpenTelemetry data sent to Span isn't used. If Claude Code is still exporting to
otel.span.app, that data doesn't reach Tool utilization or AI Spend. Connect one of the two connections to see Claude Code usage in Span.Worked example. A developer appears in both your Claude Code API and Claude Code Enterprise data on March 3, with $5.00 of cost in each. Span counts $5.00 from Enterprise for that day, not $10.00. On March 4 only the API reports them, with $2.50, so Span counts the $2.50 from the API.
Related articles
Understanding Agent Traces in Span (auspex)
auspex: Claude Code Remote Settings and Managed Hooks (macOS)
Need help?
Contact your Span account team or reach out to support@span.app.