Platform token usage statistics

1 min readEdit this page
GET
/v1/stats/usage

Aggregate token usage across the whole platform for a rolling window, bucketed by day and broken down by model. Public and unauthenticated — these are published figures, not per-account usage; for that see GET /v1/namespaces/{nsid}/usage.

Counts only requests that succeeded. completion_tokens already includes reasoning_tokens, so total_tokens is prompt_tokens + completion_tokens — adding reasoning on top double-counts. Served from a 5-minute cache.

Query Parameters

days?string

Window length in days, 1–90 (default 14). Out-of-range values are clamped.

top?string

How many models to break out per day in series before the tail is folded into an other bucket, 1–25 (default 8). Does not truncate the models array.

Response Body

application/json

curl -X GET "https://example.com/v1/stats/usage"
{  "models": [    {      "completion_tokens": 0,      "id": "string",      "open_weights": true,      "prompt_tokens": 0,      "request_count": 0,      "token_share": 0.1,      "total_tokens": 0    }  ],  "open_weight_token_share": 0,  "series": [    {      "by_model": {        "property1": 0,        "property2": 0      },      "date": "2019-08-24",      "request_count": 0,      "total_tokens": 0    }  ],  "totals": {    "completion_tokens": 0,    "prompt_tokens": 0,    "reasoning_tokens": 0,    "request_count": 0,    "total_tokens": 0  },  "window": {    "bucket": "string",    "days": 0,    "from": "2019-08-24T14:15:22Z",    "to": "2019-08-24T14:15:22Z"  }}

How is this guide?