What is an LLM gateway?
An LLM gateway is a service that sits between an application and the model providers it calls, giving the application one API and one set of credentials for many models. Every request goes to the gateway, which forwards it to the chosen model and provider and applies shared functions on the way: routing, failover, caching, access control, spend limits and logging. Teams use a gateway so these concerns are handled once instead of being rebuilt in each application. FastRouter is an LLM gateway with an OpenAI-compatible API.
Last updated
Key facts
- An LLM gateway is a single API layer between applications and multiple model providers.
- Common gateway functions are routing, failover, caching, access control, budgets and observability.
- FastRouter offers one OpenAI-compatible gateway across 200+ models.
- FastRouter passes model costs through with $0 markup on every plan, including the free Starter plan.
- FastRouter runs as a managed cloud on all plans and can be self-hosted on the Enterprise plan.
What does an LLM gateway do?
An LLM gateway receives model requests from your applications and forwards them to model providers. Because all traffic passes through one place, the gateway can apply the same routing rules, credentials, limits and logging to every request, whichever model or provider ends up serving it.
- Unified API: one request format and one key for models from different providers.
- Routing: choosing which model, and which provider of that model, serves each request.
- Reliability: retrying or falling back to another model or provider when one fails.
- Cost control: caching, budgets and rate limits applied per project, key or team.
- Governance: roles, scoped API keys and checks on prompts and responses.
- Observability: logs, traces, usage and cost for every request in one place.
Why do teams put a gateway in front of model providers?
Teams adopt a gateway when they use more than one model or provider and want to stop solving the same problems separately in each application. A gateway centralizes provider credentials, failover logic, spend tracking and access rules, so changing a model or provider becomes a configuration change.
Without a gateway, each application holds its own provider keys, implements its own retries and reports its own usage. That works for one application and one provider. It gets harder as applications, teams and providers multiply, because every change is repeated in each codebase.
How is a gateway different from calling a provider API directly?
Calling a provider directly ties your code to that provider's API, keys and limits. A gateway adds one network hop and one more service to depend on, and in return moves provider differences, failover and usage tracking out of your application code and into a shared layer.
| Concern | Direct provider integration | Through a gateway |
|---|---|---|
| API format | One format per provider | One format for all providers |
| Credentials | Provider keys held by each application | Provider keys held centrally, applications use gateway keys |
| Failover | Written and maintained in application code | Configured at the gateway |
| Usage and cost data | Split across provider dashboards | Collected in one place |
| Switching models | Code change per application | Configuration or model-name change |
| Dependencies | The provider only | The provider and the gateway |
How does FastRouter work as an LLM gateway?
FastRouter is one OpenAI-compatible gateway that covers routing, reliability, cost control, observability, evaluations and governance across 200+ models. Existing OpenAI-compatible code can be pointed at FastRouter, and the same API covers text, image, video, embeddings and speech models from different providers.
Model costs are passed through with $0 markup on every plan, so the plan price covers the platform and not the models. The free Starter plan includes the auto-router, fallbacks, retries and load balancing. Self-hosting on your own infrastructure is available on the Enterprise plan. Plan limits are listed on the pricing page.
- Routing: automatic model selection picks a model per request through fastrouter/auto, and provider routing chooses the provider by price, latency or throughput.
- Reliability: fallback models retry the next candidate when a model or provider fails, and virtual model aliases map one stable alias to many models and providers.
- Cost: response caching, prompt caching, prompt compression, Flex pricing and batch processing.
- Keys: use FastRouter credits or route through your own provider keys with BYOK.
- Governance: role-based access control, provisioning keys, budget caps, rate limits and guardrails for input and output checks.
- Observability: tracing, alerts and dynamic tags for slicing usage and cost.
What should you check when evaluating an LLM gateway?
Check how the gateway fits your existing code, what it adds to each request, and what it does with your data and keys. The useful questions are about API compatibility, model coverage, pricing model, failure behavior, deployment options and how much of each request is logged and retained.
- API compatibility: whether your current SDK and request format work without changes.
- Model and provider coverage: whether the models and modalities you need are available.
- Pricing: whether the gateway charges a markup on tokens, a platform fee, or both.
- Failure behavior: what happens when a model, a provider or the gateway itself is unavailable.
- Data handling: what is logged, for how long, and who can read it.
Sources
Where the statements about FastRouter on this page come from.