When I send requests to my API with Amazon API Gateway, I receive a "429 Too Many Requests" or "Limited Exceeded" error.
Short description
If you exceed the throttling limit of quota, then you get a "429 Too Many Requests" or "Limited Exceeded" error response. API Gateway has account-level quotas, per Region. For more information on throttling-related settings, see How throttling limit settings are applied in API Gateway.
Resolution
First, verify that you have followed the instructions to turn on Amazon CloudWatch Logs to troubleshoot API Gateway. To generate event logs only for requests to your API with an error, make sure that you choose ERROR. Then, use the CloudWatch console to view logged API requests and responses.
"429 Too Many Requests" error
Check the rate or burst limit for per-client or per-method throttling limits that you set for the API stage for your usage plan. When the rate or burst limit is exceeded, the CloudWatch event logs an exceeded throttle limit. The error looks similar to the following:
(f277a0b4-2bcd-41b3-8e43-4de770663ffb) API Key
**********************************
F0yrv6 exceeded throttle limit for API
Stage rohkz08x02/dev: Key throttle limit exceeded for Usage Plan ID nnpegc, RestApi rohkz08x02, Stage dev, Resource f646q2, HttpMethod GET. Limit: 5.00 Burst: 10
To resolve this error, use a standard retry mode with jittered exponential backoff, and then resubmit your API request. For more information, see Retry behavior.
"Limit Exceeded" error
When you receive this error, the quota limit is exceeded for your API Gateway usage plan. The CloudWatch execution logs an exceeded quota limit. The error looks similar to the following:
(7b819c41-e0a0-433a-883e-bc461fd70fd6) API Key
**********************************
F0yrv6 exceeded quota limit for API
Stage rohkz08x02/dev: Key quota exhausted for Usage Plan ID nnpegc. Q
Limit: 500 Period: DAY
To resolve this error, extend the quota.
Related information
How do I troubleshoot Lambda function throttling with "Rate exceeded" and 429 "TooManyRequestsException" errors?
How do I find API Gateway REST API errors in my CloudWatch logs?