API gateway

Last Updated: November 18, 2026

API Gateway

An API gateway is a server that sits between client applications and backend services, accepting every API call, applying security and traffic policies, and routing each request to the right service. It is a runtime component that enforces policy on live traffic, while an API management platform also covers design, publishing, documentation, and the developer portal.

The gateway decides who can reach your systems, how much traffic they can send, and what gets logged for audit. Without one, each team secures its own endpoints, policies drift, and a single misconfigured service can expose data that the rest of the estate protects. 

 

What is an API gateway?

Think of the gateway as the enforcement point for every API your organization exposes. Instead of each backend handling authentication, throttling, and logging on its own, those jobs move to one layer that every request passes through on its way in and every response passes through on its way out.

A gateway is built from a few parts that run on each request: a listener that terminates TLS, a policy engine that runs checks such as OAuth token validation, API key lookup, and rate limits, a routing table that maps public paths to internal services, and transformation steps that convert formats such as XML to JSON. Analytics and logs come out of the same pipeline.

The gateway is one piece of a wider stack. API management adds the catalog, lifecycle, and developer portal around it. A service mesh handles traffic between internal services, while the gateway handles traffic crossing the edge. An AI gateway applies the same idea to calls made to large language models. 

 

How an API gateway works

Every call to a gated API follows the same path, and each stage can stop the request before it reaches your systems.

1. Receive the call. The client sends an HTTPS request to the gateway's public address, and the gateway terminates TLS.

2. Identify the caller. The gateway validates the OAuth token, API key, or mutual TLS certificate and maps it to an application and a plan.

3. Apply policy. Rate limits, quotas, IP rules, schema validation, and threat checks run in order. A failed check returns an error without touching the backend.

4. Route and transform. The gateway selects the backend service, rewrites headers or payloads if needed, and forwards the request, with load balancing across instances.

5. Return and record. The response flows back through the gateway, which logs latency, status code, and caller identity.

The logs tell you who called what, how often, and how fast. They do not tell you whether the backend returned the right answer, which still needs testing and monitoring inside each service. 

 

Why an API gateway matters for enterprise IT

APIs now carry payments, patient records, partner orders, and calls from AI agents, so the gateway is where an enterprise decides what it is willing to expose and to whom.

One policy for every API. Security teams set authentication and threat rules once at the gateway and get the same enforcement across hundreds of services, instead of auditing each team's code.

Protection from overload and abuse. Rate limits and quotas stop one partner, script, or attacker from exhausting backend capacity. Without them, a retry loop in a single client can take down a core system.

Evidence for auditors. Regulated industries need to show who accessed which data and when. Gateway logs give that record in one format, which shortens audits under rules such as PSD2 and HIPAA. 

 

API gateway use cases

  1. Enterprise architects use an API gateway to expose legacy mainframe services as secure REST APIs.
  2. Security teams use an API gateway to enforce OAuth and threat protection on every partner-facing API.
  3. Platform engineers use an API gateway to route traffic between cloud and on-premises versions of a service during a migration. 

 

Key concepts

Policy enforcement point

The policy enforcement point is the place where a rule is applied to live traffic. For external APIs that is the gateway itself, which is why authentication, quotas, and threat checks belong there and not in each backend service.

North-south traffic

North-south traffic is any request that crosses the boundary between outside callers and internal services. A gateway governs this traffic, while east-west traffic between internal services is usually handled by a service mesh or internal proxies.

Federated gateways

Large estates often run several gateways from different vendors or clouds side by side. Federation puts them under one management layer so they share a catalog, consistent policies, and one view of usage. 

 

Benefits

  • Centralize authentication, authorization, and threat protection for every exposed API.
  • Cap traffic per consumer with rate limits and quotas to protect backend capacity.
  • Reduce client complexity by giving apps one address for many services.
  • Record every call for audit, troubleshooting, and usage-based billing.
  • Change backends without breaking consumers, since routes and versions live at the gateway. 

 

API gateway best practices

  • Authenticate every call. Require OAuth 2.0 or mutual TLS on all external APIs, because anonymous endpoints become the first target.
  • Set limits per consumer. Give each application its own quota, which lets one heavy user slow down without affecting others.
  • Keep business logic out. Use the gateway for policy and routing, and leave calculations in services, so the gateway stays fast and easy to change.
  • Version your APIs. Publish changes under a new version path and retire old ones on a schedule consumers can see.
  • Send logs to your SIEM. Feed gateway logs into security monitoring so threats show up next to other alerts.
  • Run more than one instance. Deploy the gateway in a cluster across zones, since every request depends on it.

Avoid putting a separate gateway in front of each team's services with its own rules. That rebuilds the inconsistency the gateway was meant to remove. Federate the gateways under one management layer instead. 

 

Tools and technologies

  • Axway API Gateway (Amplify Platform API Management): enforces security and traffic policy on API calls across on-premises, hybrid, and cloud deployments, with federated governance across mixed gateway estates.
  • Kong Gateway: an open-source gateway built on NGINX with a plugin model for authentication, rate limiting, and logging.
  • Amazon API Gateway: a managed AWS service for publishing REST, HTTP, and WebSocket APIs in front of Lambda functions and other AWS backends. 

 

Getting started with an API gateway

  1. List your exposed APIs. Pull every public and partner endpoint from DNS records, load balancer configs, and team wikis into one inventory. This needs no budget and usually turns up endpoints nobody knew were public.
  2. Classify by risk. Mark which APIs carry personal, financial, or regulated data. Those move behind the gateway first, since a breach there costs the most.
  3. Define baseline policies. Agree on one authentication method, default rate limits, and the log fields every API must emit, and write them down as the standard new APIs must meet.
  4. Pilot with one API. Put a single high-traffic, low-risk API behind the gateway and compare latency and error rates before and after the change.
  5. Migrate in waves. Move the remaining APIs by risk class, retire direct access to the backends, and review policies each quarter with the security team. 

Frequently asked questions

How is an API gateway different from a load balancer?

A load balancer spreads traffic across servers, while an API gateway decides whether a request should be served at all and then sends it to the right service. A load balancer works mostly at the network and transport level, looking at addresses, ports, and server health. An API gateway reads the request itself: the path, the headers, the token, and often the payload. That lets it reject an expired token, cap a partner at 100 calls a minute, or turn a SOAP request into REST, which a load balancer cannot do. Most enterprise setups use both. A load balancer spreads traffic across gateway instances so the gateway stays available, and the gateway then routes each call to a backend, sometimes through another internal load balancer. Some gateways include simple load balancing across backend instances, which is enough for smaller estates. Choose by the question you need answered: whether a server is up, or whether this caller is allowed to make this call.

API gateway rate limits vary because different consumers have different needs, contracts, and risk profiles, and the gateway enforces whatever plan each one is assigned. A mobile app used by millions of customers needs higher limits than an internal reporting script. A paying partner on a premium plan may have a contractual quota, while a free trial gets a small one. Limits also vary by API: a read-only catalog search can take heavy traffic, while an endpoint that triggers a payment or writes to a mainframe needs tighter caps because each call is expensive. Some teams also vary limits by time of day to protect batch windows. The practical approach is to define a few named plans, assign every application to one, and review usage each quarter. Ad hoc limits set per request from a team tend to pile up until nobody knows why a given consumer gets the number it has.

An API gateway can stop a large share of common attacks, but it cannot catch every flaw in the services behind it. It blocks requests with missing or forged tokens, oversized payloads, injection patterns, malformed JSON or XML, and traffic floods that exceed limits. It can also hide internal hostnames and strip headers that reveal server versions. What it cannot see well is broken business logic, such as an endpoint that lets one customer read another customer's order by changing an ID in the URL. That class of flaw, listed first in the OWASP API Security Top 10, needs authorization checks inside the service and testing that targets object-level access. Treat the gateway as the first layer: it filters most hostile traffic cheaply and consistently. Pair it with secure coding, regular API security testing, and monitoring that compares normal call patterns against unusual ones.

A good API gateway setup in a large enterprise has every external API behind a gateway, one set of baseline policies, and one place to see all APIs even when several gateway products are in use. Availability targets for the gateway layer usually match or exceed those of the most critical service behind it, often 99.9% or higher, with instances across at least two zones. Authentication is consistent, typically OAuth 2.0 for applications and mutual TLS for partners. Every API has an owner, a version, and a published rate limit. Logs land in the security monitoring system within minutes. A practical benchmark is coverage: the share of known external APIs that route through a governed gateway. Teams that track it often find a gap between the APIs they believe are protected and the ones found in a traffic scan. Closing that gap matters more than adding new policy features.