v51

OpenAPI 3.1.0raw.githubusercontent.com2026-08-018486293.2 KB
usage

Usage Summary

Aggregate spend, tokens, and request volume for the dashboard Usage page.

Range-bounded (default last 30 days, hard-capped): unlike the raw /v1/usage list, every aggregate is scoped to a bounded window so it stays served by the timestamp index. Returns grand totals, breakdowns by model / user / API key (top rows plus a reconciling other fold), and a UTC-bucketed time series.

get/v1/usage/summary

Query parameters

start_datestring date-time nullable

Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)

Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)

end_datestring date-time nullable

Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)

Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)

user_idstring nullable

Filter to a single user

Filter to a single user

statusstring nullable

Filter to a single status (e.g. 'success' or 'error')

Filter to a single status (e.g. 'success' or 'error')

modelstring nullable

Filter to a single model

Filter to a single model

endpointstring nullable

Filter to a single endpoint (e.g. '/v1/chat/completions')

Filter to a single endpoint (e.g. '/v1/chat/completions')

sourcestring nullable

Filter to a single provenance source (e.g. 'gateway' or 'claude_code')

Filter to a single provenance source (e.g. 'gateway' or 'claude_code')

api_key_idstring nullable

Filter to a single API key id

Filter to a single API key id

pricedboolean nullable

Filter by pricing state: true = only rows with a cost, false = only unpriced rows (cost is null)

Filter by pricing state: true = only rows with a cost, false = only unpriced rows (cost is null)

counts_toward_budgetboolean nullable

Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget

Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget

bucket'hour' | 'day'

Time-series granularity: 'hour' or 'day'

Time-series granularity: 'hour' or 'day'

Response

Successful Response

bucket'hour' | 'day' required
end_datestring required
start_datestring required