Rate limits and errors

How many requests you can make, what happens when you go over, and how errors are shaped.

Rate limits

EndpointsLimit
/v1/* (chat completions, agent completions, knowledge search, models)300 requests per minute per workspace
All other endpoints120 requests per minute per key

Some endpoints have their own lower limit on top of this, for example the analytics endpoints.

When you go over a limit you get 429 Too Many Requests with a Retry-After header that says how many seconds to wait:

{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "This API key made too many requests (limit 120/minute). Try again in 27 seconds.",
    "detail": { "code": "API_KEY_RATE_LIMITED" }
  }
}

Wait for the number of seconds in Retry-After, then retry. Do not retry in a tight loop.

Error format

Errors are JSON with one envelope:

{
  "error": {
    "code": "FORBIDDEN",
    "message": "A sentence you can show to a person.",
    "detail": { "code": "API_KEY_SCOPE_MISSING" }
  }
}
  • error.code is the general class of the error.
  • error.message explains what happened in plain language.
  • error.detail.code, when present, is a stable code your client can branch on.

Status codes

StatusMeaningWhat to do
400The request is not valid for this endpoint.Fix the request; the message says what is wrong.
401The key is missing, invalid, expired or revoked.Check the key; create a new one if it expired.
402The workspace balance is empty or a spending limit is reached.Top up the balance or raise the limit in the app.
403The key or the person behind it is not allowed to do this.See the codes below.
404The resource does not exist or is not visible to this key.Check the id and whether the resource is shared with the key's owner.
422A field has the wrong type or is missing.Fix the body; the message names the field.
429Too many requests.Wait for Retry-After seconds.
5xxSomething went wrong on our side.Retry with backoff.
Statuserror.detail.codeMeaning
403API_KEY_SCOPE_MISSINGThe key lacks the scope this endpoint needs. The message names it.
403API_KEY_SCOPE_UNMAPPEDThis endpoint is not available to API keys.
403API_KEY_HITL_DECIDE_FORBIDDENApprovals are decided by a person in the app.
403API_KEY_POLICY_CHANGE_FORBIDDENApproval, confirmation and privacy settings are changed in the app.
429API_KEY_RATE_LIMITEDThis key made too many requests.