API Gateway, What Is It? A No-Nonsense Overview
An API gateway is a single entry point that sits between clients and your backend services, handling requests before they reach your actual application code. Instead of every client talking directly to every microservice or backend, they all talk to the gateway, which routes, authenticates, rate-limits, and sometimes transforms the request before passing it along.
If you're asking "api gateway what is it" because you keep seeing the term in architecture diagrams or job postings, the short version is this: it's infrastructure, not a product feature. It doesn't do business logic. It manages traffic and access to the things that do.
What Problem It Actually Solves
Without a gateway, a client app that needs data from five different services has to know the address of all five, handle five different auth schemes, and deal with five different failure modes. That's fine for a weekend project. It falls apart once you have more than a couple of services or more than one client type (web, mobile, third-party integrations).
A gateway collapses that complexity into one address and one contract. The client sends one request to api.yourcompany.com, and the gateway figures out where it actually needs to go.
Concretely, an API gateway typically handles:
- Routing — mapping incoming paths to the right backend service
- Authentication and authorization — checking API keys, tokens, or sessions before anything hits your services
- Rate limiting and throttling — protecting backends from being overwhelmed
- Request/response transformation — reshaping payloads so clients don't need to know internal service formats
- Logging and metrics — a single place to see traffic across everything behind it
- TLS termination — handling HTTPS so individual services don't each need certificate management
None of these are things your application logic should be doing repeatedly, service by service. Centralizing them is the whole point.
Where It Sits in the Stack
Picture a typical request path:
Client → API Gateway → Service A / Service B / Service C
The client never talks to Service A, B, or C directly. It only knows about the gateway. This matters for a few reasons:
- Services can change without breaking clients. If Service B gets split into two services next quarter, the gateway absorbs that change. Clients keep hitting the same endpoint.
- Security is enforced in one place. You don't need to re-implement token validation in every microservice — the gateway checks it once, before the request goes anywhere.
- You get one set of logs and metrics instead of stitching together logs from a dozen services to understand what a client actually did.
This is why API gateways show up so often in microservices architectures specifically — the more services you have, the more valuable a single traffic-control point becomes.
API Gateway vs. Load Balancer
These get confused a lot because both sit "in front of" backend infrastructure.
A load balancer distributes traffic across multiple instances of the same service to spread load and handle failover. It generally doesn't care about the content of the request — just where to send the next connection.
An API gateway operates at a higher level. It understands the request itself — the path, the headers, the payload — and makes decisions based on that: which service this belongs to, whether the caller is authorized, whether the rate limit has been hit. Many gateways include load balancing as one of their features, but a load balancer alone isn't a gateway.
Do You Actually Need One?
Not every project does. If you have a single backend service and a handful of internal clients, adding a gateway is often just extra operational overhead — another piece of infrastructure to configure, monitor, and keep patched.
A full gateway setup (Kong, AWS API Gateway, Apigee, or a self-hosted option) tends to make sense when you have:
- Multiple backend services that need a unified public interface
- External developers or partners consuming your API
- A need for consistent auth, rate limiting, and logging across many endpoints
- Different client types (mobile, web, third-party) hitting overlapping but distinct sets of endpoints
If you're a solo developer or small team wrapping an external AI provider's access into your own product, standing up and maintaining a full gateway stack is often disproportionate to the problem. That's the gap tools like SubToAPI fill for a specific case: turning your existing Claude subscription access into a proper HTTPS API with application-scoped keys (sub_live_...), streaming, tool use support, and usage metadata — without you deploying and operating gateway infrastructure yourself. You get the parts of the gateway pattern that matter for this use case (a stable key-based entry point, one dashboard for usage across a team) without owning the routing and scaling problem.
A Minimal Example
Here's roughly what a gateway-fronted request looks like from the client's side — notice the client only ever sees one endpoint and one auth header, regardless of what's happening behind it:
curl https://api.yourcompany.com/v1/orders \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
The client has no idea whether /v1/orders is served by one monolith or routed to three different microservices behind the scenes. That abstraction is the entire value proposition of a gateway in one line of curl.
Getting Started Without Overbuilding
If you're evaluating whether to add a gateway, start by listing your actual pain points: Are clients breaking every time a service moves? Is auth logic duplicated across services? Is one noisy client able to take down a shared backend? If none of those are real problems yet, you probably don't need the full pattern — a simple reverse proxy with basic auth might cover you for now, and you can add gateway features later as the pain shows up.
questions
Is an API gateway the same as an API? No. An API is the contract your service exposes (endpoints, request/response formats). A gateway is infrastructure that sits in front of one or more APIs to manage access, routing, and traffic control.
Can a small project use an API gateway? Yes, but it's often unnecessary until you have multiple services, multiple client types, or external consumers. For a single service with a handful of internal callers, a lighter reverse proxy usually covers the same needs with less overhead.
Does an API gateway replace authentication in my services? It centralizes the first check (is this request allowed in at all), but services often still enforce their own authorization rules for specific actions. The gateway reduces duplicated auth logic — it doesn't necessarily eliminate all of it.