Count Usage
Total number of usage logs matching the given filters.
Serves the dashboard paginator's "N of M" total without changing the bare array contract of GET /v1/usage. Runs only when the client asks (a separate request), so the COUNT(*) is not paid on every page load. With counts_toward_budget=false it also backs the "select all N matching this filter" affordance for bulk delete / set-price, which touch imported rows only.
Query parameters
Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)
Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)
Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)
Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)
Filter to a single user
Filter to a single user
Filter to a single status (e.g. 'success' or 'error')
Filter to a single status (e.g. 'success' or 'error')
Filter to a single model
Filter to a single model
Filter to a single endpoint (e.g. '/v1/chat/completions')
Filter to a single endpoint (e.g. '/v1/chat/completions')
Filter to a single provenance source (e.g. 'gateway' or 'claude_code')
Filter to a single provenance source (e.g. 'gateway' or 'claude_code')
Filter to a single API key id
Filter to a single API key id
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)
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
Response
Successful Response