API Gateway Cost Calculator
Compare REST, HTTP and WebSocket API Gateway costs including data transfer, caching and the saving from moving to HTTP APIs.
Inputs
Leave at 0 for no cache; caching is REST-only and billed per hour.
Estimated Monthly Cost
$38.43
Request or Message Cost
$35.00
Connection Minute Cost
$0.00
Data Transfer Out Cost
$3.43
Cache Cost
$0.00
Saving by Switching to an HTTP API
$25.00
Step by step
Values used
API type = REST API — full feature set; Requests or messages per month = 10,000,000 requests; Average response size = 4 KB; WebSocket connection minutes per month = 0 minutes; REST API price per million requests = 3.50 USD; HTTP API price per million requests = 1 USD; WebSocket price per million messages = 1 USD; WebSocket price per million connection minutes = 0.2500 USD; Data transfer out price per GB = 0.0900 USD; REST API cache size = 0 GB; Cache price per hour = 0.0200 USD
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.
Estimated Monthly Cost
= 38.43
Request or Message Cost
= 35.00
Connection Minute Cost
= 0.00
Data Transfer Out Cost
= 3.43
Cache Cost
= 0.00
Saving by Switching to an HTTP API
= 25.00
How it works
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.
Formulas
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.
- price per million
- REST, HTTP or WebSocket request rate for your region
- data out GB
- requests × average response size ÷ 1,048,576
- cache hours
- 730 hours in an average month, billed whenever a cache is provisioned
REST versus HTTP
HTTP API saving = REST request cost − HTTP request cost for the same volume.
Frequently Asked Questions
How is API Gateway Cost calculated?
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.
Why does API Gateway Cost matter?
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.
What values do I need to enter?
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.
Is a REST API cache worth the money?
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.