serverlessawsapi-gatewaycost-optimization

Function URLs versus API Gateway versus ALB: the front door cost

Three ways to put a function on the internet, three completely different pricing models. One is free, one bills per request, one bills per hour. Here is where each becomes the cheapest option.

The C3X Team··7 min read

Quick answer

Lambda Function URLs add no charge at all beyond the function's own invocation and duration. HTTP APIs on API Gateway cost $1.00 per million requests for the first 300 million, then $0.90. REST APIs cost $3.50 per million for the first 333 million. An Application Load Balancer costs $0.0225 per hour, about $16.43 a month, plus $0.008 per LCU-hour, so it starts around $18 to $25 a month regardless of traffic but does not charge per request. The crossover: Function URLs win at any volume when you need nothing extra, HTTP APIs win when you need auth and routing below roughly 25 million requests a month, and an ALB wins above that if it is already carrying other traffic.

The HTTP front door in front of a function is one of the few serverless decisions where the pricing models are structurally different rather than just numerically different. One is free, one is purely usage-based, one is mostly fixed. That means the right answer flips as volume changes, and a default chosen at 100,000 requests a month can be badly wrong at 100 million.

The three price shapes

OptionFixed costPer-request cost
Lambda Function URL$0$0
API Gateway HTTP API$0$1.00 per million (then $0.90 above 300M)
API Gateway REST API$0$3.50 per million (then $2.80 above 333M)
Application Load Balancer$16.43 per monthLCU-based, ~$0.008 per LCU-hour

Function URLs really are free at the front door. You pay the standard $0.20 per million Lambda requests and the duration, which you would pay anyway. What you do not get is request validation, usage plans, API keys, WAF integration without extra work, custom domains without CloudFront in front, or anything beyond a single function per URL.

What the money buys on API Gateway

HTTP APIs at $1.00 per million give you JWT authorizers, routing across multiple integrations, CORS handling, custom domains, throttling, and automatic request and response handling. REST APIs at $3.50 per million add request and response transformation, API keys and usage plans, request validation, WAF attachment, private endpoints, and caching (billed separately, from $0.020 per hour for a 0.5 GB cache).

Monthly requestsFunction URLHTTP APIREST APIALB (dedicated)
1 million$0$1.00$3.50~$18
10 million$0$10.00$35.00~$20
50 million$0$50.00$175.00~$28
250 million$0$250.00$875.00~$60
1 billion$0$930.00$2,744.00~$180

ALB figures assume modest LCU consumption. An LCU covers whichever dimension is highest among 25 new connections per second, 3,000 active connections per minute, 1 GB per hour of processed bytes, and 1,000 rule evaluations per second. High request rates with small payloads consume LCUs mostly through new connections and rule evaluations, so keep-alive and a short rule list keep the number low.

Where the crossovers sit

An ALB overtakes an HTTP API somewhere around 20 to 30 million requests a month for a simple workload, earlier if the LCU consumption stays light and later if payloads are large. Against a REST API the ALB crossover comes far sooner, around 5 to 8 million requests a month. Function URLs are cheapest at every volume, which makes the question purely about capability rather than price.

The important nuance is that an ALB you already run for containers or instances costs nothing extra to point at a Lambda target group beyond incremental LCUs. That is a common and very cheap pattern for teams running a mixed estate. A dedicated ALB for one low-traffic function, by contrast, is the worst option on the table: $18 a month to serve requests that an HTTP API would handle for a few cents.

The extras that change the comparison

Two API Gateway features are billed separately and can dominate the base request price. REST API caching starts at $0.020 per hour for 0.5 GB, about $14.60 a month, and rises steeply: a 6.1 GB cache is $0.200 per hour, roughly $146 a month, per stage. Since most teams run at least two stages, caching can quietly cost more than the requests it serves. WAF, often attached to a public API, charges $5.00 per web ACL per month plus $1.00 per rule and $0.60 per million requests inspected, which on 100 million requests a month is $60 of inspection on top. Neither of these is wrong to buy, but both belong in the comparison, because a Function URL behind CloudFront can attach the same WAF and get caching for free.

Choosing without regretting it

SituationBest choice
Webhook receiver, internal tool, single functionFunction URL
Public API needing JWT auth and routingHTTP API
API keys, usage plans, request validationREST API
Very high volume, existing load balancerALB target group
Needs a CDN and edge caching anywayCloudFront in front of a Function URL

A CloudFront distribution in front of a Function URL is an underrated middle ground: it adds a custom domain, WAF, and caching, costs $0.085 per GB for the first 10 TB of egress plus $0.0075 per 10,000 HTTPS requests, and can be cheaper than an HTTP API for cacheable traffic because cache hits never reach the function at all. A 70 percent cache hit rate removes 70 percent of your invocation and duration charges as well.

Also remember that data transfer out is charged whichever door you use, starting at $0.09 per GB for the first 10 TB from most regions, and that is often larger than the request fee for response-heavy APIs. Compare options against the REST and HTTP API pricing detailand price the whole entry path against the resource catalog before you commit to a front door.

FAQ

Do Lambda Function URLs cost anything?

No. Function URLs add no charge beyond the standard Lambda request price of $0.20 per million and the duration you would pay anyway. There is no per-request front-door fee. The trade-off is capability: no usage plans, no API keys, no built-in request validation, one function per URL, and custom domains require CloudFront in front.

When is an ALB cheaper than API Gateway for Lambda?

An ALB costs about $16.43 a month in hourly charges plus LCU fees, so it overtakes an HTTP API at roughly 20 to 30 million requests a month and a REST API at roughly 5 to 8 million. If you already run an ALB for containers or instances, adding a Lambda target group costs only incremental LCUs, which makes it cheap at almost any volume.

What is the difference between HTTP API and REST API pricing?

HTTP APIs cost $1.00 per million requests for the first 300 million and $0.90 per million above that. REST APIs cost $3.50 per million for the first 333 million and $2.80 above. REST APIs are 3.5 times the price and buy request and response transformation, API keys and usage plans, request validation, WAF attachment, private endpoints, and optional caching.

Should I put CloudFront in front of a Function URL?

It is often the best value for public traffic. CloudFront adds a custom domain, WAF, and caching at $0.085 per GB for the first 10 TB plus $0.0075 per 10,000 HTTPS requests. Cache hits never reach the function, so a 70 percent hit rate also removes 70 percent of invocation and duration charges, which no API Gateway option can do.

What counts as an LCU on an Application Load Balancer?

An LCU is billed on the highest of four dimensions: 25 new connections per second, 3,000 active connections per minute, 1 GB per hour of processed bytes, and 1,000 rule evaluations per second, at $0.008 per LCU-hour. High request rates with small payloads typically consume LCUs through new connections and rule evaluations, so keep-alive connections and a short rule list keep costs down.

How does C3X help choose a serverless front door?

C3X prices API Gateway stages, load balancers, and Lambda functions from Terraform together, so the front-door cost appears alongside the compute it fronts. At review time you can see that a dedicated ALB for one low-traffic function costs $18 a month while an HTTP API would cost cents, or that at 100 million requests the reverse is true.

What to do next

Pick the front door with the price attached. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.

Try C3X on your own Terraform

Free and open source. No API key required. One command to install, one command to estimate.