Integrating with Anthropic
When you connect Anthropic to Drivetrain, your API key usage, token use, cost breakdown, and Claude Code activity sync for each workspace. You can then track and forecast AI spend next to the rest of your financials.
This guide walks you through creating an Anthropic Admin API key and adding Anthropic as a data source in Drivetrain.
Prerequisites
To connect Anthropic to Drivetrain, you need:
A Claude Console (formerly Anthropic Console) organization at platform.claude.com. Admin API keys aren't available for individual accounts.
Organization admin access. Only organization admins can create Admin API keys.
Access to your Drivetrain workspace with permission to add data sources.
What Drivetrain syncs from Anthropic
Once connected, Drivetrain pulls the following for each Anthropic workspace:
API key usage: activity for each API key in your organization.
Token usage: input and output tokens consumed.
Cost breakdown: what your organization is spending on the Claude API.
Claude Code activity: usage from Claude Code across your organization.
This data lands in Drivetrain as the following tables:
Cost Report
Billed cost in USD
Day, workspace, model, cost type and token type
Messages Usage
Input, output, cache write and cache read tokens
Day, API key, workspace and model
API Key Costs
Estimated cost in USD, calculated from token counts at Anthropic list prices
Day, API key, workspace and model
Claude Code Usage
Sessions, lines of code, commits, pull requests, tokens and estimated cost
Day, user or API key, terminal and model
API Keys
Name, status, workspace and creator of each API key
API key
Workspaces
Workspaces in your organization
Workspace
Users
Members of your organization and their roles
User
Usage and cost history syncs from January 1, 2024, and Claude Code history from February 1, 2025. After the first sync, Drivetrain pulls new data incrementally.
Anthropic Setup: Create an Admin API key
Drivetrain connects with an Admin API key, which starts with sk-ant-admin01-. A standard Claude API key (sk-ant-api03-...) doesn't have access to usage and cost data, so it won't work.
Step 1: Open Admin keys
Sign in to the Claude Console as an organization admin.
Click your profile in the bottom-left corner of the sidebar and select Organization settings.
In the Organization settings sidebar, click Admin keys.
Step 2: Create the key
Click + Create admin key to open the key creation dialog.
Enter a descriptive name, such as Drivetrain Integration.
Click Add to confirm.
Step 3: Copy and store the key
The Console shows the key only once. Copy it right away and store it somewhere secure. You'll paste it into Drivetrain in the next section.
Drivetrain Setup: Add Anthropic as a data source
Step 1: Open Data and add a source
In Drivetrain, go to Data in the left navigation, then click the + button to add a new data source.
Step 2: Select the Anthropic connector
In the Connect a data source window, search for Anthropic and select it under AI & LLM Cost.

Step 3: Enter your Admin API key
On the Connect your Anthropic account screen, paste the key you copied into the Admin API Key field, then click Submit.

Step 4: Confirm the connection
Anthropic now shows as a connected data source and starts syncing. Your usage and cost data appears in Drivetrain once the first sync finishes.
FAQ
Can I use a regular Claude API key instead of an Admin API key?
No. Only Admin API keys (starting with sk-ant-admin01-) can read your organization's usage and cost data. Standard API keys can't.
Does this connector include Claude.ai subscription costs?
No. The connector syncs Claude API usage and cost from your Claude Console organization. Claude.ai Pro, Team, and Enterprise seat costs aren't included.
Why do Claude Code session and line counts look too high when I add them up?
Claude Code Usage has one row per model, and each user's daily sessions, lines of code, commits, and pull requests repeat on every model row for that day. Take the maximum per user per day instead of the sum. Token and cost columns are per model, so you can add those up.
Can I connect more than one Anthropic organization?
Yes. Add a separate Anthropic data source for each organization, each with its own Admin API key.
Last updated
Was this helpful?
