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)
400request_too_largeA request larger than the plan reads at once (Free: about 30,000 tokens)Shorten the messages or move to a paid plan
401missing_api_keyNo keyAdd Authorization: Bearer …
401invalid_api_keyWrong or revoked keyCreate a new key in the console
401api_key_expiredThe key has expired: the message says whenCreate a new key in the console
403organization_inactiveOrganization on the waitlist or suspendedWait for activation or write to us
403terms_not_acceptedSigned in with an account (not an API key) that has not accepted the terms and acceptable use rules yetAccept them in the chat or the console
403api_not_in_planAPI key of an organization on the Free plan, which includes the Chat onlyMove to the Plus plan or above
403model_not_allowedModel reserved to verified organizations, or to the Extreme add-on on paid plansAsk for verification in the console, Plan page
404model_not_foundUnknown model, or not included in your planCheck GET /v1/models
429rate_limit_exceeded5-hour or 7-day quota used up, or too many concurrent requestsRetry after Retry-After seconds
429insufficient_quotaQuota of the month or of the 30-day period used upIt resets on the 1st of the month or at renewal; see the console
429too_many_failed_requestsToo many failed requests from the same address (wrong key, paths that do not exist): 30 in 10 minutesFix the key and retry after Retry-After seconds
502upstream_errorModel errorRetry; if it repeats, write to us with x-request-id
500internal_errorAn unexpected error on our sideRetry; 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
503upstream_unavailableThe model cannot be reachedRetry after Retry-After
503auth_unavailableSigned in with an account (not an API key): the sign-in system does not answerRetry after Retry-After
504upstream_timeoutThe model did not start answering in timeRetry

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