Errors

Chat errors are OpenAI-shaped. The body is { "error": { "message", "type", "code" } }. Every chat response includes X-Request-ID.

StatusCodeType
400invalid_requestinvalid_request_error
400model_not_foundinvalid_request_error
401unauthorizedauthentication_error
413payload_too_largeinvalid_request_error
429insufficient_creditsinsufficient_quota
429rate_limitedrate_limit_error
500internal_errorserver_error
503service_unavailableserver_error

What to do

400 invalid_request means the body is wrong for that model — an unknown model id, a parameter the model does not list, or a value outside its limits. The message says what that model accepts.400 model_not_found means the id is not in the catalog.

401 is the key: missing, malformed, unknown, or revoked. 413 means the body exceeds 10 MB. 429 insufficient_credits needs a top-up. 429 rate_limited should wait for Retry-After. 500 and 503 are retryable — send the request id with a support ticket if they persist.