API reference · Keys
Would this request be allowed?
POST/api/keys/{id}/policy/testSigned in session
Runs the key's saved checks as dispatch does: the API, the model lists, scopes, team and budgets, the output ceiling and the most one request may cost. Nothing is sent, held or billed. 30 a minute an account. Same origin.
Parameters
| Field | Type | What it is |
|---|---|---|
| id (path)required | integer |
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| modelrequired | string | |
| wire | string | One of "chat", "messages", "responses", "embeddings", "batch", "images", "audio", "realtime", "video", "3d", "tools". Default "chat". |
| maxTokens | integer or null | |
| promptChars | integer or null |
Example
{
"model": "antimatter/auto",
"wire": "chat",
"maxTokens": 0,
"promptChars": 0
}Answer 200
Each check in order, and which refused.
| Field | Type | What it is |
|---|---|---|
| allowed | boolean | |
| model | string or null | |
| worstCaseMicros | integer or null | |
| steps | array of object | |
| steps[] | string | One of "door", "model", "account", "output", "cost". |
| steps[] | boolean | |
| steps[] | string |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 404OpenAI shaped error.
- 429OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.