Skip to main content

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.

Steven Silverstone
Updated by Steven Silverstone

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.

Connection limit: Only one active Claude Code Analytics API integration can be connected at a time. A failing Analytics API integration still counts as active.

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.

Estimated consumption is not a billing total. Vendor plans, discounts, credits, negotiated pricing, and pricing changes can cause the estimate to differ from the provider’s invoice.

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.
Note: The Analytics API is intended for usage and adoption reporting. It does not provide the same near-real-time collection as OpenTelemetry.

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:analytics access.
Security: Treat the API key like a password and store it securely. You may not be able to view it again after it is created.

Create an Analytics API Key

  1. Sign in to the Anthropic administration environment.
  2. Create or retrieve an API key for Analytics API access.
  3. Confirm that the key includes the read:analytics scope.
  4. Copy and securely store the key.
Note: Claude Code connection types have different validation requirements. A key created for another Claude Code connection may not work with the Analytics API.

Connect Claude Code in LinearB

  1. Go to Settings → Company Settings → AI Tools → Integrations.
  2. Click Add New.
  3. Select Claude Code.
  4. Click Continue.
  5. Select Analytics API.
  6. Click Continue.
  7. Paste the Anthropic Analytics API key into the Token field.
  8. Click Connect.

LinearB validates the API key and configuration. When validation succeeds, Claude Code — Analytics API appears in the Connected list.

Duplicate integrations: If another active Analytics API integration already exists, disconnect it before connecting another one.

Verify the Connection

  1. Open Settings → Company Settings → AI Tools → Integrations.
  2. Select Connected.
  3. Select Claude Code — Analytics API.
  4. Confirm that the integration status is Connected.
  5. Allow for Anthropic’s documented data delay.
  6. 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.

  1. Open Settings → Company Settings → AI Tools → Integrations.
  2. Select Connected.
  3. Select Claude Code — Analytics API.
  4. Under Main Settings, click Edit.
  5. Update the Anthropic Analytics API key in the Token field.
  6. Click Save changes to apply the update or Cancel to discard it.
Permissions: Anyone who has access to AI Tools settings can edit the integration. No additional LinearB permission is required specifically for the Edit action.

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.
Note: Anthropic’s documented data delay still applies after an edit. Recently generated activity may not appear immediately.

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

  1. Open Settings → Company Settings → AI Tools → Integrations.
  2. Select Connected.
  3. Select Claude Code — Analytics API.
  4. Click Disconnect.
  5. Confirm the action.

Reconnect the integration

  1. Open Settings → Company Settings → AI Tools → Integrations.
  2. Select Disconnected.
  3. Select Claude Code — Analytics API.
  4. Click Reconnect.
  5. Enter a replacement Analytics API key if the saved key has expired or been revoked.
  6. Complete validation to restore the integration.

LinearB validates the API key and saved configuration before restoring the integration.

Note: If the saved API key is no longer valid, create a replacement key with 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:analytics scope.
  • 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.

How did we do?

Connect Claude Code using the Admin API

Connect Cursor to LinearB

Contact