AWS API Gateway Cost Calculator & Pricing Guide
API Gateway is the front door for Lambda-backed APIs โ but its pricing model has several components that can surprise teams at scale. This guide breaks down REST vs HTTP API costs, caching economics, data transfer charges, and when to switch to alternatives.
API Gateway Pricing Comparison
| API Type | First Tier (per M req) | Higher Volume | Caching Available | Key Features |
|---|---|---|---|---|
| REST API (v1) | $3.50 | $2.80 (333M+) | Yes ($0.02-$3.80/hr) | Full features, WAF, usage plans |
| HTTP API (v2) | $1.00 | $0.90 (300M+) | No | JWT auth, CORS, 71% cheaper |
| WebSocket API | $1.00/M msgs | $0.80/M msgs | No | Real-time bidirectional |
Monthly Cost Estimator
| Monthly Requests | REST API Cost | HTTP API Cost | Savings with HTTP API |
|---|---|---|---|
| 1 million | $3.50 | $1.00 | $2.50 (71%) |
| 10 million | $35.00 | $10.00 | $25.00 (71%) |
| 100 million | $350.00 | $100.00 | $250.00 (71%) |
| 1 billion | $3,080.00 | $910.00 | $2,170.00 (70%) |
Creating an HTTP API (Cheapest Option)
# AWS CLI โ create HTTP API (v2, $1/M requests)
aws apigatewayv2 create-api \
--name my-http-api \
--protocol-type HTTP \
--cors-configuration AllowOrigins=["*"],AllowMethods=["GET","POST"],AllowHeaders=["Content-Type","Authorization"]
# Create Lambda integration
aws apigatewayv2 create-integration \
--api-id $API_ID \
--integration-type AWS_PROXY \
--integration-uri arn:aws:lambda:us-east-1:123456789:function:my-function \
--payload-format-version 2.0
# Serverless Framework โ HTTP API (default in v3)
functions:
api:
handler: src/handler.ts
events:
- httpApi: # HTTP API (v2) โ $1/M
path: /users
method: GET
# Use 'http' for REST API (v1) โ $3.50/M
# - http:
# path: /users
# method: GET API Gateway vs ALB vs CloudFront
| Option | Base Cost | Per Request | Best For |
|---|---|---|---|
| API GW HTTP API | $0/mo min | $1.00/M | Serverless APIs, low traffic |
| ALB + Lambda | ~$16/mo min | ~$0.008/LCU-hr | High traffic, steady load |
| Lambda Function URL | $0/mo min | Lambda cost only | Direct Lambda, no routing needed |
Cost Optimization: Enable Caching
# REST API with caching (reduces Lambda invocations)
# serverless.yml
provider:
apiGateway:
restApiId: !Ref ApiGatewayRestApi
shouldStartNameWithService: true
custom:
apiGatewayThrottling:
maxRequestsPerSecond: 1000
maxConcurrentRequests: 500
functions:
getUser:
handler: src/getUser.handler
events:
- http:
path: /users/{id}
method: GET
caching:
enabled: true
cacheKeyParameters:
- name: request.path.id
ttlInSeconds: 300 # 5 min cache
# Cache size 0.5GB = $0.020/hour = $14.40/month
# If cache reduces 80% of 10M requests: saves $2.80/month on Lambda
# ROI: needs ~500K requests/day to justify 0.5GB cache Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad โAI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini โ organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad โDeveloper Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad โYou Might Also Need
LLM Cost Calculator
Compare monthly API costs across GPT-4o, Claude Sonnet, Gemini Pro, and 12+ models. Enter daily requests and token counts for instant cost estimates.
Open free tool โ
AWS CDK Infrastructure as Code Guide
Complete AWS CDK guide for TypeScript/Python IaC. Learn constructs (L1/L2/L3), stacks, CDK Pipelines, diff/deploy workflow, and comparison with Terraform and CloudFormation.
Open free tool โ
AWS Cost Estimator
Estimate monthly AWS costs for EC2, RDS, S3, CloudFront, and Load Balancers. Interactive calculator with itemized breakdown.
Open free tool โ
More Free Tools
Related Articles
AWS Lambda Cold Start Optimization: 10 Proven Techniques 2026
Eliminate or minimize AWS Lambda cold starts with 10 proven techniques: provisioned concurrency, SnapStart, package minimization, ARM Graviton2, lazy loading, and more with benchmark data.
Serverless vs Containers 2026: Lambda vs Docker Decision Guide
When should you use AWS Lambda vs Docker containers? This 2026 guide covers cost models, cold starts, use cases, hybrid architectures, and a decision flowchart to help you choose.
Cloud Deployment Tools in 2026: From Containers to Serverless
A practical guide to cloud deployment tools in 2026. Compare deployment strategies, container platforms, serverless frameworks, and GitOps workflows that enterprise teams use to ship software reliably.
Serverless vs Containers 2026: When to Use Each
Decision framework for choosing between serverless functions and containers in 2026. Cost analysis, cold start realities, architecture patterns, and the right tool for each workload type.
Serverless Cold Starts: How to Reduce Lambda Latency by 80%
Learn what causes AWS Lambda cold starts and how to reduce latency by 80%. Covers runtime comparison, Provisioned Concurrency, SnapStart, package optimization, and best practices.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- โก AI Code Review, Doc Generator & SQL Builder
- โก All premium templates & early access
- โก Member discounts on Gumroad products
$9/mo after trial ยท Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products โ grab them all at once and save big.
MIT licensed ยท Instant download ยท No subscription
See what's included โ Browse all deals โFrequently Asked Questions
What is the difference between REST API and HTTP API in API Gateway?▼
REST API (v1) is the original API Gateway type offering full features: usage plans, API keys, request/response mapping templates, caching, WAF integration, and custom authorizers. HTTP API (v2) is a newer, cheaper, faster alternative with fewer features but 71% lower cost. HTTP APIs support JWT authorizers, Lambda integrations, and CORS natively. For most new Lambda-backed APIs, HTTP API is the better choice unless you need caching, usage plans, or complex mapping templates.
How much does API Gateway cost per million requests?▼
REST API costs $3.50 per million requests in us-east-1 (first 333M/month), then $2.80/million. HTTP API costs $1.00 per million for the first 300M/month, then $0.90/million. WebSocket API costs $1.00 per million connection-minutes plus $1.00/million messages. HTTP API is 71% cheaper than REST API for most workloads.
Does API Gateway charge for data transfer?▼
API Gateway charges for data transfer out to the internet at standard AWS rates ($0.09/GB for the first 10TB). Requests from within AWS (same region) to API Gateway are free. For high-bandwidth APIs returning large responses, this data transfer cost can exceed the per-request cost. Use compression (gzip/brotli), response pagination, and caching to minimize data transfer.
How does API Gateway caching work and what does it cost?▼
REST API (not HTTP API) supports response caching with a configurable TTL. Cache sizes range from 0.5GB ($0.020/hour) to 237GB ($3.800/hour). Caching can dramatically reduce Lambda invocations and latency. Cache hits return stored responses without invoking Lambda. Consider caching if you have repeated identical requests with stable responses โ the cache cost often pays for itself by reducing Lambda invocations.
Is API Gateway cheaper than ALB for Lambda backends?▼
Application Load Balancer (ALB) costs $0.008/LCU-hour plus $0.0065/hour base (~$4.75/month minimum). For low-traffic APIs (under 1M requests/month), API Gateway HTTP API is often cheaper โ no minimum hourly cost. For high-traffic APIs (10M+ requests/month), ALB becomes cost-competitive and offers features like sticky sessions and health checks. CloudFront + Lambda Function URL is another option for global APIs.
What are the API Gateway request and payload size limits?▼
API Gateway limits: Maximum integration timeout is 29 seconds (REST/HTTP API). Maximum request payload is 10MB (REST) or 10MB (HTTP). Maximum response payload is 10MB. For larger payloads or longer timeouts, use S3 pre-signed URLs for file uploads, and Step Functions or SQS for async long-running operations triggered via API Gateway.