v1

latestOpenAPI 3.1.02026-08-04134182237.9 KB
Usage

Get Usage Stats

Get comprehensive usage statistics with time series.

get/api/usage/stats

Query parameters

period'last_day' | 'last_week' | 'last_month' | 'last_3_months' | 'last_6_months' | 'last_90_days' | 'last_year' | 'current_month' | 'custom'

Time period: last_day, last_week, last_month, last_3_months, last_6_months, last_90_days, last_year, current_month, custom

Time period: last_day, last_week, last_month, last_3_months, last_6_months, last_90_days, last_year, current_month, custom

start_datestring nullable

Start date for custom period (YYYY-MM-DD)

Start date for custom period (YYYY-MM-DD)

end_datestring nullable

End date for custom period (YYYY-MM-DD)

End date for custom period (YYYY-MM-DD)

group_by'hour' | 'day'

Group by: hour or day

Group by: hour or day

api_key_idstring nullable

Filter by specific API key ID

Filter by specific API key ID

modelstring nullable

Filter by specific model

Filter by specific model

include_per_keyboolean

When true (and no api_key_id filter), include per-key breakdown in one response.

When true (and no api_key_id filter), include per-key breakdown in one response.

skip_cacheboolean

Force-drain the Redis usage stream so pending events land in usage_logs before reading. Use when the user clicks refresh.

Force-drain the Redis usage stream so pending events land in usage_logs before reading. Use when the user clicks refresh.

Response

Successful Response

successboolean
messagestring nullable