How much does it cost to run a REST API at 1 million requests a day?
A REST API handling 30 million requests a month costs 267 dollars a month serverless or 579 dollars on containers. Here is the full breakdown of both, and where the crossover actually sits.
Quick answer
A REST API handling 1 million requests a day (30 million a month) with a 500 GB datastore and 60 GB of egress costs roughly 267 dollars a month serverless or 579 dollars on containers. That is 8.89 dollars per million requests serverless against 19.31 on containers. Serverless wins at this volume because the container stack pays fixed costs (load balancer at 87 dollars, NAT gateway at 70, managed database at 182) whether requests arrive or not. The crossover sits near 250 to 350 million requests a month, where per-request charges overtake the fixed footprint.
A million requests a day sounds substantial and is, in infrastructure terms, quite small: 11.6 requests per second on average, maybe 60 at peak. That is the volume where the serverless versus containers question is genuinely open, because neither answer is obviously right. Here are both architectures priced completely.
The workload we are pricing
Assume a JSON REST API in us-east-1 serving 30 million requests a month with a 4x daily peak. Median response time is 40 milliseconds and p99 is 250. Responses average 2 KB, so egress is about 60 GB a month. The data layer holds 500 GB. There are roughly 6 million writes a month against 30 million reads, a typical 5:1 read-heavy pattern. The API needs TLS, authentication, rate limiting, and structured logging.
Option A: serverless
| Component | Specification | Monthly cost |
|---|---|---|
| Datastore | DynamoDB on-demand, 30M reads, 6M writes, 500 GB | $140.00 |
| Compute | 30M Lambda invocations, 512 MB, 120 ms | $36.00 |
| Logs | 60 GB ingest plus retention | $33.00 |
| API layer | HTTP API, 30M requests at 1.00 per million | $30.00 |
| CDN and egress | CloudFront 60 GB plus 30M requests | $27.60 |
| Total | $266.60 |
Option B: containers
| Component | Specification | Monthly cost |
|---|---|---|
| Database | RDS db.m5.large plus 500 GB gp3 | $182.33 |
| Compute | 4 Fargate tasks at 1 vCPU / 2 GB | $144.16 |
| Load balancer | ALB plus about 12 LCU | $86.51 |
| NAT gateways | 2 gateways plus 100 GB processed | $70.20 |
| Logs | 60 GB ingest plus retention | $33.00 |
| CDN and egress | CloudFront 60 GB plus 30M requests | $27.60 |
| Cache | ElastiCache cache.t4g.small | $23.36 |
| DNS | Route 53 zones and queries | $12.00 |
| Total | $579.16 |
Why serverless wins here
The container stack pays 339 dollars in fixed costs (load balancer, NAT gateways, database instance, cache, DNS) before serving a single request. The serverless stack pays almost nothing fixed: 96 dollars of the 267 is per-request charges and 140 dollars is storage. At 11.6 requests per second, a 4-task Fargate fleet sized to survive a 4x peak spends most of its life idle.
| Monthly requests | Serverless | Containers | Cheaper |
|---|---|---|---|
| 3 million | $156 | $550 | Serverless by 3.5x |
| 30 million | $267 | $579 | Serverless by 2.2x |
| 150 million | $745 | $780 | About equal |
| 300 million | $1,420 | $1,050 | Containers by 1.4x |
| 1 billion | $4,500 | $2,400 | Containers by 1.9x |
The crossover is around 150 million requests a month, which is 5 million a day or about 58 requests per second sustained. Below that, serverless is cheaper and requires less operational work. Above it, the fixed container footprint amortizes and the per-request charges on API Gateway, Lambda, and on-demand table capacity start to dominate. The general shape of this curve is explored inLambda versus EC2 breakeven.
The API layer is a third of the serverless bill
Thirty dollars for HTTP API at 1.00 per million requests is 11 percent of the serverless total, and it is the line with the clearest alternative. REST APIs with the full feature set (usage plans, request validation, API keys) cost 3.50 per million, which would be 105 dollars instead of 30. Going the other direction, a Lambda function URL with a CloudFront distribution in front costs nothing per request beyond the CDN charges already in the table, saving the full 30 dollars at the price of losing built-in throttling and authorizer integration.
For most APIs the HTTP API tier is the right middle ground. It is worth knowing the 3.5x gap to the REST variant, though, because teams default to it without realizing that at 300 million requests it is the difference between 300 and 1,050 dollars.
The datastore is the real decision
In the serverless option, 140 dollars of the 267 is DynamoDB, and 125 of that is storage for 500 GB at 0.25 per gigabyte. Object storage would hold the same data for 11.50 dollars, and a relational instance with a 500 GB volume for 57.50. DynamoDB storage is expensive per gigabyte and cheap per operation; relational storage is the reverse. At 30 million operations and 500 GB, the crossover is close, which is why both options land within a factor of two of each other.
If the dataset grows to 5 TB with the same request volume, DynamoDB storage becomes 1,250 dollars and the relational option becomes clearly cheaper. If requests grow to 300 million with the same 500 GB, the relational instance needs upsizing while DynamoDB just charges more per operation. Model both against your expected growth axis rather than picking on today's numbers.
Unit economics
At 267 dollars for 30 million requests, the API costs 8.89 dollars per million, or 0.0000089 dollars per request. A request that generates a cent of revenue leaves a 1,100x margin on infrastructure. That ratio is why most API businesses should optimize for iteration speed rather than cost at this scale, and revisit when volume crosses the 150 million mark. Price both architectures from Terraform against theresource catalog before committing, since the choice is much harder to reverse than to make.
FAQ
How much does it cost to run a REST API at 1 million requests a day?
About 267 dollars a month on a serverless stack (HTTP API, Lambda, DynamoDB, CDN, logs) or 579 dollars on containers (Fargate, ALB, managed Postgres, cache, NAT gateways, CDN, logs). That is 8.89 dollars per million requests serverless against 19.31 on containers, for an API with a 500 GB datastore and 60 GB of monthly egress.
Is serverless cheaper than containers for an API?
At 30 million requests a month, yes, by about 2.2x, because the container stack pays 339 dollars in fixed costs (load balancer, NAT gateways, database instance, cache, DNS) before serving a request. The crossover is near 150 million requests a month, roughly 58 sustained requests per second. Above that the fixed footprint amortizes and per-request charges on the serverless side start to dominate.
How much does API Gateway cost per million requests?
HTTP APIs cost 1.00 dollar per million requests, so 30 dollars for 30 million, which is 11 percent of a serverless API bill at this scale. REST APIs with usage plans, request validation, and API keys cost 3.50 per million, a 3.5x difference that is trivial at 30 million requests and the gap between 300 and 1,050 dollars at 300 million.
Is DynamoDB or a relational database cheaper for an API?
It depends on the ratio of data size to request volume. DynamoDB storage costs 0.25 per gigabyte, so 500 GB is 125 dollars, while a relational instance with a 500 GB gp3 volume stores the same for 57.50 plus the instance. DynamoDB is cheap per operation and expensive per gigabyte; relational is the reverse. At 5 TB with the same traffic, relational clearly wins; at 300 million requests with 500 GB, DynamoDB scales more smoothly.
What is a reasonable cost per million API requests?
Between 9 and 20 dollars per million depending on architecture, at the scale priced here. Serverless comes in at 8.89 and containers at 19.31 for 30 million monthly requests. Both numbers fall with volume: containers reach roughly 3.50 per million at a billion requests, and serverless flattens near 4.50 because its charges are almost entirely per-request.
How does C3X help choose between serverless and containers?
C3X reads your Terraform and prices both architectures against a live catalog, so the comparison is made with your actual resource definitions rather than a blog post's assumptions. Since the fixed footprint of a container stack (load balancer, NAT gateways, database instance) is what decides the answer at low volume, having those priced explicitly before you commit is the point at which the decision is cheapest to make.
What to do next
Compare both architectures before you commit. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.
Share this post
Try C3X on your own Terraform
Free and open source. No API key required. One command to install, one command to estimate.