# API Gateway

> API Gateway bills per million API calls, so its cost scales with traffic rather than provisioned capacity and drops toward zero when nothing calls it. ZopNight inventories gateways via Cloud Asset Inventory and folds their call-volume spend into cost attribution from billing actuals, watching for unauthenticated traffic inflating call counts.

Source: https://zop.dev/integrations/gcp/gcp-api-gateway
Updated: 2026-08-19

---

API Gateway provides managed API fronting for serverless backends, billed per million API calls. Cost scales with traffic rather than provisioned capacity.

## Per-million-call billing, no idle floor

API Gateway inverts the waste profile of most networking resources on this directory. Where a forwarding rule bills hourly for existing, a gateway bills per million API calls and nothing for standing idle. A gateway that receives no requests contributes no meaningful charge. That makes it one of the few types where "left running overnight" is a non-event. The flip side is that every request is a billable event, whether it came from a paying customer, a retry storm, a misconfigured poller, or an internet scanner probing an open endpoint.

## When call volume is the thing to interrogate

Because the meter is traffic, cost anomalies here are traffic anomalies. The stub's warning deserves emphasis: unauthenticated or unwanted traffic inflates call counts, and the gateway happily bills for requests it rejects at the application layer. Patterns worth checking when a gateway's line item moves: clients polling on an aggressive loop instead of using push mechanisms; retry logic without backoff multiplying every downstream incident into a call spike; and endpoints exposed without authentication attracting scanner noise around the clock. None of these show up as idle resources. They show up as a per-call meter running faster than the business grew.

## Gateway spend inside ZopNight's attribution

ZopDev inventories API Gateway resources via Cloud Asset Inventory and includes their call-volume spend in cost attribution from billing actuals. Since a usage-billed service has no off switch worth pulling (there is nothing to schedule and no idle capacity to reclaim), the platform's contribution is visibility: putting the gateway's real billed calls next to the serverless backends it fronts, so a traffic-driven cost increase is traceable to a source rather than absorbed as noise.

## API Gateway in the console

Google Cloud console → API Gateway lists each gateway with its APIs and configs. The per-API metrics view is the audit surface: compare request counts against what the fronted Cloud Functions or Cloud Run services report, and any large gap is traffic being billed at the gate without doing work behind it.
