LLM Gateway LiteLLM: What It Does and Where It Fits
LiteLLM is an open-source Python library and proxy server that lets you call over 100 LLM providers — OpenAI, Anthropic, Azure, Bedrock, Vertex AI, Cohere, and more — through a single, OpenAI-compatible interface. When people search "LLM gateway litellm," they're usually trying to decide whether LiteLLM is the right tool to unify multiple model providers behind one API, and how it compares to running your own gateway from scratch or paying for a managed one.
The short answer: LiteLLM is a solid, well-maintained choice if you want provider abstraction and are comfortable self-hosting and operating the proxy yourself. It's less of a fit if you specifically need to expose your existing Claude subscription as a clean API endpoint with per-key usage tracking — that's a narrower, different problem, and it's what SubToAPI is built for. The rest of this article breaks down how LiteLLM works, what it does well, where it falls short as a production gateway, and how to think about the buy-vs-build decision.
How LiteLLM Works
LiteLLM ships in two main forms:
- SDK mode — a Python library you import (
from litellm import completion) that translates calls into each provider's native format and normalizes the response back into an OpenAI-style schema. - Proxy mode — a standalone server (
litellm --config config.yaml) that exposes an OpenAI-compatible REST API. Any client that speaks the OpenAI chat completions format can point at it and route to whichever backend model you've configured.
A typical proxy config maps a model alias to a real provider and credentials:
model_list:
- model_name: gpt-4o
litellm_params:
model: openai/gpt-4o
api_key: os.environ/OPENAI_API_KEY
- model_name: claude-sonnet
litellm_params:
model: anthropic/claude-sonnet-4
api_key: os.environ/ANTHROPIC_API_KEY
From there, your app calls POST /chat/completions with model: "claude-sonnet" and LiteLLM routes it, applies retries/fallbacks if configured, and returns a normalized response. This is genuinely useful when you're switching providers frequently, A/B testing models, or building an app that needs to support multiple backends without rewriting client code for each one.
What LiteLLM Gives You
- Provider abstraction — one schema across dozens of vendors, so switching from GPT-4o to Claude or Gemini is a config change, not a rewrite.
- Fallbacks and retries — you can define a priority list of models and let LiteLLM fail over automatically.
- Cost tracking — per-request cost estimates based on published token pricing, aggregated in logs or a database.
- Virtual keys — the proxy can issue its own API keys with budgets and rate limits attached, which is useful for giving teammates or internal services scoped access.
- Self-hosted control — you own the deployment, the logs, and the routing logic end to end.
Where LiteLLM Falls Short as a Production Gateway
LiteLLM is a library and a proxy, not a managed service. That distinction matters once you're past the prototype stage:
You run the infrastructure. The proxy needs a host, a database (Postgres, for virtual keys and spend tracking), monitoring, and someone watching for version upgrades. It's not heavy, but it's not zero either — and every self-hosted piece is one more thing that can go down at 2am.
Provider account management is still on you. LiteLLM routes requests; it doesn't create or manage the underlying provider accounts, billing, or subscription tiers. If your actual goal is "turn my existing Claude access into an API my app can call," LiteLLM assumes you already have API credentials from Anthropic — it doesn't solve the problem of converting a subscription into programmatic access.
Team billing and seats aren't native. Virtual keys give you budgets, but multi-seat billing, invoicing, and per-seat plan tiers are things you'd build on top or handle manually.
Tool use and streaming still need per-provider testing. LiteLLM normalizes the request/response shape, but each provider's tool-calling and streaming behavior has edge cases. You'll still spend time verifying that a Claude-specific tool schema or a streaming chunk format behaves the way your app expects.
None of this makes LiteLLM a bad tool — it's widely used and actively maintained for exactly the problem it targets: routing across many providers with one interface. But "gateway" covers a lot of ground, and it's worth being precise about which problem you actually have.
If Your Problem Is "Expose My Claude Access as an API"
If your real need is narrower — you already use Claude, you don't want to juggle raw API billing, and you want a straightforward HTTPS endpoint with application keys, streaming, and usage visibility — a general multi-provider router is more machinery than you need. That's the gap SubToAPI fills: it turns your existing Claude access into a clean API with sub_live_... application keys, so you can call it the way you'd call any hosted API:
curl https://api.subtoapi.app/v1/messages \
-H "Authorization: Bearer $SUBTOAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Summarize this changelog."}]
}'
You get streaming, tool use, and usage metadata (see /docs/streaming and /docs/tools) without standing up a proxy, managing a database for virtual keys, or writing your own billing layer. Team and Scale plans add seats so multiple developers or services can share access with their own keys and visibility into usage — see /pricing for the breakdown between Solo (€9), Team (€19/seat), and Scale (€49/seat), or start with a free trial at /signup. The /docs/quickstart page walks through generating your first key end to end.
Choosing Between Them
Use LiteLLM when you genuinely need to route across many different LLM providers, you want full control over the proxy, and you're comfortable operating it. Use a hosted layer like SubToAPI when your actual goal is turning a Claude subscription into a dependable API surface for your app or team, without owning the infrastructure. They're not strictly competitors — some teams run LiteLLM in front of multiple providers and use a service like SubToAPI specifically as the Claude backend behind it.
questions
Is LiteLLM the same as an LLM gateway? LiteLLM implements gateway functionality — routing, normalization, fallbacks — as a self-hosted library and proxy. It's one way to build a gateway, not a managed gateway service itself.
Does LiteLLM manage API keys and billing for me? It can issue virtual keys with budgets on the proxy side, but you still need provider credentials, and multi-seat billing isn't handled natively — you'd build that layer yourself.
When should I use SubToAPI instead of LiteLLM? When your goal is specifically turning existing Claude access into a hosted API with application keys, streaming, and usage tracking, without operating your own proxy or database. See /docs for details.