err:frontline:upstream:gateway_timeout504 Gateway Timeout.
Example response
If you’re calling an API hosted on Unkey
If the request is safe to repeat, retry with backoff. If it isn’t, ask the API owner whether it went through before you retry, because the app may have finished the work after the gateway stopped waiting. Send them the request ID.If you own this API
Each request gets 15 minutes, and each connection attempt to an instance gets 10 seconds. If an instance is slow to accept a connection, the gateway tries your other instances first. A request your app already accepted isn’t retried. Common causes:- A route takes longer than 15 minutes to respond.
- Instances are too slow to accept connections under load.
How to fix
- Find the slow route in the runtime logs and request log.
- Move long-running work off the request path, or stream the response so bytes reach the gateway before the deadline.
- If instances are slow to accept connections under load, add replicas or raise the CPU in the runtime settings.
Related errors
err:frontline:upstream:bad_gateway: the connection failed rather than timed out.err:frontline:upstream:service_unavailable: the instance refused the connection outright.err:user:bad_request:request_timeout: the Unkey API’s own request deadline.