API Management
APIs are the main way systems, partners and increasingly AI agents access an organization's capabilities. As the number of APIs grows, they need to be designed consistently, secured, observed, versioned and discoverable. API management is the platform capability that provides this.
Two architectural building blocks carry most of the runtime responsibility:
- API gateways handle traffic entering the platform from clients and partners (north–south traffic).
- Service meshes handle traffic between services inside the platform (east–west traffic).
The API lifecycle
API management covers the whole lifecycle of an API, not only its runtime:
| Stage | Practices |
|---|---|
| Design | API-first design with OpenAPI; consistent style guidelines; resources based on the enterprise data model |
| Review and validation | Automated linting of API definitions against the guidelines, for example with Spectral; design reviews for public APIs |
| Publish | Register the API in a catalog or developer portal with documentation, examples and owner, for example as an API entity in Backstage |
| Secure | Authentication and authorization (OAuth 2.0 / OIDC tokens, API keys for simple cases), see identity and access management |
| Operate | Rate limits, quotas, monitoring, alerting and usage analytics |
| Version and evolve | Backward-compatible changes by default; new versions for breaking changes, with migration periods |
| Deprecate and retire | Announce deprecation, track remaining consumers, remove when usage has stopped |
APIs, like events, are contracts. The same governance principles apply to both, including the distinction between public, cross-domain contracts and private interfaces within a system boundary (see event-driven architecture). The OWASP API Security Top 10 lists the most common API security risks, such as broken object-level authorization.
API gateways
An API gateway is a single entry point in front of a set of backend services. Clients talk to the gateway; the gateway routes requests to the right service and applies cross-cutting policies consistently, so each service does not have to implement them. See the API gateway pattern.
Responsibilities
| Function | Description |
|---|---|
| Routing | Maps public paths and hosts to backend services and versions |
| Authentication and authorization | Validates tokens or API keys, checks scopes, rejects unauthorized requests before they reach services |
| Rate limiting and quotas | Protects backends from overload and enforces usage plans per client or partner |
| Request validation | Rejects requests that do not match the API definition |
| Transformation | Adapts headers, payloads or protocols, for example REST to gRPC |
| Caching | Serves repeated responses without calling the backend |
| TLS termination | Handles certificates and encryption at the edge |
| Observability | Access logs, metrics and traces for every request (see observability) |
| Monetization and analytics | Usage reporting and billing for external API products |
Gateway patterns
| Pattern | Description | When to use |
|---|---|---|
| Edge gateway | One gateway for all external traffic | Most organizations, as the default entry point |
| Backends for frontends (BFF) | A separate gateway or API layer per client type (web, mobile, partner), shaped for that client's needs (pattern by Sam Newman) | Clients with very different needs; avoids one API that fits nobody |
| Domain gateways | One gateway per domain, owned by the domain team | Large organizations with autonomous domains |
| Internal gateway | A gateway for traffic between domains or business units inside the organization | When internal APIs need the same governance as external ones |
Gateways should stay thin. Business logic and orchestration belong in services; a gateway that accumulates logic becomes a bottleneck and a single point of failure for change.
Implementations
| Category | Examples |
|---|---|
| Cloud provider gateways and API management | Amazon API Gateway, Azure API Management, Google Apigee, Google Cloud API Gateway |
| Open source and commercial gateways | Kong, Tyk, Apache APISIX, KrakenD, Gravitee |
| Integration platforms with API management | MuleSoft Anypoint API Manager |
| Kubernetes-native | Kubernetes Gateway API as the standard configuration model, implemented for example by Envoy Gateway on top of the Envoy proxy |
Full API management platforms (Apigee, Azure API Management, Kong, Tyk, Gravitee, MuleSoft) add a developer portal, API catalog, lifecycle management and analytics on top of the gateway runtime.
Many gateway products now also offer AI gateway features for LLM traffic: routing between model providers, token-based rate limits and cost tracking. A dedicated LLM gateway such as LiteLLM is shown in the agents reference architecture.
Service mesh
With dozens or hundreds of services calling each other, every service would need to implement the same networking concerns: finding other services, encrypting traffic, retrying failed calls, collecting metrics. A service mesh moves these concerns out of application code into the platform.
How it works
A service mesh has two parts:
- Data plane: proxies that handle all traffic between services. Traditionally a sidecar proxy (often Envoy) runs next to every service instance. Newer designs reduce the overhead with node-level proxies, such as Istio's ambient mode, or with eBPF in the Linux kernel, as in Cilium.
- Control plane: configures the proxies centrally: routing rules, security policies, certificates and service discovery.
Concepts and capabilities
| Capability | Description |
|---|---|
| Service discovery | Services find each other by name instead of hard-coded addresses; the mesh keeps track of healthy instances |
| Load balancing | Requests are spread across healthy instances, often with smarter algorithms than basic round-robin |
| Mutual TLS and service identity | All traffic between services is encrypted, and each service has a cryptographic identity (often following SPIFFE), enabling zero-trust networking |
| Authorization policies | Rules on which services may call which, for example "only Orders may call Payment" |
| Traffic management | Timeouts, retries, circuit breaking, and traffic splitting for canary releases and A/B tests |
| Observability | Consistent metrics, logs and traces for all service-to-service calls, without code changes |
Service discovery
Discoverability is a basic need in any distributed system: services must find each other as instances start, stop and move. Service meshes provide it, but it also exists without a mesh:
| Approach | How it works | Examples |
|---|---|---|
| Platform DNS | Services are reached by a stable name; the platform resolves it to healthy instances | Kubernetes Services |
| Service registry | Instances register themselves; clients or load balancers query the registry (pattern) | HashiCorp Consul, AWS Cloud Map |
| Client-side discovery | The client looks up instances and chooses one (pattern) | Client libraries with a registry |
| Server-side discovery | The client calls a load balancer or proxy that finds the instance (pattern) | Load balancers, mesh proxies |
Runtime discovery (where is the payment service right now?) is different from design-time discovery (which APIs exist and how do I use them?). The second is served by the API catalog and developer portal, and by the systems inventory.
Implementations
| Mesh | Characteristics |
|---|---|
| Istio | Feature-rich, widely used; sidecar or ambient (sidecar-less) mode; built on Envoy |
| Linkerd | Focus on simplicity and low overhead; lightweight proxy written in Rust |
| Consul | Service discovery and mesh across Kubernetes, virtual machines and multiple data centers |
| Cilium Service Mesh | eBPF-based networking and mesh features, with optional proxies |
| Amazon VPC Lattice | Managed AWS service for service-to-service connectivity, discovery and access policies across accounts and compute types |
When a service mesh is worth it
A mesh adds significant operational complexity. It pays off when there are many services with real needs for zero-trust security (mutual TLS everywhere, service-level authorization), consistent observability, or advanced traffic management. With a handful of services, platform DNS, a load balancer and good client libraries are often enough.
API gateway and service mesh compared
| API gateway | Service mesh | |
|---|---|---|
| Traffic | North–south: clients and partners to services | East–west: service to service |
| Focus | API products: authentication of external clients, quotas, developer experience, monetization | Network reliability and security between services |
| Consumers | External developers, partners, front ends, agents | Internal services |
| Typical features | API keys and OAuth, rate limits, developer portal, transformation | mTLS, service identity, retries, circuit breaking, traffic splitting |
| Deployment | At the edge, or per domain | Across all services in the platform |
Both are often used together: the gateway at the edge, the mesh inside. Some products cover both roles, and the boundary is blurring, but the two traffic types still have different requirements.
API management as a platform capability
Following the platform mindset, teams should get API management as a ready-to-use capability:
- Golden paths (provisioning) that create new services with an OpenAPI definition, gateway route, authentication and observability already configured.
- Automated governance: API definitions linted in CI against the organization's guidelines; breaking changes detected before release.
- One catalog of APIs and events, with owners, documentation and consumers, connected to the architecture repository.
- Shared gateway and mesh operated by the platform team, configured by product teams through code (for example Gateway API resources), not through tickets.
- Security by default: every API authenticated, every service-to-service call encrypted, and access policies managed as code.
Common pitfalls
- Gateway as a monolith: business logic, orchestration and transformations piling up in the gateway.
- APIs without contracts: undocumented endpoints that consumers reverse-engineer, which then can never change.
- No versioning strategy: breaking changes deployed without notice, or dozens of versions that are never retired.
- Service mesh by default: adopting a mesh for a few services and taking on its operational cost without a real need.
- Two catalogs or none: APIs documented in one place, events in another, and neither linked to owners and systems.