GATEWAY_TIMEOUT — Upstream call timed out
Summary
Section titled “Summary”A request to an upstream dependency — usually the LLM provider — exceeded our timeout budget. The request can be safely retried with an idempotency key.
HTTP status
Section titled “HTTP status”504 Gateway Timeout. Standard envelope.
Example response
Section titled “Example response”{ "success": false, "error": { "code": "GATEWAY_TIMEOUT", "message": "Upstream LLM provider timed out after 60 seconds.", "request_id": "req_01HXJZK4ABCDEF", "doc_url": "https://docs.surveycoder.io/errors/gateway-timeout" }}Why this happens
Section titled “Why this happens”- LLM provider latency spike.
- An unusually long verbatim or large batch pushed the call past the 60s budget.
- Transient network issue between our edge and the provider.
How to fix it
Section titled “How to fix it”- Retry with backoff. Wait 2s, 4s, 8s. Use an idempotency key so the original request can’t double-charge if it actually completed.
- For large async jobs, the pipeline retries internally — you should rarely see
GATEWAY_TIMEOUTon async; it’s usually a syncPOST /v1/codewith a wide batch. - If you consistently see it on a specific question, the verbatims may be unusually long. Split the batch into smaller chunks (10-20 at a time).
- Check the status page — we post about provider-side incidents.