API Gateway vs ALB vs CloudFront cost: what to compare (requests, transfer, add-ons)

People often compare API Gateway, ALB, and CloudFront as “three ways to serve traffic”. Cost comparisons go wrong when you compare only one line item (like request price) and ignore transfer, caching, and add-ons.

Start with the same inputs

  • Requests/month (baseline + busy-month scenario)
  • Average response size over the wire (compressed)
  • Cacheability (expected cache hit rate if using a CDN)
  • Traffic path (internet vs private/VPC, cross-region boundaries)

What you pay for (high-level)

Option Primary drivers Common “hidden” drivers
API Gateway Requests + transfer Access logs, WAF, downstream compute (Lambda), retries
ALB Hours + processed data / capacity units Cross-zone, logs, WAF, upstream compute, health check traffic
CloudFront Edge bandwidth + edge requests Origin egress (cache misses), invalidations, logs/analytics

Why CloudFront can change the answer

CloudFront doesn’t replace an API by itself; it changes the traffic profile. If responses are cacheable, a CDN can reduce the number of origin/API requests and the amount of origin transfer, which often matters more than the per request price.

  • Origin requests/month ~= edge requests/month × (1 - cache hit rate)
  • Origin egress GB/month ~= edge bandwidth GB/month × (1 - cache hit rate)

Related: CloudFront cache hit rate.

A fast comparison workflow

  1. Estimate requests/month: request volume methods.
  2. Estimate transfer from response size: response size to transfer.
  3. Model API request + transfer with API Gateway cost calculator.
  4. Model CDN bandwidth/requests with CloudFront cost calculator (or generic CDN).
  5. Model ALB with AWS load balancer cost calculator.
  6. Add add-ons as separate line items: WAF, logs, custom domains, and any downstream compute.

Common pitfalls

  • Comparing only request fees and ignoring transfer (often dominates for non-trivial payloads).
  • Using uncompressed payload sizes (overstates transfer).
  • Assuming a cache hit rate without validating cacheability and caching headers.
  • Ignoring retries/timeouts (can multiply requests and bytes during incidents).
  • Forgetting log/analytics costs (CloudWatch, S3, Athena, SIEM ingestion).

Validation checklist

  • Validate a real week of requests and transfer from metrics/logs (not only peak RPS).
  • Validate cache hit rate with a test distribution before committing to a CDN-driven savings claim.
  • Confirm pricing boundaries: region, internet egress vs internal transfer, and which layer emits logs.

Sources


Related guides


Related calculators


FAQ

Which is cheaper: API Gateway or ALB?
It depends on request volume, payload size, and which features you need. For large payloads, transfer and caching usually matter more than the per-request price.
Where does CloudFront fit in?
CloudFront is a CDN layer. It can reduce origin/API traffic via caching and can change the cost outcome by cutting origin requests and origin transfer.
What's the fastest way to compare options?
Use the same traffic inputs (requests/month, average response size, cache hit rate) and price each option as a simple model. Then add feature add-ons (WAF, logs, custom domains) as separate line items.

Last updated: 2026-01-27