504 Gateway Timeout

A gateway did not get an upstream response in time.

What it means

The backend was too slow. The operation may still complete on the server.

What your client should do

Before retrying a non-idempotent request, check whether it already succeeded. Use idempotency keys.

Should you retry?

Yes, with exponential backoff and jitter, and only for idempotent requests (GET, PUT, DELETE) or requests protected by an Idempotency-Key.

Try it

The free practice API returns this status on demand, with the headers a well-behaved API would send. Call GET /api/play/status/504 from Endpoint Client and open the Explain tab.

Open /api/play/status/504

Related codes

Defined in RFC 9110. All status codes and headers