Compare REST, HTTP and WebSocket API Gateway costs including data transfer, caching and the saving from moving to HTTP APIs.
API Gateway bills per request on a tiered scale, then charges separately for bytes returned to the internet and for any provisioned cache, which is billed hourly whether or not it is hit. HTTP APIs cost roughly a third of REST APIs but drop request/response transformation, API keys, WAF integration and usage plans, so the saving is only real if you do not need those. Confirm the current per-million rates and data transfer price for your region before budgeting. On a high-volume, low-compute API the gateway commonly costs more than the Lambda functions behind it, so choosing REST when HTTP would do is one of the largest avoidable line items in a serverless architecture.
API Gateway Cost
cost = requests ÷ 1,000,000 × price per million + data out GB × per-GB price + cache hours × cache price, plus connection minutes ÷ 1,000,000 × minute price for WebSocket APIs.
REST versus HTTP
HTTP API saving = REST request cost − HTTP request cost for the same volume.
cost = requests ÷ 1,000,000 × price per million + data out GB × per-GB price + cache hours × cache price, plus connection minutes ÷ 1,000,000 × minute price for WebSocket APIs. API Gateway bills per request on a tiered scale, then charges separately for bytes returned to the internet and for any provisioned cache, which is billed hourly whether or not it is hit. HTTP APIs cost roughly a third of REST APIs but drop request/response transformation, API keys, WAF integration and usage plans, so the saving is only real if you do not need those. Confirm the current per-million rates and data transfer price for your region before budgeting.
On a high-volume, low-compute API the gateway commonly costs more than the Lambda functions behind it, so choosing REST when HTTP would do is one of the largest avoidable line items in a serverless architecture.
This calculator takes 11 inputs: API type, Requests or messages per month, Average response size, WebSocket connection minutes per month, REST API price per million requests, HTTP API price per million requests, WebSocket price per million messages, WebSocket price per million connection minutes, Data transfer out price per GB, REST API cache size, Cache price per hour. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
It is a fixed hourly charge, so it only pays back when it removes enough requests from your backend to matter. At 0.02 USD per hour a 0.5 GB cache is about 15 USD a month — trivial next to a busy API, and pure waste on one serving a few thousand requests a day.