AWS API Gateway
Managed API gateway with REST/HTTP/WebSocket APIs, throttling, auth, and Lambda/HTTP integration.
Why
API Gateway handles auth, throttling, caching, and API keys — offloading cross-cutting concerns. HTTP API is 70% cheaper than REST API. 1M requests/mo free for 12 months.
When
Use for public APIs needing auth/throttling, Lambda frontends, and WebSocket. Avoid for internal APIs (use ALB) or gRPC (use ALB with gRPC support).
How
Example
Common Problems
- ⚠REST API expensive — HTTP API 70% cheaper, use unless you need REST-specific features
- ⚠429 throttling — increase burst/rate, or use usage plans per customer
- ⚠Cold start with Lambda — first request slow, provisioned concurrency fixes it
Best Practices
- ✓Use HTTP API over REST — 70% cheaper, covers most use cases
- ✓Enable caching for read-heavy — $0.02/hr per GB, cuts Lambda invocations 90%
- ✓Use usage plans for B2B — per-customer throttling, quota, API keys
FAQ
What is AWS API Gateway and what problem does it solve?
Managed API gateway with REST/HTTP/WebSocket APIs, throttling, auth, and Lambda/HTTP integration. It lets developers deploy, store, and scale without self-managing infrastructure — a core reference for cloud service selection.
How do I get started with AWS API Gateway in 5 minutes?
Two steps to run it: (1) Choose type — REST (full features), HTTP (cheaper, simpler), WebSocket; (2) Routes — /users/{id} → Lambda/HTTP integration. Validate on the free tier first, then wire into production.
What is the #1 pitfall with AWS API Gateway?
The most frequent issue is: REST API expensive — HTTP API 70% cheaper, use unless you need REST-specific features. Run a pre-launch checklist item by item, and add policy/config scanning in CI.
What are the best practices for AWS API Gateway?
Best practices for AWS API Gateway include: Use HTTP API over REST — 70% cheaper, covers most use cases; Enable caching for read-heavy — $0.02/hr per GB, cuts Lambda invocations 90%; Use usage plans for B2B — per-customer throttling, quota, API keys. The first one — "Use HTTP API over REST — 70% cheaper, covers most use cases" — should be a team default baked into your IaC templates.
How do I control cost and avoid bill surprises with AWS API Gateway?
Three ways to prevent overspend: (1) tag every resource with env/team and enable billing alarms; (2) set budget thresholds to trigger Slack/email alerts; (3) review idle resources in Cost Explorer regularly and clean them up. Most AWS API Gateway options offer a free tier — validate within free quota before scaling.