AWS Lambda is the original serverless compute service: you ship a function, AWS runs it on demand and bills only for what executes. The pricing has two moving parts — requests and GB-seconds — and a genuinely useful always-free tier. Here's exactly how it adds up.
| What | Price | Note |
|---|---|---|
| Always-free tier free | $0 | ~1M requests + 400,000 GB-seconds / month |
| Requests | ~$0.20 / 1M | per invocation, after free grant |
| Compute (x86) | ~$0.0000166667 / GB-s | memory × duration, billed per 1ms |
| Compute (ARM / Graviton) | ~20% cheaper / GB-s | same code, lower rate |
| Data transfer out | from ~$0.09 / GB | egress billed separately |
Two lines add up to your Lambda cost. Requests: every invocation counts, at ~$0.20 per million. Compute: you're charged for the memory you allocate multiplied by how long the function runs — a GB-second. A function set to 512 MB (0.5 GB) that runs for 200 ms costs 0.5 × 0.2 = 0.1 GB-seconds per call. At a million calls that's 100,000 GB-seconds — comfortably inside the 400,000 free grant, so you'd pay only the request overage. This is why small, fast functions on Lambda are often effectively free, and why a heavy, long-running, high-memory function is where the cost shows up.
Unlike a 12-month trial, Lambda's ~1M requests and 400,000 GB-seconds per month are always free. For side projects, webhooks, cron-style jobs and low-traffic APIs, that often covers the entire workload — many small Lambda apps genuinely run at $0/month. The cost arrives at scale, with long durations, or with high memory settings. Model your real numbers with the serverless function cost calculator before assuming it's free.
1. Create an AWS account and open the Lambda console.
2. Create function → author from scratch, pick a runtime (Node, Python, etc.) and a memory size.
3. Add a trigger (API Gateway, Function URL, EventBridge schedule, S3 event…).
4. Deploy and test. Watch CloudWatch for duration and memory used, then right-size the memory.
Invoke a Function URL with curl:
Cloudflare Workers (see the Cloudflare guide) bill on CPU time rather than wall-clock and have near-zero cold starts and free egress (R2) — often cheaper for edge/API work. Vercel Functions (see Vercel) wrap serverless in a smoother deploy experience at a premium. Lambda wins on raw flexibility, runtime choice, and deep AWS integration. For long-running or always-on workloads, a small VPS can undercut all three. Compare egress separately with the cloud egress calculator.
Per request (~$0.20/1M) plus compute as GB-seconds (memory × duration), billed in 1ms increments. Free tier: ~1M requests + 400,000 GB-seconds monthly.
Yes — the ~1M requests and 400,000 GB-seconds are an always-free monthly allowance, not a one-off trial.
Yes, but more memory also means more CPU, so functions often finish faster. Tune memory to the point where (memory × duration) is lowest — sometimes a higher memory setting is cheaper overall.
Data-transfer-out (egress), API Gateway charges, provisioned concurrency, and the other AWS services your function calls. The function compute is often the smallest line.
Not affiliated with AWS. Prices are reference estimates and vary by region — always verify on the official pricing page.