Skip to content

Errors

All /v1 errors use the standard OpenAI error envelope, so the OpenAI SDK raises the matching typed exception automatically:

{ "error": { "message": "...", "type": "invalid_request_error", "param": null, "code": "invalid_api_key" } }

Some errors add optional fields alongside the standard ones so an agent can recover without a human. They’re additive — the OpenAI SDK ignores unknown keys, so the envelope stays wire-compatible:

FieldMeaning
hintWhat to do next (e.g. how to send a valid key, how to back off)
docs_urlThe docs page that explains the fix
did_you_meanThe likely-intended value for a bad enum/param
{ "error": { "message": "Invalid or missing API key", "type": "invalid_request_error",
"param": null, "code": "invalid_api_key",
"hint": "Send a valid key as `Authorization: Bearer sk-octo_...`.",
"docs_url": "https://docs.omniocto.com/getting-started/authentication" } }
HTTPtype / codeWhenSDK exception
401invalid_request_error / invalid_api_keyMissing or invalid API keyAuthenticationError
403insufficient_quotaWorkspace suspended or out of creditsPermissionDeniedError
404invalid_request_errorUnknown previous_response_id / conversation / response id / modelNotFoundError
400invalid_request_errorMalformed request body; store:false combined with background:trueBadRequestError
422invalid_request_errorIdempotency-Key reused with a different request bodyUnprocessableEntityError
429rate_limit_errorPer-key or per-workspace rate limit exceeded (carries a retry-after header)RateLimitError
from openai import (
AuthenticationError,
PermissionDeniedError,
NotFoundError,
BadRequestError,
UnprocessableEntityError,
RateLimitError,
)
try:
resp = client.responses.create(model="claude-sonnet-4-6", input="hi")
except AuthenticationError:
... # bad/missing key — see Authentication
except PermissionDeniedError:
... # workspace suspended or out of quota — see Usage & billing
except RateLimitError as e:
... # back off using the retry-after header — see Rate limits