OpenAI API error
OpenAI API APIConnectionError (no HTTP status): what it means and how to fix it
APIConnectionError (no HTTP status)Retry? YesLast verified 2 documented fixes2 sources
What it means
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).
Causes
- Network issues
- Proxy configuration
- SSL certificate problems
- Firewall rules blocking or filtering the service
- Container lacking permission to send and receive traffic
How to fix it
- Fix 1.
Check network settings, proxy configuration, SSL certificates and firewall rules.
- Fix 2.
Catch SDK exceptions and handle connection errors separately from API errors.
Snippetimport openai from openai import OpenAI client = OpenAI() try: response = client.responses.create(model="gpt-6-astra", input="Hello world") except openai.APIConnectionError as e: print(f"Failed to connect to OpenAI API: {e}") except openai.RateLimitError as e: print(f"OpenAI API request exceeded rate limit: {e}") except openai.APIError as e: print(f"OpenAI API returned an API Error: {e}") else: print(response.output_text)
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 "APIConnectionError (no HTTP status)" mean?
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).
How do I fix OpenAI API "APIConnectionError (no HTTP status)"?
There are 2 documented fixes. Start with the first: Check network settings, proxy configuration, SSL certificates and firewall rules.
Should I retry OpenAI API "APIConnectionError (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.