A short request succeeds, but a long output or busy period times out.
Why this happens
The client’s timeout expired before the server completed the request or the network delivered its response. Long prompts, long generations, and temporary network latency make this more likely.
Answer 1: Increase the request timeout deliberately
from openai import OpenAI
client = OpenAI(timeout=60.0, max_retries=2)
Pick a timeout that matches the user experience you can support; a very large timeout can tie up workers under failure.
