# 504 Gateway Timeout

> The upstream server failed to send a timely response to the gateway proxy.

Source: https://apiguide.dev/status-codes/504
Class: server-error
Defined in: RFC 9110, Section 15.6.5 <https://www.rfc-editor.org/rfc/rfc9110.html#section-15.6.5>
Updated: 2026-10-17

## What does HTTP status code 504 mean?

The 504 Gateway Timeout status code indicates that a proxy server or gateway timed out waiting for a response from the backend application node.

## When to use it in APIs

Generated by gateways when heavy queries, long-running processes, or external API dependencies block the execution thread beyond connection limits. A [`Proxy-Status`](/headers/proxy-status) header from the gateway says which wait expired, such as `error=connection_timeout` or `error=http_response_timeout`.

## How it compares to other codes

* **502 Bad Gateway**: Means the backend returned an invalid response quickly. 504 means the backend took too long to return anything.
