Skip to content
ACS Infra
Quota

Get Quota

GET
/v1/quota

Return your tokens of this UTC month: how many you may spend (quota), how many your Completions spent or hold (used), how many are left (left), and when the count starts again (refills_at). The API checks each request's Hold against these numbers. A Hold larger than left gets 429 budget_exceeded, unless the API first lowers max_tokens to fit: POST /v1/completions does, and so does a Job request that leaves max_tokens out. With group_by=client, the answer also splits this month's Completions by client label: the X-Title header of the request that sent them, else the first product of its User-Agent. The route asks no Inference and costs no tokens.

Authorization

bearer
headerAuthorizationBearer <token>

An API key: Authorization: Bearer sk-acs-..., or a key of the old platform, acs-bm-.... A User makes and revokes keys in the App.

Query Parameters

group_by?"client"

client adds clients: this month's Completions by client label.

Value in"client"

Response Body

Quota

application/json
  1. response
object*"quota"
Value in"quota"
quota*integer

The tokens that the User may spend each UTC month.

used*integer

The tokens that this month's Completions spent or hold.

left*integer

The tokens left this month: quota less used, and 0 once used reaches quota. A request whose Hold is larger does not fit.

refills_at*integer

When the next month starts, and the count with it, in Unix seconds (UTC).

clients?array<>

Only with group_by=client: this UTC month's Completions by client label, as the App's Usage page counts them. The 100 labels whose Completions used the most tokens, most first. A running Completion counts its tokens when it ends.

Example Request
curl -X GET 'https://api.infra.acsresearch.org/v1/quota' \  -H 'Authorization: Bearer <API_KEY>'
Example Response
{  "object": "quota",  "quota": 0,  "used": 0,  "left": 0,  "refills_at": 0,  "clients": [    {      "client": "string",      "completions": 0,      "prompt_tokens": 0,      "completion_tokens": 0    }  ]}