Skip to content
IT glossary
ArchitectureUpdated December 3, 2026

API Gateway

An API gateway gives clients one place to send requests to backend services. It routes each request and can enforce shared rules, such as checking access tokens or limiting how often clients call the API.

What an API gateway does

A client shouldn't need a map of your backend. A storefront can call api.example.com for both product details and order history, even if different teams own the services that handle them. The gateway presents a public API and maps incoming requests to backend services. Teams can change that mapping without shipping a client update, as long as they preserve the public API contract.

What happens to a request

For an HTTP API, the gateway can match a request by hostname, path, and method. It applies the rules configured for that route and forwards allowed requests to the selected backend. A route might require a valid access token, enforce a per-client quota, or set a timeout for the backend call. If a client exceeds its quota, the gateway can return 429 Too Many Requests without forwarding the request. It can also record request counts, latency, and error rates by route.

Example: one address, different rules

GET  /products/42  → catalog service; public access
POST /orders       → order service; valid token required

The gateway handles the common policy: which route requires a token? The order service still makes decisions that depend on business data: can this customer order these items, and at what price? Likewise, being allowed to call GET /orders/42 doesn't establish that the caller is allowed to see order 42.

Where it fits

Gateways are common in front of microservices and partner APIs, where different endpoints need consistent entry rules. A gateway usually acts as a reverse proxy, but the term highlights API-level concerns such as access policies and per-client quotas. A load balancer primarily spreads requests across instances; the same product may do both jobs. A service mesh typically focuses on traffic between services. Adding a gateway doesn't mean all internal calls need to go through it.

What interviewers look for

Explain what the gateway buys you and what it costs. It centralizes policy and gives clients a stable address, but adds a network hop and can widen the impact of a bad configuration. Run multiple gateway instances so a process failure doesn't take down the entire API, and roll out policy changes gradually so a bad rule doesn't hit every instance at once. If you're designing a small app with a single backend and no need for separate API policies, an existing reverse proxy may be enough.