Usage
Get usage top ranking
GET
Ranks usage by model, provider, or label:{key}. JSON, NDJSON, and CSV are selected by the Accept header.
ApiKeyAuthheader
Authorization<token>dimension*stringmodel, provider, or label:{key}, where key is cost_center, project, environment, app_url, app_title, app_categories, or sdk_info
metric?stringDefault
"cost_credits"Value in
"cost_credits""requests""error_rate""latency_p95""tokens"limit?integerRange
value <= 100Default
10order?stringDefault
"desc"Value in
"desc""asc"since?stringRFC3339 or YYYY-MM-DD.
until?stringRFC3339 or YYYY-MM-DD.
Top-N usage ranking.
- response
data*array<>total*numberFormat
doublecurl -X GET 'https://api.ohmygpt.com/v1/usage/top?dimension=string'Example Response
{ "data": [ { "key": "string", "rank": 0, "share": 0.1, "unit": "string", "value": 0.1 } ], "total": 0.1}Get usage summary GET
Aggregates the current user's usage by model, provider, route, status, API key (credential), inbound API (api), or label:{key}. Filters combine, for example group_by=credential&model=X gives spend per key for one model. JSON, NDJSON, and CSV are selected by the Accept header.
List usage records GET
Returns the current user's usage records, newest first. JSON, NDJSON, and CSV are selected by the Accept header.