Concept

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.

Direct provider integration compared with routing through an LLM gateway
ConcernDirect provider integrationThrough a gateway
API formatOne format per providerOne format for all providers
CredentialsProvider keys held by each applicationProvider keys held centrally, applications use gateway keys
FailoverWritten and maintained in application codeConfigured at the gateway
Usage and cost dataSplit across provider dashboardsCollected in one place
Switching modelsCode change per applicationConfiguration or model-name change
DependenciesThe provider onlyThe 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.
FAQ

Common questions

The terms overlap. AI gateway and LLM gateway are generally used for the same thing: a shared API layer in front of model providers. LLM router usually refers to the routing function alone, meaning the part that decides which model or provider serves a request. Most gateways include a router along with other functions.

It depends on the gateway's API. A gateway that follows a widely used request format needs few changes, typically the base URL, the API key and the model name. FastRouter exposes an OpenAI-compatible API, so existing OpenAI-compatible code can be pointed at it.

No. Every FastRouter plan, including the free Starter plan, passes model costs through with $0 markup. The plan price covers the platform, not the models. Paid plans are Pro at $199 per month and Business at $799 per month, and Enterprise pricing is custom.

Some gateways can. FastRouter is hosted by FastRouter as a managed cloud on every plan, and self-hosting is available on the Enterprise plan. A self-hosted deployment runs inside your own cloud account or data center, so prompts, responses, logs and provider keys stay within your network.

The Starter plan is free and includes the core gateway: 200+ models, the auto-router, fallbacks, retries and load balancing, provider-native prompt caching, RBAC, budget caps and rate limits, plus 200K logs per month with 7-day retention. Response caching, distributed tracing and guardrails start on the Pro plan.

Try it on your own traffic

Point your existing OpenAI-compatible client at FastRouter and send a request. Free to start, no credit card required.