Read the Organization's evaluation quota
GET /v1/usage/evaluation-quota
| Property | Value |
|---|---|
| Operation | get_evaluation_quota |
| Group | Usage |
| Scope | usage:read |
| Route class | read |
| Idempotency | No Idempotency-Key |
| Audit | Not audited: A metadata read; Usage events and the spend counter carry identifiers, units and amounts, never content. |
| Released in | 1.63.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Answers the Organization's evaluation quota of the current UTC day (1.63.0; prompt-manager.md section 9.1): the limit in model tokens, 2,000,000 a day (a target) until the plans of slice 2.5 carry it, the tokens of the Usage events of the origin evaluation used so far in every environment, the tokens the queued and running runs and calibrations hold, and what remains. A request that would pass it is refused with 429 evaluation_quota_reached.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the usage:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl "$VOCAL_API/v1/usage/evaluation-quota" \
-H "Authorization: Bearer $VOCAL_API_KEY"const response = await fetch(`${process.env.VOCAL_API}/v1/usage/evaluation-quota`, {
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
},
});
console.log(response.status, await response.text());import os
import requests
response = requests.get(
f"{os.environ['VOCAL_API']}/v1/usage/evaluation-quota",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
},
)
print(response.status_code, response.text)Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | EvaluationQuota | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is EvaluationQuota.
| Field | Type | Required | Description |
|---|---|---|---|
limit_tokens | integer | yes | The Organization's evaluation tokens a period: 2,000,000 (a target). |
object | "evaluation_quota" | yes | |
period | EvaluationQuotaPeriod | yes | |
period_start | Timestamp | yes | |
remaining_tokens | integer | yes | The limit less what is used and reserved, never below 0. |
reserved_tokens | integer | yes | What the queued and running runs and calibrations hold, an estimate. Stated in 1.65.0, as the api built it: a queued live judgment holds no reservation; one that would pass the quota when it is claimed is skipped with evaluation_quota_reached. |
resets_at | Timestamp | yes | |
used_tokens | integer | yes | The input and output tokens of the Usage events of the origin evaluation written in the period, every environment. |