520 errors through the responses API
OpenAI Developer Community
June 7, 2026
When streaming, OpenAI should have added a bit of output pinging to the stream on Responses (not yet my idea of chunking whitespace partials at a non-stream or Chat Completions).
That might act to give a bit more persistence, if it is the Cloudflare routing gateway that is misconfigured for the long session required.
Otherwise it seems you could use streaming more like “background” if the connection being closed is not terminating the generation for you - capture the initial response ID, and then poll to retrieve the output at expected time as a fallback.
Discussion in the ATmosphere