# API Gateway

> One front door that sends each request to the right service.

**Field:** Software Development  
**Category:** Architecture  
**Also known as:** Gateway, Edge Service, Backend for Frontend

## Think of it like

Think of it like the front desk of a big office. Visitors check in once, then get sent to the right room.

## Definition

An API gateway is a single front door that sits in front of many back-end services. Every request from an app goes to the gateway first. It checks who is calling, applies rate limits, and then sends the request on to the right service. It can also combine answers from several services into one reply. Clients only need to know one address.

## Example

Jack's phone app calls one address for all it needs. The gateway checks the login token. Then it sends order calls to the order service and profile calls to the user service.

## Why it matters

It keeps shared jobs like logins and limits in one place. You do not copy them into each service.

## Common mistake

Putting business rules in the gateway. It grows into a new monolith that each team must change.

## Three principles

- **One front door.** For many services.
- **Shared jobs here.** Logins and limits.
- **Route, do not decide.** Rules stay in services.

## Related terms

- [Microservices](https://learn.benibix.com/term/development/microservices)
- [Rate Limiting](https://learn.benibix.com/term/development/rate-limiting)
- [Service Mesh](https://learn.benibix.com/term/development/service-mesh)
- [Authentication](https://learn.benibix.com/term/development/authentication)
- [LLM Gateway](https://learn.benibix.com/term/development/llm-gateway)
- [Kubernetes Ingress](https://learn.benibix.com/term/infrastructure/kubernetes-ingress)

## Told apart from

- [API Gateway vs Service Mesh](https://learn.benibix.com/compare/api-gateway-vs-service-mesh): An API gateway and a service mesh both sit in the path of every request, but they guard two very different doors. A gateway is the front door, where calls from apps and browsers first come in. A service mesh handles the calls between services inside the system. Most big systems that use one end up using both.
- [LLM Gateway vs API Gateway](https://learn.benibix.com/compare/llm-gateway-vs-api-gateway): People often think an LLM gateway is just an API gateway with a new name. Both sit in front of services and deal with keys, limits and logs. An API gateway guards your own services from outside callers. An LLM gateway sits in front of outside model makers for your own apps. It counts tokens, tracks the cost of each model and can switch model makers.

---

Source: https://learn.benibix.com/term/development/api-gateway
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
