API Gateway Request Cost Calculator

API gateways usually charge a price per million requests, often cheaper above a volume threshold, plus data transfer for responses. Enter your own rates.

Also called: API request pricing calculator

  • Last updated
  • Formula tested against reference values

Your numbers

Billable requests charged at the first price. Leave blank for a single price.

Example price only. Enter the current rate from your provider’s price list.

Example price only. Enter the current rate from your provider’s price list.

1 kB = 1,000 bytes.

Example price only. Enter the current rate from your provider’s price list.

Result

Monthly cost
—

Calculating…

Request charges
—
Data transferred out
—
Data transfer charges
—
Effective price per million requests
—
Billable requests (million)
—

How to use this calculator

  1. Enter or choose requests per month.
  2. Enter or choose free requests.
  3. Enter or choose first price tier covers.
  4. Enter or choose price per million (first tier).
  5. Enter or choose price per million above the first tier.
  6. The monthly cost updates as you type. Use Copy result or Share to keep it.

Method

Billable = Requests − Free; Request cost = min(Billable, Tier) × P1 + max(0, Billable − Tier) × P2; Transfer GB = Requests × Response kB ÷ 1,000,000

Requests, Free, Tier
in millions of requests
P1, P2
price per million requests
Response kB
average response size in kilobytes (1,000 bytes)

Worked example

  1. Billable: 500 − 1 = 499 million.
  2. Requests: 300 × 3.50 + 199 × 2.80 = 1,050 + 557.20 = 1,607.20.
  3. Transfer: 500,000,000 × 2,000 bytes = 1,000 GB × 0.09 = 90. Total 1,697.20.

At these example rates, 500 million requests with 2 kB responses cost about 1,697 a month.

What the result means

Compare the effective price per million with alternatives such as a load balancer or a different gateway type; at high volume the per-request charge can exceed the compute behind it.

Assumptions and limits

  • The free allowance is taken from the first tier.
  • Every request returns the average response size.
  • Caching, WebSocket connection minutes, custom authorisers and the backend’s own costs are not included.

Questions

Do request headers count towards data transfer?

Usually yes. If you know the full response size on the wire, use that instead of the body size.

Why is the effective price lower than the first-tier price?

Requests above the tier are charged at the lower second price, so the average falls as volume rises.