OhMyGPT
Usage

Get usage top ranking

GET
/v1/usage/top

Ranks usage by model, provider, or label:{key}. JSON, NDJSON, and CSV are selected by the Accept header.

Authorization

ApiKeyAuth
headerAuthorization<token>

Query Parameters

dimension*string

model, provider, or label:{key}, where key is cost_center, project, environment, app_url, app_title, app_categories, or sdk_info

metric?string
Default"cost_credits"
Value in"cost_credits""requests""error_rate""latency_p95""tokens"
limit?integer
Rangevalue <= 100
Default10
order?string
Default"desc"
Value in"desc""asc"
since?string

RFC3339 or YYYY-MM-DD.

until?string

RFC3339 or YYYY-MM-DD.

Response Body

Top-N usage ranking.

  1. response
data*array<>
total*number
Formatdouble
Example Request
curl -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}