OpenAI API
OpenAI API errors and fixes
23 OpenAI API errors from the official error docs, grouped by HTTP status, each with what it means, why it happens, the documented fix and whether to retry. Verified .
- Official error docsdevelopers.openai.com
- Status pagestatus.openai.com
- OpenAI API rate limits
Error response body
The shape OpenAI API errors come back in, as the official docs show it. Read the status and error type from here before matching an entry below.
JSON body with an error object. The docs identify errors by error.type (for example invalid_request_error, rate_limit_error, service_unavailable_error, insufficient_quota), error.code (for example slow_down, server_is_overloaded, credit_balance_exhausted), error.param (for example service_tier) and a human-readable message. For billing errors the docs say to inspect error.code, because error.type can still be insufficient_quota. No verbatim JSON body is shown on the error codes page.
HTTP 400 Bad Request
400 invalid_request_error (Invalid service_tier argument)The API returns the message "Invalid service_tier argument: The requested service tier is not allowed for this project." as an invalid_request_error (error.type) with error.param set to service_tier. The requested or resolved service tier is not allowed for the project.Retry? Not stated400 BadRequestErrorPython library error for 400 responses (formerly InvalidRequestError): the request was malformed or missing required parameters, such as a token or an input.Retry? Not stated
HTTP 401 Unauthorized
401 Invalid AuthenticationYour authentication credentials are invalid. The Python library raises AuthenticationError when an API key or token is invalid, expired, or revoked.Retry? Not stated401 Incorrect API key providedThe API key used in the request is not correct.Retry? Not stated401 You must be a member of an organization to use the APIYour account is not part of an organization.Retry? Not stated401 IP not authorizedThe request IP does not match the configured IP allowlist for your project or organization.Retry? Not stated
HTTP 403 Forbidden
403 Country, region, or territory not supportedYou are accessing the API from an unsupported country, region, or territory. The Python library maps 403 responses to PermissionDeniedError.Retry? Not stated403 PermissionDeniedErrorPython library error for 403 responses: you do not have access to the requested resource.Retry? Not stated
HTTP 404 Not Found
HTTP 409 Conflict
HTTP 422 Unprocessable Content
HTTP 429 Too Many Requests
429 credit_balance_exhaustedYour organization has no prepaid credits remaining. The broader error.type can still be insufficient_quota, so inspect error.code.Retry? No429 Rate limit reached for requestsYou have hit your assigned rate limit: too many tokens or requests were submitted in a short period. Limits are measured in RPM, RPD, TPM, TPD, IPM and apply at organization and project level, not per user. The Python library raises RateLimitError.Retry? Yes429 rate_limit_error slow_downYour request rate increased faster than the service can safely handle. It can occur even when traffic is within its RPM and TPM limits, because it reflects how quickly traffic increased.Retry? Yes429 organization_spend_limit_exceededYour organization reached its enforced monthly spend limit, which applies to API traffic across all projects in the organization.Retry? No429 project_spend_limit_exceededYour project reached its enforced monthly spend limit. Other projects can continue unless their own limit or the organization limit is also reached.Retry? No429 organization_usage_limit_exceededYour organization reached its OpenAI-assigned monthly usage limit. This is separate from the organization and project spend limits you configure.Retry? No
HTTP 500 Internal Server Error
HTTP 503 Service Unavailable
No HTTP status
previous_response_not_found (Responses API WebSocket mode)In Responses API WebSocket mode, the previous_response_id cannot be resolved from available state.Retry? Not statedwebsocket_connection_limit_reached (Responses API WebSocket mode)The WebSocket connection hit the 60-minute limit.Retry? Not statedAPIConnectionError (no HTTP status)The request could not reach OpenAI's servers or establish a secure connection. The SDK raises a subclass of APIConnectionError and retries connection errors by default (2 times with short exponential backoff).Retry? YesAPITimeoutError (no HTTP status)The request took too long to complete and the connection was closed. By default SDK requests time out after 10 minutes, and timed-out requests are retried twice by default. Stream consumption is not automatically retried.Retry? Yes
Newsletter
Know when the APIs change
One email per week. New model releases, API changes, what broke, and how developers are working around it.