Skip to main content
The Usage Report endpoint returns a daily breakdown of your API usage for a given time period. It aggregates data from transaction logs and request history, giving you visibility into token consumption, request volume, and costs.

Endpoint Information

  • URL: /v1/usage/report
  • Method: GET
  • Authentication: Required (x-api-key header or Authorization: Bearer <key>)
  • Rate Limiting: Subject to tier-based rate limits

Query Parameters

ParameterTypeRequiredDefaultDescription
periodstringNomonthPredefined time window: day (last 24 hours), week (last 7 days), or month (last 30 days)
start_datestringNoCustom range start in YYYY-MM-DD format. When both start_date and end_date are provided, they override period
end_datestringNoCustom range end in YYYY-MM-DD format. Required when start_date is set
Custom date ranges take precedence over the period parameter. If you pass both start_date/end_date and period, the custom range is used.

Response Schema

UsageReportOutput Object

FieldTypeDescription
resultsList[UsageReportDay]Daily usage breakdown, sorted ascending by date
periodstringThe period that was applied: day, week, month, or custom
start_datestringStart date of the report (YYYY-MM-DD)
end_datestringEnd date of the report (YYYY-MM-DD)
timestampstringISO timestamp when the report was generated

UsageReportDay Object

FieldTypeDescription
daystringDate in YYYY-MM-DD format
total_costnumberTotal cost in USD for this day
input_tokensintegerTotal input tokens consumed
output_tokensintegerTotal output tokens consumed
request_countintegerTotal number of API requests

Example Response

{
  "results": [
    {
      "day": "2026-03-28",
      "total_cost": 1.234567,
      "input_tokens": 42000,
      "output_tokens": 9800,
      "request_count": 15
    },
    {
      "day": "2026-03-29",
      "total_cost": 0.856234,
      "input_tokens": 28000,
      "output_tokens": 6200,
      "request_count": 8
    }
  ],
  "period": "week",
  "start_date": "2026-03-23",
  "end_date": "2026-03-29",
  "timestamp": "2026-03-29T18:30:00+00:00"
}

Error Responses

HTTP StatusCause
400start_date is after end_date
401Missing or invalid API key
429Rate limit exceeded
500Internal error generating the report

How Data is Aggregated

The endpoint pulls from two data sources and groups by calendar day (UTC):
  1. Costs — from the credit transaction ledger. Each credit deduction recorded during the period is summed per day.
  2. Tokens and requests — from API request logs. Input/output token counts are extracted from the response usage object logged with each completion. Every logged request increments the daily request_count.
Days with zero activity are omitted from the results.