Programmatically access your organization's Claude Code usage analytics and productivity metrics with the Claude Code Analytics Admin API.
The Claude Code Analytics Admin API provides programmatic access to daily aggregated usage metrics for Claude Code users, enabling organizations to analyze developer productivity and build custom dashboards. This API provides more detail than the basic Analytics dashboard without the complexity of the OpenTelemetry integration.
This API enables you to better monitor, analyze, and optimize your Claude Code adoption:
Developer productivity analysis: Track sessions, lines of code added/removed, commits, and pull requests created using Claude Code
Tool usage metrics: Monitor acceptance and rejection rates for different Claude Code tools (Edit, MultiEdit, Write, NotebookEdit)
Cost analysis: View estimated costs and token usage broken down by Claude model
Custom reporting: Export data to build executive dashboards and reports for management teams
Usage justification: Provide metrics to justify and expand Claude Code adoption internally
Quick start
Get your organization's Claude Code analytics for a specific day:
Track Claude Code usage, productivity metrics, and developer activity across your organization with the /v1/organizations/usage_report/claude_code endpoint.
Key concepts
Daily aggregation: Returns metrics for a single day specified by the starting_at parameter
User-level data: Each record represents one user's activity for the specified day
Productivity metrics: Track sessions, lines of code, commits, pull requests, and tool usage
Token and cost data: Monitor usage and estimated costs broken down by Claude model
Cursor-based pagination: Handle large datasets with stable pagination using opaque cursors
Data freshness: Metrics are available with up to 1-hour delay for consistency