Frequent API timeout errors recently

Been receiving a bunch of errors and timeouts today as well. Did not experience this last week.

Also getting 502s randomly.

raise error.APIError(
openai.error.APIError: HTTP code 502 from API (<html>
<head><title>502 Bad Gateway</title></head>
<center><h1>502 Bad Gateway</h1></center>
1 Like

Yeah, everyone is seeing the same “timeouts” and across both chat completion and completion API methods and models.

Strangely, the OpenAI status page shows everything “green”:



Does OpenAI know about this? Who should we tag?


I am sure they know about it @shuo

They have over 100 millions users all over the globe.

It’s best to relax and wait for the issue to clear, to be honest.



1 Like

I’ve also been getting ECONNRESET and Request failed with status code 502 errors in the past 10 hours. BTW openai api takes several minutes before throwing an error and timing out, which is a bit annoying.

You can write code in your app to shorten this timeout.

Normally, this is a good time to work on error and exception handling code when performance is bad.

For example, check out this current topic:


Makes sense. I just set a 30 seconds timeout and then I try with gpt-3.5-turbo-0301. Not sure if changing the model will make any improvement though

1 Like

having 3 + days of failed requests because of timeouts is pretty bad for a business


same error to me, what is the solution? :broken_heart:

It does. Sometimes, outages do not work the same way for all the models/endpoints (sometimes they do).
@ljia31523 All the strategies are pretty much explained in this link that @ruby_coder already shared. Feel free to reach out if you still have doubts or do not know how to implement them.

1 Like

Same problem with davinci-003 and 3.5-turbo

Experiencing the same issue with both davinci-003 and davinci-002.
It’s almost been 3 days with the same issue. It’s making it really hard to work.

1 Like

what is most annoying to me is:
I try to set a timeout at openai.ChatCompletion.create(..., timeout=10) hoping that that after 10seconds, if it is still “hunging”, please stop.

I am using @retry(wait = wait_random_exponential(min =1, max = 60), stop = stop_after_attempt(6)) def chatcompletion_with_backoff(**kwargs): to hope to handle this.

HOWEVER, there are no “timeout”. I have been monitoring the process. There are mulititimes that the the request being going on >minutes, and yet no Timeout is thrown out.

See this for the similar complaints…

I mean, basic coding principle, things should “do what they say, say what they do”… it’s clearly not the case here.

any guidance pls? Just keep “trying” and wait for things to clear, unfortunately is not an option

1 Like

Exactly, does not give me the confidence to roll my app functionality out to further users at all, unless things get a bit more stable.


I’ve faced the same timeout issue. In the Python API, if you pass the parameter request_timeout to openai.ChatCompletion.create instead of timeout then it will throw a Timeout exception after n seconds. Hope it helps

But yes, I’ve been facing these issues as well…

We have exactly the same problem with timeouts.

thank you for pointing out therequest_timeout

1 Like

same here! I plan to use claude to see if it is more stable

thanks, I have try catch and add timeout in my code. The api may be stable today.

1 Like

Probably is intermittent. If it times out continuously more than a certain amount of time it would change to something else.