BEATRICE Docs
Sections

Errors

Errors follow the OpenAI format, so the SDKs turn them into their exceptions (AuthenticationError, RateLimitError and so on):

{
  "error": {
    "message": "…",
    "type": "rate_limit_error",
    "param": null,
    "code": "rate_limit_exceeded"
  }
}
HTTPcodeWhenWhat to do
400invalid_requestInvalid parameters, n other than 1, max_tokens above the maximum, context too longFix the request (see param and message)
401missing_api_keyNo keyAdd Authorization: Bearer …
401invalid_api_keyWrong, revoked or expired keyCreate a new key in the console
403organization_inactiveOrganization on the waitlist or suspendedWait for activation or write to us
404model_not_foundUnknown model, or not included in your planCheck GET /v1/models
429rate_limit_exceeded5-hour quota used up, or too many concurrent requestsRetry after Retry-After seconds
429insufficient_quotaMonthly quota used upIt resets on the 1st of the month; see the console
502upstream_errorModel errorRetry; if it repeats, write to us with x-request-id
503server_overloadedQueue full or wait too longRetry after Retry-After (the SDKs do it for you)
503model_unavailableModel temporarily unavailableRetry after Retry-After
503safety_unavailableThe red-line check is not answering: to stay safe we don’t proceedRetry shortly

Retrying

  • Every 429 and 503 carries Retry-After (seconds).
  • When a quota is used up we add x-should-retry: false: the OpenAI SDKs won’t retry by themselves, because the wait can be hours.
  • For 503s the SDKs retry with growing waits: that’s fine.
  • If 5xx errors last, check status.beatriceai.it: it shows the state of the API, the model and sign-in, and ongoing incidents.

Red-line refusals

They are not errors: the response is normal (HTTP 200) with finish_reason: "content_filter" and a text naming the rule that applies. See Red lines.

l'amor che move il sole e l'altre stelle