Architecture

API Gateway HTTP API vs REST API: which one to use

Amazon API Gateway HTTP API vs REST API compared: cost, latency, auth, validation, usage plans, caching — and when function URLs are enough.

  • 3 min read
  • Updated December 2, 2026

Amazon API Gateway offers two products for building HTTP endpoints in front of AWS Lambda and other backends: REST APIs (the original, feature-rich version) and HTTP APIs (newer, simpler, faster, and cheaper). Lambda function URLs add a third, even simpler option. This guide compares them and gives a default for new serverless APIs.

The short answer

  • Default to HTTP APIs for most Lambda-backed APIs.
  • Choose REST APIs when you need a REST-only feature: usage plans and API keys, request validation, API caching, AWS WAF attached directly to the API, private endpoints, or request/response transformations with mapping templates.
  • Use Lambda function URLs for single-function endpoints such as webhooks, internal tools, or response streaming, when you don't need API Gateway's routing and authorization features.

Cost and latency

HTTP APIs are priced significantly lower per million requests than REST APIs and add less latency per request. For a high-traffic API, the difference is often one of the larger savings available in a serverless cost review. Function URLs have no charge beyond the Lambda invocation itself.

Feature comparison

Authorization

  • HTTP APIs: native JWT authorizers (Amazon Cognito or any OIDC provider) configured without code, plus Lambda authorizers and IAM authorization.
  • REST APIs: Cognito user pool authorizers, Lambda authorizers (token and request types), IAM, and API keys with usage plans, plus resource policies for fine-grained access control.
  • Function URLs: IAM authorization or none (you then authenticate inside the function).

Request validation and transformation

REST APIs can validate request bodies against JSON Schema models and transform requests and responses with Velocity mapping templates — useful when integrating directly with AWS services without a Lambda function. HTTP APIs offer simpler parameter mapping; validation belongs in your handler (for example with Zod).

Throttling and quotas

Both support stage and route throttling. Only REST APIs offer usage plans — per-client quotas and throttles tied to API keys — which matter if you sell API access or need per-customer limits at the gateway.

Caching

REST APIs have a built-in, per-stage response cache. HTTP APIs don't; put CloudFront in front when you need edge caching, which also works for REST APIs.

Security and networking

  • AWS WAF attaches directly to REST APIs. For HTTP APIs, put CloudFront with WAF in front.
  • Private APIs reachable only from your VPCs are a REST API feature.
  • Mutual TLS and custom domains are available for both.

Integrations

Both integrate with Lambda, HTTP backends, and private resources through VPC links. REST APIs support a broader set of direct AWS service integrations; HTTP APIs support first-class integrations with a selection of services such as SQS, EventBridge, Step Functions, Kinesis, and AppConfig.

CORS, payloads, and timeouts

HTTP APIs make CORS a simple configuration block. Payload limits are similar for both (10 MB requests through API Gateway, with Lambda's own 6 MB synchronous limit applying to Lambda integrations). Integration timeouts are around 29–30 seconds by default for both; longer work should become asynchronous (return 202 Accepted and process in the background) rather than holding a request open.

WebSockets

WebSocket APIs are a separate API Gateway product, used for bidirectional real-time communication with Lambda handling connect, disconnect, and message routes.

Function URLs in more detail

A function URL gives a Lambda function its own HTTPS endpoint. It supports CORS, IAM or no authorization, and response streaming, which is useful for large responses and AI token streaming. It lacks routing, JWT authorizers, throttling per route, and custom domains (put CloudFront in front for those). It is a great fit for webhooks from third parties that sign their requests, and for internal endpoints called by other AWS services with IAM.

Migrating from REST to HTTP APIs

If you have a REST API and don't use REST-only features, migration is usually straightforward:

  1. Create an HTTP API with the same routes and integrations.
  2. Replace Cognito authorizers with JWT authorizers.
  3. Move request validation into handlers.
  4. Switch the custom domain's API mapping to the new API.
  5. Watch error rates and latency, then remove the old API.

Check the Lambda event payload format: HTTP APIs default to payload format version 2.0, which differs from the REST API event shape, so handlers may need small changes.

Summary

Choose HTTP APIs by default, REST APIs when you need usage plans, validation, caching, direct WAF, private endpoints, or mapping templates, and function URLs for simple single-function endpoints. If you're unsure which features you actually rely on, it's one of the first things we check in a serverless architecture review.

Services

Related services

How we can help you put this guide into practice.

Guides

More guides

Keep reading.

Let's make your serverless workload simpler, safer, and cheaper.

Start with a free 30-minute intro call with a serverless engineer.

Book a consultation