google_api_gateway_api cost estimation
A managed gateway for serverless backends. Priced per million API calls, with a free tier and no always-on cost.
A google_api_gateway_api fronts serverless backends (Cloud Functions, Cloud Run, App Engine) with a managed API layer handling auth, keys, and routing. The pricing is entirely call-based, there's no provisioned gateway to pay for.
Calls bill at roughly $3.00 per million after the first 2 million free each month, with the rate stepping down at high volume. There is no hourly or capacity charge, so a gateway with no traffic costs nothing, and a low-traffic API often stays within the free tier. The gateway fee is separate from the backend it routes to, which bills on its own (Cloud Run vCPU-seconds, Cloud Functions invocations, etc.).
c3x prices API Gateway from the monthly call volume you supply in c3x-usage.yml, applying the 2-million free allowance. Without usage input the standing cost is zero. For most APIs the gateway is a minor line next to the compute it fronts; it matters at very high call volumes where the per-million charge accumulates.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "google_api_gateway_api" "api" {
provider = google-beta
api_id = "app-api"
}
resource "google_api_gateway_api_config" "api" {
provider = google-beta
api = google_api_gateway_api.api.api_id
api_config_id = "v1"
openapi_documents {
document {
path = "spec.yaml"
contents = filebase64("spec.yaml")
}
}
}Pricing dimensions
What you actually pay for when you provision google_api_gateway_api.
| Dimension | Unit | What's being charged |
|---|---|---|
| API calls | per million calls | Calls routed through the gateway after the first 2 million/month free. Tiered, dropping at high volume. Usage-based. $3.00 per million calls |
Sample C3X output
Example output from c3x estimate (12M calls/month):
google_api_gateway_api.api
└─ API calls (10M billable) 10 M-calls $30.00
OVERALL TOTAL $30.00
(backend compute billed separately)Optimization tips
Common ways to reduce google_api_gateway_api cost without changing the workload.
Stay within the 2M free tier for low-traffic APIs
Up to 100% for low trafficThe first 2 million calls per month are free. Many internal or early-stage APIs never exceed it, making the gateway free. Consolidate low-traffic APIs rather than spreading calls thin.
Cache at the client or CDN for read-heavy APIs
Call volume on cacheable readsEvery call routed through the gateway is billed. Caching cacheable responses upstream (CDN, client) reduces the call count for high-volume read APIs.
Mind the backend, not just the gateway
Backend compute costAt $3/million, the gateway is usually minor next to the Cloud Run or Cloud Functions backend it routes to. Optimize backend compute first; revisit the gateway only at very high call volumes.
FAQ
How does c3x estimate API Gateway cost?
It prices the monthly call volume you supply in c3x-usage.yml at ~$3/million after the 2 million free calls. With no usage supplied the standing cost is zero, since there's no hourly gateway fee.
Why does an API Gateway with no traffic cost nothing?
API Gateway has no provisioned capacity or hourly charge. You pay only per call, so an idle gateway, or one within the 2-million free tier, costs nothing.
Is the backend included in the estimate?
No. The Cloud Run service, Cloud Functions, or App Engine app the gateway routes to bills on its own resource. c3x estimates those separately if they're in your Terraform.
When does the gateway fee actually matter?
At high call volumes. At $3/million, an API serving hundreds of millions of calls a month accrues a meaningful gateway charge. Below that it's usually a rounding error next to backend compute.
How does this compare to a load balancer in front of Cloud Run?
API Gateway adds managed auth, API keys, and per-call billing with a free tier. An HTTP(S) load balancer has an hourly forwarding-rule cost but no per-call fee, better for high-volume traffic that doesn't need API-management features.
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 google_api_gateway_api.