API guide

Authentication

Requests are authenticated with an API key. A key can carry its own limits.

Bearer token

Send the key in the Authorization header. The x-api-key header is also accepted.

Authorization: Bearer $API_KEY
# or
x-api-key: $API_KEY

Per-key restrictions

A key can be restricted individually. A request that breaks a restriction is rejected.

RestrictionBehaviourRejection
Model allowlistIf the list is not empty, the requested model (or its group) must be listed exactly. An empty list allows every model.403 model_not_allowed
IP allowlistIf set, the caller IP must match an entry. * works as a wildcard inside an entry.403 permission_denied
BudgetA key with a maximum amount stops working once its used amount reaches it.400 invalid_request (message: Use amount exceeds limit)
Expiry / disabledExpired, disabled or deleted keys are refused.401 invalid_api_key

Public endpoints

GET /v1/models and GET /v1/rankings do not need a key.

See also