Overview
The Usage Tracking API provides visibility into token consumption, costs, and usage patterns across all Claude accounts. You can retrieve summary statistics, historical usage data, and per-window breakdowns.All Usage endpoints require dashboard authentication via session cookie.
Get Usage Summary
Retrieve aggregated usage statistics including current window state, costs, and key metrics.
Response
Primary (daily) usage window aggregate
Secondary (weekly) usage window aggregate (if applicable)
Cost metrics
Usage metrics
Example Request
Example Response
Get Usage History
Retrieve historical usage data per account over a specified time window.
Query Parameters
Number of hours to look back (1-168). Default is 24 hours.
Response
The number of hours covered by this response
Array of per-account usage history
Example Request
Example Response
Get Usage Window
Retrieve current usage breakdown by window (primary or secondary) for all accounts.
Query Parameters
Which window to query:
primary (daily) or secondary (weekly)Response
The window type queried (
primary or secondary)Window duration in minutes
Array of per-account usage in this window (same structure as history endpoint)
Example Request
Example Response
Usage Windows
Claude accounts have two usage windows:Primary Window (Daily)
- Resets every 24 hours
- Typically more restrictive quota
- Used for short-term rate limiting
window_minutes: 1440
Secondary Window (Weekly)
- Resets every 7 days
- Larger quota for sustained usage
- Used for longer-term capacity planning
window_minutes: 10080
usage_weighted strategy.
Usage Metrics Explained
Credits vs Tokens
- Credits: Abstract capacity units used by Claude. Not directly equivalent to tokens.
- Tokens: Actual text units processed (input + output)
- Cached Tokens: Input tokens served from prompt cache
Cost Tracking
Costs are calculated based on:- Model pricing (varies by model)
- Token counts (input, output, cached)
- Any reasoning effort multipliers
totalUsd7d field aggregates costs across all accounts for the past 7 days.
Error Rate
TheerrorRate7d metric shows the percentage of requests that resulted in errors over the past week. Common error types:
overloaded_error: Claude API is overloadedrate_limit_error: Account quota exceededinvalid_request_error: Malformed request
top_error field shows the most frequent error message, helping identify systemic issues.
Aggregation Logic
Summary Endpoint
The summary endpoint aggregates across all active accounts:- remaining_percent: Weighted average based on capacity
- capacity_credits: Sum of all account capacities
- remaining_credits: Sum of remaining credits across accounts
- reset_at: Earliest reset time across accounts (primary window)
History Endpoint
Historical data is sampled at regular intervals. Theremaining_percent_avg represents the average remaining capacity over the requested time window.
Use Cases
Capacity Planning
Monitor primary and secondary window usage to predict when you’ll need additional accounts.
Cost Management
Track 7-day costs to stay within budget and identify expensive models or usage patterns.
Health Monitoring
Watch error rates and top errors to detect API issues or configuration problems.
Load Distribution
Use per-account history to verify load balancing is working as expected.