API reference

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

Path and query parameters
FieldTypeWhat it is
id (path)requiredinteger

Request body

application/json, required

Request body fields
FieldTypeWhat it is
modelrequiredstring
wirestringOne of "chat", "messages", "responses", "embeddings", "batch", "images", "audio", "realtime", "video", "3d", "tools". Default "chat".
maxTokensinteger or null
promptCharsinteger or null

Example

{
  "model": "antimatter/auto",
  "wire": "chat",
  "maxTokens": 0,
  "promptChars": 0
}

Answer 200

Each check in order, and which refused.

Fields of the 200 answer
FieldTypeWhat it is
allowedboolean
modelstring or null
worstCaseMicrosinteger or null
stepsarray of object
steps[].checkstringOne of "door", "model", "account", "output", "cost".
steps[].okboolean
steps[].messagestring

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.

Antimatter