Skip to content
ENExplore Calculators

API Gateway Cost Calculator

Compare REST, HTTP and WebSocket API Gateway costs including data transfer, caching and the saving from moving to HTTP APIs.

About API Gateway Cost Calculator

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.

Worked example

With the default values below, API Gateway Cost Calculator returns Estimated Monthly Cost of $38.43. Change any input above and every figure here is recalculated in your browser.

Inputs used

API typeone of REST API — full feature set, HTTP API — cheaper, fewer features, WebSocket API — messages plus connection minutes
REST API — full feature set
Requests or messages per monthminimum 0 requests
10,000,000 requests
Average response sizeaccepts 0–10,240 KB
4 KB
WebSocket connection minutes per monthminimum 0 minutes
0 minutes
REST API price per million requestsminimum 0 USD
3.5 USD
HTTP API price per million requestsminimum 0 USD
1 USD
WebSocket price per million messagesminimum 0 USD
1 USD
WebSocket price per million connection minutesminimum 0 USD
0.25 USD
Data transfer out price per GBminimum 0 USD
0.09 USD
REST API cache sizeaccepts 0–237 GB
0 GB
Cache price per hourminimum 0 USD
0.02 USD

Results

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

  1. 1Values used
  2. 2API Gateway Cost
  3. 3REST versus HTTP
  4. 4Estimated Monthly Cost= 38.43
  5. 5Request or Message Cost= 35.00
  6. 6Connection Minute Cost= 0.00
  7. 7Data Transfer Out Cost= 3.43
  8. 8Cache Cost= 0.00
  9. 9Saving by Switching to an HTTP API= 25.00

Assumptions and limits

  • The result is derived only from the 11 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

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.

API Gateway Cost Calculator | Calcrivo