Error {'code': 524, 'message': 'Gateway timeout.', 'param': None, 'type': 'cf_gateway_timeout'}}

CloudFlare has a 100-second limit on HTTP requests.

So, it is necessary to keep your requests under this 100-second limit.

Depending on current server load, tool use, etc it’s possible for some requests to take more time than this, which is causing this error.

The solution is to use streaming which chunks the response. Since each chunk takes far fewer than 100-seconds to complete the call does not get interrupted and you won’t get the 524 errors.

1 Like