aws_apigatewayv2_route cost estimation
A route (like GET /items or a WebSocket action) on an HTTP or WebSocket API. Routes are free. The parent API bills $1.00 per million requests for HTTP APIs, or per message plus connection minutes for WebSocket APIs.
The aws_apigatewayv2_route resource maps a route key (such as GET /items, POST /orders, or a WebSocket $connect action) to an integration on an API Gateway v2 API. Defining routes is free. AWS does not charge per route regardless of how many you create.
Cost lives in the parent aws_apigatewayv2_api and the requests or messages that flow through your routes. For HTTP APIs, the rate is $1.00 per million requests for the first 300 million requests per month, then $0.90 per million above that in us-east-1. This is the cheaper alternative to REST APIs ($3.50 per million), which is the main reason to choose HTTP APIs when your routes are simple Lambda or HTTP proxies. Data transfer out is billed separately at standard rates (about $0.09/GB for the first 10 TB).
WebSocket APIs bill differently and this trips people up. You pay $1.00 per million messages (for messages up to 32 KB, and larger messages count as multiple 32 KB units) plus $0.25 per million connection-minutes. A chat or live-dashboard app with many long-lived idle connections can rack up connection-minute charges even when almost no messages flow. Ten thousand connections held open for a day is 14.4 million connection-minutes, about $3.60 per day just to keep the sockets open, before any message traffic. Routes like $connect, $disconnect, and $default are where you attach the logic, but the meter runs on connections and messages, not routes.
A cost-adjacent gotcha: routes with a JWT or Lambda authorizer add cost on the integration side. A Lambda authorizer invokes a function per uncached request, so each protected route also generates Lambda billing. HTTP API JWT authorizers, by contrast, are validated by API Gateway itself with no extra Lambda invocation, which is both cheaper and faster. Choosing a JWT authorizer over a Lambda authorizer where possible removes a per-request Lambda charge from every protected route.
c3x flags aws_apigatewayv2_route as free and attributes request, message, connection, and data transfer cost to the parent API.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_apigatewayv2_api" "http" {
name = "items-api"
protocol_type = "HTTP"
}
resource "aws_apigatewayv2_integration" "items" {
api_id = aws_apigatewayv2_api.http.id
integration_type = "AWS_PROXY"
integration_uri = aws_lambda_function.items.invoke_arn
payload_format_version = "2.0"
}
resource "aws_apigatewayv2_route" "get_items" {
api_id = aws_apigatewayv2_api.http.id
route_key = "GET /items"
target = "integrations/${aws_apigatewayv2_integration.items.id}"
}
resource "aws_apigatewayv2_route" "create_item" {
api_id = aws_apigatewayv2_api.http.id
route_key = "POST /items"
target = "integrations/${aws_apigatewayv2_integration.items.id}"
}Pricing dimensions
What you actually pay for when you provision aws_apigatewayv2_route.
| Dimension | Unit | What's being charged |
|---|---|---|
| Route definition | free | Defining routes and route keys on an HTTP or WebSocket API carries no AWS charge. $0 (free) |
| HTTP API requests | per million requests | The parent HTTP API bills per request, tiered by monthly volume. Roughly 70 percent cheaper than a REST API. $1.00 per million (first 300M) in us-east-1 |
| WebSocket messages | per million messages | WebSocket APIs bill per message. Messages larger than 32 KB count as multiple units. $1.00 per million messages |
| WebSocket connection minutes | per million connection-minutes | Every minute a WebSocket connection stays open is billed, even when idle. $0.25 per million connection-minutes |
Optimization tips
Common ways to reduce aws_apigatewayv2_route cost without changing the workload.
Prefer HTTP APIs over REST APIs for proxy routes
About 70 percent on request chargesHTTP API routes cost $1.00 per million requests versus $3.50 for REST. If your routes are simple Lambda or HTTP proxies without usage plans or request transformation, HTTP APIs are the cheaper choice.
Use JWT authorizers instead of Lambda authorizers where possible
Removes one Lambda invocation per protected requestHTTP API JWT authorizers are validated by API Gateway with no extra Lambda invocation. A Lambda authorizer bills a function call per uncached request on every protected route.
Close idle WebSocket connections
$3.60/day per 10,000 idle connections held for 24 hoursConnection-minutes bill whether or not messages flow. Enforce idle timeouts and disconnect stale clients so you are not paying to hold thousands of dead sockets open.
Batch small WebSocket messages
Messages are billed in 32 KB units. Coalescing many tiny updates into fewer, larger frames reduces message count without losing data for dashboards and telemetry feeds.
FAQ
Are API Gateway v2 routes free?
Yes. Routes are configuration and cost nothing to define. You pay at the parent API level: per request for HTTP APIs, or per message plus per connection-minute for WebSocket APIs, plus data transfer out.
Why is my WebSocket bill high when traffic is low?
WebSocket APIs charge $0.25 per million connection-minutes just to keep connections open. Many long-lived idle connections accumulate connection-minutes even with almost no messages. Enforce idle timeouts and disconnect inactive clients to control this.
How much cheaper is an HTTP API than a REST API?
HTTP API requests are $1.00 per million versus $3.50 per million for REST, roughly 70 percent less. HTTP APIs drop some REST features (usage-plan API keys, request/response transformation, per-method caching), so use them when your routes are simple proxies.
Do route authorizers add cost?
Lambda authorizers do, because they invoke a function per uncached request. HTTP API JWT authorizers do not, since API Gateway validates the token itself. Prefer JWT authorizers on protected routes to avoid a per-request Lambda charge.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_apigatewayv2_route.