Anthropic¶
Anthropic is an AI safety company that builds Claude, a family of large language models. This source enables you to extract comprehensive data from the Anthropic Admin API, including Claude Code usage metrics, API usage reports, cost data, and organization management information.
URI Format¶
The URI format for Anthropic is:
anthropic://?api_key=<admin_api_key>
URI Parameters:¶
api_key(required): Your Anthropic Admin API key (must start withsk-ant-admin...)
This source requires an Admin API key which is different from standard API keys. Only organization members with the admin role can provision Admin API keys through the Anthropic Console.
The Admin API is unavailable for individual accounts. To use this source, you must have an organization set up in Console → Settings → Organization.
Available Tables¶
claude_code_usage¶
The claude_code_usage table contains daily aggregated usage metrics for Claude Code users in your organization. This data helps you analyze developer productivity and monitor Claude Code adoption.
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
Date in RFC 3339 format (UTC timestamp) |
|
|
Type of actor ( |
|
|
Email address for users or API key name for API actors |
|
|
Organization UUID |
|
|
Type of customer account ( |
|
|
Terminal/environment where Claude Code was used (e.g., |
|
|
Number of distinct Claude Code sessions |
|
|
Total lines of code added across all files |
|
|
Total lines of code removed across all files |
|
|
Number of git commits created through Claude Code |
|
|
Number of pull requests created through Claude Code |
|
|
Number of Edit tool proposals accepted |
|
|
Number of Edit tool proposals rejected |
|
|
Number of MultiEdit tool proposals accepted |
|
|
Number of MultiEdit tool proposals rejected |
|
|
Number of Write tool proposals accepted |
|
|
Number of Write tool proposals rejected |
|
|
Number of NotebookEdit tool proposals accepted |
|
|
Number of NotebookEdit tool proposals rejected |
|
|
Total input tokens across all models |
|
|
Total output tokens across all models |
|
|
Total cache read tokens across all models |
|
|
Total cache creation tokens across all models |
|
|
Total estimated cost in cents USD |
|
|
Comma-separated list of Claude models used |
usage_report¶
The usage_report table contains detailed token usage metrics from the Messages API, aggregated by time bucket, workspace, API key, model, and service tier.
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
Time bucket in ISO 8601 format |
|
|
API key identifier |
|
|
Workspace identifier |
|
|
Claude model used |
|
|
Service tier (scale or default) |
|
|
Number of input tokens |
|
|
Number of output tokens |
|
|
Number of cached input tokens |
|
|
50th percentile first response latency in milliseconds |
|
|
95th percentile first response latency in milliseconds |
|
|
99th percentile first response latency in milliseconds |
|
|
50th percentile total latency in milliseconds |
|
|
95th percentile total latency in milliseconds |
|
|
99th percentile total latency in milliseconds |
|
|
Number of API requests |
|
|
Number of server tool searches |
|
|
Number of server tool results |
cost_report¶
The cost_report table contains aggregated cost data broken down by workspace and cost description.
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
Time bucket in ISO 8601 format |
|
|
Workspace identifier |
|
|
Cost description (e.g., “Usage - claude-3-5-sonnet-20241022”) |
|
|
Cost amount in cents USD |
organization¶
The organization table contains information about your Anthropic organization.
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
Organization UUID |
|
|
Organization name |
|
|
Organization settings (JSON) |
|
|
Creation timestamp |
workspaces¶
The workspaces table contains all workspaces in your organization.
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
Workspace UUID |
|
|
Workspace name |
|
|
Workspace type (default or custom) |
|
|
Creation timestamp |
api_keys¶
The api_keys table contains all API keys in your organization.
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
API key UUID |
|
|
API key name |
|
|
API key status (active or disabled) |
|
|
Creation timestamp |
|
|
Associated workspace UUID |
|
|
User who created the key |
|
|
Last usage timestamp |
invites¶
The invites table contains all pending organization invites.
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
Invite UUID |
|
|
Invitee email address |
|
|
Invited role (admin or member) |
|
|
Expiration timestamp |
|
|
List of workspace UUIDs |
|
|
Creation timestamp |
|
|
User who created the invite |
users¶
The users table contains all users in your organization.
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
User UUID |
|
|
User email address |
|
|
User full name |
|
|
User role (admin or member) |
|
|
Creation timestamp |
|
|
Last login timestamp |
workspace_members¶
The workspace_members table contains workspace membership information.
Schema¶
Column |
Type |
Description |
|---|---|---|
|
|
Workspace UUID |
|
|
User UUID |
|
|
Role in workspace |
|
|
When user was added to workspace |
Examples¶
Basic Usage¶
Load all Claude Code usage data to a DuckDB database:
omniload ingest \
--source-uri "anthropic://?api_key=sk-ant-admin-..." \
--source-table "claude_code_usage" \
--dest-uri "duckdb:///anthropic_data.db" \
--dest-table "claude_code_usage"
Incremental Loading¶
Load data incrementally starting from a specific date:
omniload ingest \
--source-uri "anthropic://?api_key=sk-ant-admin-..." \
--source-table "claude_code_usage" \
--dest-uri "postgresql://user:password@localhost:5432/analytics" \
--dest-table "claude_code_usage" \
--interval-start "2024-01-01" \
--interval-end "2024-12-31"
Load to BigQuery¶
omniload ingest \
--source-uri "anthropic://?api_key=sk-ant-admin-..." \
--source-table "claude_code_usage" \
--dest-uri "bigquery://project-id.dataset" \
--dest-table "claude_code_usage"
Load Organization Data¶
omniload ingest \
--source-uri "anthropic://?api_key=sk-ant-admin-..." \
--source-table "organization" \
--dest-uri "duckdb:///anthropic_data.db" \
--dest-table "organization"
Load Usage Report¶
omniload ingest \
--source-uri "anthropic://?api_key=sk-ant-admin-..." \
--source-table "usage_report" \
--dest-uri "postgresql://user:password@localhost:5432/analytics" \
--dest-table "api_usage" \
--interval-start "2024-01-01" \
--interval-end "2024-12-31"
Load Cost Report¶
omniload ingest \
--source-uri "anthropic://?api_key=sk-ant-admin-..." \
--source-table "cost_report" \
--dest-uri "duckdb:///costs.db" \
--dest-table "anthropic_costs"
Load All Users and Workspaces¶
# Load users
omniload ingest \
--source-uri "anthropic://?api_key=sk-ant-admin-..." \
--source-table "users" \
--dest-uri "duckdb:///org_data.db" \
--dest-table "users"
# Load workspaces
omniload ingest \
--source-uri "anthropic://?api_key=sk-ant-admin-..." \
--source-table "workspaces" \
--dest-uri "duckdb:///org_data.db" \
--dest-table "workspaces"
# Load workspace members
omniload ingest \
--source-uri "anthropic://?api_key=sk-ant-admin-..." \
--source-table "workspace_members" \
--dest-uri "duckdb:///org_data.db" \
--dest-table "workspace_members"
Incremental Loading¶
The following tables support incremental loading:
claude_code_usage- incremental based on thedatefieldusage_report- supports date range filtering with--interval-startand--interval-endcost_report- supports date range filtering with--interval-startand--interval-end
Other tables (organization, workspaces, api_keys, invites, users, workspace_members) use full refresh mode as they represent current state data.
When running incremental loads:
The source tracks the last loaded date for
claude_code_usageSubsequent runs will only fetch new data
Use
--interval-startand--interval-endto specify a custom date rangeDefault start date is January 1, 2023
Use Cases¶
Developer Productivity Analysis¶
Track how your team uses Claude Code:
Monitor adoption rates across different teams
Analyze code generation patterns
Track tool acceptance rates
Cost Monitoring¶
Monitor Claude Code costs:
Track token usage by user and model
Analyze spending patterns
Allocate costs by team or project
Executive Dashboards¶
Create reports showing:
Claude Code impact on development velocity
Lines of code generated vs. manual coding
Commit and PR creation metrics
API usage patterns across workspaces
Cost allocation by team and project
Organization Management¶
Monitor and audit your organization:
Track user access and permissions
Monitor API key usage and lifecycle
Audit workspace memberships
Track pending invites and onboarding
Data Freshness¶
Claude Code analytics data typically appears within 1 hour of user activity completion. The API provides daily aggregated metrics only.
Rate Limits¶
The Anthropic Admin API has rate limits in place. The source handles pagination automatically and respects these limits.
Notes¶
This source only tracks Claude Code usage on the Anthropic API (1st party)
Usage on Amazon Bedrock, Google Vertex AI, or other third-party platforms is not included
All dates and timestamps are in UTC
The source requires organization-level access (not available for individual accounts)
Available Tables Summary¶
Table |
Incremental |
Primary Key |
Description |
|---|---|---|---|
|
✅ |
date, actor_type, actor_id, terminal_type |
Daily Claude Code usage metrics |
|
Date Range |
bucket, api_key_id, workspace_id, model, service_tier |
API usage and latency metrics |
|
Date Range |
bucket, workspace_id, description |
Cost breakdown by workspace |
|
❌ |
- |
Organization information |
|
❌ |
id |
Workspace list |
|
❌ |
id |
API key management |
|
❌ |
id |
Pending invitations |
|
❌ |
id |
User list |
|
❌ |
workspace_id, user_id |
Workspace memberships |
For feature requests or issues, please create a GitHub issue at https://github.com/panodata/omniload