CloudConsole

API Gateway timeout limit (29 seconds) and how to go beyond it

Updated 17 November 2026 · How we write and check guides

Short answer

A REST API integration can run for 50 milliseconds to 29 seconds by default. For Regional and private REST APIs you can request a higher integration timeout through Service Quotas, which may lower your account's Region-level throttle quota; edge-optimized APIs stay at 29 seconds. HTTP APIs have a fixed 30-second maximum. Alternatively, a REST API proxy integration set to stream its response can keep a response open for up to 15 minutes without any quota increase.

API Gateway timeout limit (29 seconds) and how to go beyond it: default
The key quotas from this page's table: the default value and whether it can be raised.

The timeout limits by API type

API typeIntegration timeoutCan it go higher?
REST API, Regional50 ms to 29 s (default 29 s)Yes, by quota request; may reduce your account throttle quota
REST API, private50 ms to 29 sYes, same as Regional
REST API, edge-optimized50 ms to 29 sNo
REST API with response streaming (proxy integrations)Up to 15 minutes of streamingNo request needed; idle timeout 5 minutes (Regional/private) or 30 seconds (edge)
HTTP APIUp to 30 sNo
Lambda authorizer response (HTTP API)10 sNo

Other timeouts sit around the integration: the client's own timeout, CloudFront's origin response timeout if a distribution is in front, and the backend's timeout (Lambda's function timeout, a load balancer's idle timeout). The shortest one decides what the caller sees.

Raise the 29-second limit (Regional and private REST APIs)

  1. Open Service Quotas, choose Amazon API Gateway, find the integration timeout quota and request the value you need, in milliseconds. AWS may lower your account-level throttle quota in that Region to compensate, so check the 10,000 RPS default still covers your traffic.
  2. Once approved, set the timeout on each integration that needs it and redeploy the stage:
aws apigateway update-integration --rest-api-id a1b2c3d4e5 --resource-id abc123 --http-method POST \
  --patch-operations op=replace,path=/timeoutInMillis,value=90000

aws apigateway create-deployment --rest-api-id a1b2c3d4e5 --stage-name prod

In CloudFormation the property is TimeoutInMillis on the method's Integration; in the console it is Integration timeout under the integration request settings. Without the quota increase, values above 29,000 are rejected.

  1. Raise the backend to match: a Lambda function behind a 90-second integration needs a function timeout above 90 seconds.

Or stream the response instead

For long-running or large responses, set a proxy integration (AWS_PROXY or HTTP_PROXY) to the STREAM response transfer mode. API Gateway starts sending bytes as soon as the backend produces them, so the 29-second limit no longer applies, the 10 MB response cap is lifted, and you don't need a quota change. The trade-offs:

  • Only REST APIs and only proxy integrations support it; request bodies are not streamed.
  • Endpoint caching, content encoding and VTL response transformation don't work in STREAM mode.
  • The stream must send data at least every 5 minutes (Regional and private) or 30 seconds (edge-optimized), and stops at 15 minutes.
  • Lambda backends must use response streaming in the function code.

When the limit is the wrong thing to change

Most 504s come from backends that are slow for a reason: a cold dependency, connection pool exhaustion, a VPC function without a route to a service, or a downstream API timing out. Before raising anything, look at IntegrationLatency for the method (an integration latency alarm helps) and the backend's own logs. For work that genuinely takes minutes, the durable fix is asynchronous: accept the request, return 202 with a job ID, do the work in SQS plus Lambda, Step Functions or ECS, and let the client poll or receive a callback.

When the timeout does fire, the client gets 504 with {"message": "Endpoint request timed out"}; the 504 page covers diagnosis.

Questions

Can the API Gateway 29 second timeout be increased?

Yes, for Regional and private REST APIs: request a higher integration timeout in Service Quotas, then set timeoutInMillis on the integration. Edge-optimized REST APIs and HTTP APIs can't go beyond 29 and 30 seconds.

What is the maximum timeout for API Gateway HTTP APIs?

30 seconds, and it can't be increased.

Does increasing the API Gateway timeout cost anything?

There is no separate charge, but AWS may reduce your account's Region-level throttle quota when it grants a longer integration timeout.

When this happens away from your desk

A 504 storm usually means a dependency slowed down, not that the timeout is wrong. CloudConsole, a phone app for AWS, is being built to show API latency and 5xx alarms with the backend logs on your phone so you can tell which.

About the app → · Download on the App Store

Sources