Amazon Web Services · api · fg-0171
API Gateway returns 504 Endpoint request timed out after about 29 seconds while the Lambda keeps running
{"message": "Endpoint request timed out"} with HTTP 504
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
REST APIs cap integration time at 29 seconds by default and HTTP APIs at 30 seconds, independent of the Lambda timeout. Only Regional and private REST APIs can raise it, through a quota request that may lower the account throttle.
Fix
Move long work to an async pattern (return 202 and poll, or use a queue), or for a Regional or private REST API request a higher integration timeout quota. Edge-optimized REST APIs and HTTP APIs cannot go higher.
Apply
# Service Quotas, API Gateway: 'Maximum integration timeout in milliseconds' (L-E5AE38E3) aws service-quotas request-service-quota-increase \ --service-code apigateway --quota-code L-E5AE38E3 --desired-value 120000
Affects: API Gateway REST APIs (29 s default; raisable for Regional and private REST APIs since 2024-06-04) and HTTP APIs (30 s hard limit)
Sources
- https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-execution-service-limits-table.html
- https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-quotas.html
- https://aws.amazon.com/about-aws/whats-new/2024/06/amazon-api-gateway-integration-timeout-limit-29-seconds/
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp