OpenAI API error
OpenAI API APITimeoutError (no HTTP status): what it means and how to fix it
APITimeoutError (no HTTP status)Retry? YesLast verified 2 documented fixes2 sources
What it means
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.
Causes
- A network issue
- Heavy load on OpenAI's services
- A complex request that requires more processing time
How to fix it
- Fix 1.
Wait a few seconds and retry the request.
- Fix 2.
Configure the client timeout.
Snippetclient = OpenAI( # 20 seconds (default is 10 minutes) timeout=20.0, )
More OpenAI API errors
All 23 OpenAI API errors400 invalid_request_error (Invalid service_tier argument)Retry? Not stated401 Invalid AuthenticationRetry? Not stated401 Incorrect API key providedRetry? Not stated401 You must be a member of an organization to use the APIRetry? Not stated401 IP not authorizedRetry? Not stated403 Country, region, or territory not supportedRetry? Not stated429 credit_balance_exhaustedRetry? No429 Rate limit reached for requestsRetry? Yes
FAQ
What does the OpenAI API error "APITimeoutError (no HTTP status)" mean?
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.
How do I fix OpenAI API "APITimeoutError (no HTTP status)"?
There are 2 documented fixes. Start with the first: Wait a few seconds and retry the request.
Should I retry OpenAI API "APITimeoutError (no HTTP status)"?
Yes. The official docs treat this error as retryable.
Sources
Last verified against 2 sources: OpenAI API's official docs and official SDK repositories.
- developers.openai.comhttps://developers.openai.com/api/docs/guides/error-codes
- github.comhttps://github.com/openai/openai-python/blob/main/README.md
Newsletter
Know when the APIs change
One email per week. New model releases, API changes, what broke, and how developers are working around it.