- Newest
- Most votes
- Most comments
In both cases, you will not be charged. In the second point, you will be charged for the Lambda Authorizer invocation, but not for the API call.
Based on the available information, the pricing for AWS API Gateway is not explicitly clear regarding charges for invalid API keys or denied authorizations. However, we can provide some insights:
~~
-
Regarding API calls with invalid or missing API keys: It appears that API Gateway generally charges for all API calls received, regardless of their outcome. This suggests that you would likely be charged even if the API key is not sent or is invalid. The pricing is based on the number of API calls received, not just successful ones.
-
For custom Lambda authorizer denials: Similarly, it seems that you would still incur charges even if the custom Lambda authorizer denies authorization. This is because the API call is still processed by API Gateway, regardless of whether it's ultimately authorized or not. ~~
It's important to note that API Gateway's pricing model is based on "API calls you receive," which implies that any request that reaches the API Gateway infrastructure may be billable, regardless of its eventual success or failure.
However, given the lack of explicit information on these specific scenarios, it would be advisable to contact AWS Support directly for an official and definitive answer. They can provide the most up-to-date and accurate information regarding these particular use cases.
Remember that API Gateway offers a free tier that includes one million API calls per month for up to 12 months, which could help mitigate costs while you're testing or during initial deployment stages.
Sources
About Amazon API Gateway - Security Overview of Amazon API Gateway
Does option requests and 4xx/5xx error incurs bills for api gateway? | AWS re:Post
answered 2 years ago
Relevant content
asked a year ago
asked 10 months ago

Thank you for the response. Following up, if the quota for an API key in a usage plan is exhausted, and the user still keeps making the API calls, would this be chargeable? Or would I be only paying for the invocation of the lambda for auth?
Same. Only for the Lambda Authorizer.