Amazon API Gateway offers REST APIs and HTTP APIs (as well as WebSocket APIs). What would make you choose a REST API over an HTTP API, and what are you giving up if you default to HTTP APIs?
answer
- newer flavor trades features for price
- compare feature surface, not the protocol
- usage plans, caching, request validation
- VTL and private endpoints are REST-only
- default to the cheap one, escalate deliberately
basics
~20 sHTTP APIs are cheaper and lower-latency, so default to them for plain Lambda or HTTP backends. Choose REST APIs when you need what HTTP APIs omit: API keys and usage plans, stage response caching, request validation, VTL mapping templates, private endpoints, or AWS WAF.
solid answer
~50 sAPI Gateway's REST APIs are the original, feature-heavy product; HTTP APIs are the newer, cheaper, lower-latency subset built for the common case of proxying JSON to Lambda or to an HTTP backend. My default is an HTTP API, because most services only need routing, CORS, IAM or JWT authorization and a Lambda proxy integration, and the per-request price and added latency are both materially lower. I move to a REST API when I need something HTTP APIs simply do not have: API keys with usage plans, stage-level response caching, request validation against a JSON Schema model, VTL mapping templates (including the no-Lambda direct integrations into services like SQS or DynamoDB), the `PRIVATE` or edge-optimized endpoint types, AWS WAF association, or X-Ray tracing. The decision is a feature-surface decision, not a protocol one — both types speak ordinary HTTPS.
go deeper
Know that API Gateway has more than one API type and that the newer HTTP API is the cheaper, simpler one. Be able to say that both terminate HTTPS and can proxy to Lambda.
Be ready to name concrete features that exist only on REST APIs — usage plans, stage caching, request validation, VTL templates, private endpoints — and to explain that HTTP APIs add native JWT authorizers in exchange.
Show that you check the feature list against the product roadmap before choosing, because there is no in-place conversion. Talk through the cutover you would run if you had to move an API type after launch.
Own the standard: decide which API type is the org default, what evidence justifies an exception, and how you avoid a fleet where every team invented its own front door with a different authorization and logging story.
## Three products behind one console "API Gateway" is really three API types with two different control planes. **REST APIs** are the original service (the v1 control plane, `AWS::ApiGateway::RestApi`). **HTTP APIs** and **WebSocket APIs** are both v2 (`AWS::ApiGatewayV2::Api`). They are not versions of each other in the sense of an upgrade path — an HTTP API is a separate resource with a separate API surface, so "migrating" a REST API is really rebuilding it and cutting traffic over. HTTP APIs exist because the overwhelmingly common use of API Gateway is boring: take an HTTPS request, authorize it, hand it to a Lambda function or an HTTP backend, return the response. REST APIs charge for, and impose configuration weight for, a lot of machinery most of those services never touch. ## What you get by choosing an HTTP API - **Lower per-request cost.** At entry volumes an HTTP API request costs roughly a third of a REST API request. On a high-traffic public API this is a real line item, not a rounding error. - **Lower added latency.** AWS positions HTTP APIs as meaningfully lower-overhead per call; the service does less work per request because there is no VTL engine, no caching layer and no usage-plan accounting in the path. - **Simpler configuration.** Built-in CORS configuration, an auto-deploying `$default` stage, a `$default` catch-all route, and greedy route syntax such as `ANY /{proxy+}`. - **Built-in JWT authorizers.** HTTP APIs can validate an OIDC/OAuth 2.0 JWT natively, with no authorizer Lambda at all — something REST APIs cannot do (they need a Lambda authorizer or a Cognito user-pool authorizer). - **Payload format 2.0** for Lambda proxy integrations, which is a flatter, smaller event than the REST-era 1.0 shape. ## What only REST APIs have The list is what trips teams up, because each item is something people assume is "just there": - **API keys and usage plans** — per-consumer quotas and rate limits enforced by the gateway. - **Stage response caching** — a managed cache in front of your integration. - **Request validation** — reject a malformed body against a JSON Schema model before the backend is ever invoked. - **VTL mapping templates** — full request *and* response transformation, and with them the `AWS` integration type: calling another AWS service directly, with no Lambda in between. - **Endpoint types** — REST APIs can be `EDGE`, `REGIONAL` or `PRIVATE`. HTTP APIs are regional only; there is no private HTTP API. - **AWS WAF association**, **X-Ray active tracing**, **canary release deployments**, and **API resource policies**. ## What both types do Lambda proxy (`AWS_PROXY`) and HTTP proxy integrations, private integrations to a VPC backend through a VPC link, custom domain names with base-path/API mappings, stages, throttling, CloudWatch metrics and access logs, IAM (SigV4) authorization, Lambda authorizers, and mutual TLS on a custom domain. So the shared ground is large; the gap is at the edges. ## The limit that applies to both Both types are synchronous request/response front doors and cap how long a single integration may take — on the order of 30 seconds (REST APIs default to 29 s, HTTP APIs to 30 s), with the cap raisable on request for some endpoint types. Anything longer needs a different shape: accept the request, return `202 Accepted` with a job id, and let the client poll — or hand the work to Step Functions or a queue. Candidates who propose "just raise the timeout" for a five-minute report generation are missing this. ## How I actually decide Start from HTTP API. Escalate to REST only on a concrete requirement: - I must sell metered access to third parties → REST (usage plans). - The API must be unreachable from the internet → REST (`PRIVATE` endpoint type). - I need WAF rules on the API itself → REST (or front an HTTP API with CloudFront/ALB, which changes the architecture). - I want to drop events straight into SQS with no compute → REST (`AWS` integration + VTL), though a small Lambda is often simpler to own than a VTL template nobody on the team can read. - I need heavy request/response reshaping to keep a legacy contract → REST. And the third flavor: **WebSocket APIs** are not a competitor to either. Choose one when the client needs server-initiated push over a long-lived connection rather than request/response. ## The trap The expensive version of this mistake is picking HTTP APIs for the price, shipping, and then discovering six months in that the partner integration needs per-key quotas. Because there is no in-place conversion, the fix is a new API plus a cutover. Check the feature list against your roadmap, not just today's requirements.
- Can you convert an existing REST API into an HTTP API in place?No. They are different resource types on different control planes, so there is no in-place conversion. You build the HTTP API alongside the existing one, rebuild authorizers and any mapping-template logic (usually as code in the handler), then cut traffic over — typically by repointing a custom domain's API mapping, which lets you roll back quickly.
- Where does a WebSocket API fit in this comparison?It is a different shape, not a cheaper tier. A WebSocket API keeps a long-lived connection and routes frames to backends using a route selection expression, with reserved `$connect`, `$disconnect` and `$default` routes. Choose it when the server must push to the client; for ordinary request/response traffic it adds connection state you would otherwise not have to manage.
- Your service needs AWS WAF but you already run an HTTP API. What are your options?WAF cannot be attached to an HTTP API directly. Practical options are to put CloudFront in front of the API and associate the web ACL there, front it with an ALB, or rebuild as a regional REST API and associate the web ACL with the stage. Each changes your traffic path, so weigh it against the cost saving that drove the HTTP API choice.
saying these in an interview costs you the question
- Calls HTTP APIs "REST APIs version 2" with everything included
- Assumes API keys and usage plans work on HTTP APIs
- Believes AWS WAF can be attached to an HTTP API
- Thinks either type can hold a request open for minutes
- Picks REST APIs merely because the backend is REST-shaped