Frequent API timeout errors recently

We have seen a lot of API timeout error while using gpt-3.5-turbo model as below in the last few days

ReadTimeout: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=600)

Anyone else also got a lot of timeout error?

The code we used is like this

completion = openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  temperature = 0.1,
  n = 3,
  messages=[
    {"role": "system", "content": system_content}, 
    {"role": "user", "content": user_content}
  ]
)
5 Likes

Yes, lately it’s been hit-or-miss.

I completely recommend using a backoff library. I like retry · PyPI
You can even hook a “We’re sorry, it appears the server is currently overloaded” message after so much time

They also have a status page: https://status.openai.com/

Although, it does seem delayed.

2 Likes

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>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
)
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”:

HTH

:slight_smile:

Does OpenAI know about this? Who should we tag?

4 Likes

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.

HTH

:slight_smile:

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:

:slight_smile:

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

5 Likes

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.

2 Likes

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