Connect Claude Code using the Analytics API
Connect Claude Code to LinearB using Anthropic’s Analytics API to collect organization-level usage and adoption data for Claude Enterprise.
Overview
Connect Claude Code to LinearB using Anthropic’s Analytics API to collect Claude Enterprise usage and adoption data.
Use this connection when your organization has a Claude Enterprise license
and can provide an Anthropic API key with
read:analytics access.
Data Provided by the Analytics API
Depending on the data returned by Anthropic, the Analytics API integration can provide:
- Organization-level Claude usage summaries
- User-level usage summaries
- Claude adoption and activity reporting
- Token usage by model
- Estimated consumption by model
Adoption and accepted-lines data appears in AI Analytics.
When available through the Analytics API, model, token, and estimated-consumption data is available through Metrics Builder.
Data Availability and Collection Cadence
- Anthropic documents a three-day delay for Analytics API data.
- Available Analytics API data begins from January 1, 2026.
- Recent activity does not appear in real time.
- Available history depends on Anthropic’s Analytics API retention and availability.
Before You Begin
Verify that you have:
- Access to AI Tools settings in LinearB.
- A Claude Enterprise license.
- Primary Owner or equivalent administrative access in Anthropic.
-
An Anthropic API key with
read:analyticsaccess.
Create an Analytics API Key
- Sign in to the Anthropic administration environment.
- Create or retrieve an API key for Analytics API access.
-
Confirm that the key includes the
read:analyticsscope. - Copy and securely store the key.
Connect Claude Code in LinearB
- Go to Settings → Company Settings → AI Tools → Integrations.
- Click Add New.
- Select Claude Code.
- Click Continue.
- Select Analytics API.
- Click Continue.
- Paste the Anthropic Analytics API key into the Token field.
- Click Connect.
LinearB validates the API key and configuration. When validation succeeds, Claude Code — Analytics API appears in the Connected list.
Verify the Connection
- Open Settings → Company Settings → AI Tools → Integrations.
- Select Connected.
- Select Claude Code — Analytics API.
- Confirm that the integration status is Connected.
- Allow for Anthropic’s documented data delay.
- Open AI Analytics or Metrics Builder and confirm that Claude data appears.
Edit the Analytics API Integration
Use Edit mode to replace the Anthropic Analytics API key without disconnecting the integration.
- Open Settings → Company Settings → AI Tools → Integrations.
- Select Connected.
- Select Claude Code — Analytics API.
- Under Main Settings, click Edit.
- Update the Anthropic Analytics API key in the Token field.
- Click Save changes to apply the update or Cancel to discard it.
What happens to historical data?
Editing the Analytics API integration does not delete previously collected Claude Code metrics.
- Saving an API-key change triggers a new collection.
- LinearB can recollect up to 90 days of recent Analytics API data, subject to Anthropic’s data availability.
- Recollected records are updated in place and are not counted twice.
- Data older than the recollection window remains unchanged.
Disconnect or Reconnect
Disconnecting the integration stops new Analytics API collection and moves it to the Disconnected list. Previously collected data is preserved.
Disconnect the integration
- Open Settings → Company Settings → AI Tools → Integrations.
- Select Connected.
- Select Claude Code — Analytics API.
- Click Disconnect.
- Confirm the action.
Reconnect the integration
- Open Settings → Company Settings → AI Tools → Integrations.
- Select Disconnected.
- Select Claude Code — Analytics API.
- Click Reconnect.
- Enter a replacement Analytics API key if the saved key has expired or been revoked.
- Complete validation to restore the integration.
LinearB validates the API key and saved configuration before restoring the integration.
read:analytics access and enter it during
the reconnect flow. You do not need to create another Analytics API
integration.
Learn more:
Troubleshooting
Connection Error
If the integration displays a connection error:
- Confirm that the API key is still valid.
-
Verify that the key includes the
read:analyticsscope. - Confirm that the Anthropic organization has a Claude Enterprise license.
- Verify that the key was created by a Primary Owner or equivalent administrator.
- Confirm that you selected Analytics API as the connection type.
- Select the integration, click Edit, enter the replacement key, and click Save changes.
No Analytics Data Appears
- Allow for Anthropic’s documented three-day data delay.
- Confirm that users are actively using Claude in the connected organization.
- Verify that the expected activity occurred on or after January 1, 2026.
- Confirm that Anthropic is returning analytics data for the expected users and dates.
- Confirm that the integration appears under Connected without an error indicator.
Recent Activity Is Missing
Analytics API data is delayed and should not be treated as near-real-time telemetry. For more immediate collection, review the OpenTelemetry connection method.
Known Limitations
- Analytics API data has a documented delay.
- Available analytics data begins from January 1, 2026.
- The integration is intended for usage and adoption summaries rather than detailed tool-event telemetry.
- Available metrics depend on the data returned by Anthropic.
Related Articles
How did we do?
Connect Claude Code using the Admin API
Connect Cursor to LinearB