Is "request_timeout" parameter real?

I have occasional, but repeating problems with the requests to OpenAI timing out.

Request timed out: HTTPSConnectionPool(host='', port=443): Read timed out. (read timeout=600).

I have gone through the forum and have noticed that some users are recommending using request_timeout parameter, to shorten that time, and repeat the request after. However, others are recommending creating own function in Python to do that. Also, the parameter is not mentioned in the OpenAI documentation.

  1. Does this parameter exist, have someone managed to make it work?
  2. If not and if I need to do it by myself, I am not really clear the logic behind that. I have implemented the exponential backoff strategy, as suggested by OpenAI - but, if the timeout is 600 seconds, this means that the next retry will come after 10 minutes? Should I somehow cut the request if it takes more than, let’s say 30 seconds?

Yes, it works. Set it to 4 seconds, get an error in four seconds.

1 Like


So looking around the forum, I found this comment


Mar 28

Setting request_timeout worked for me.


I was able to get this exception message.

Request timed out: HTTPSConnectionPool(host=‘ ’, port=443): Read timed out. (read timeout=1)

I can’t find reference to it in the OpenAI docs, but it is mentioned in the git repo, I think the folks that are managing it themselves are doing so by .create(ing) the object and then if a reply is not received within a specific period they are calling the .close method and generating their own exceptions.

1 Like