LiteLLM
by BerriAI
One way to call 100+ AI model providers.
1. Price
Free tier: Open-source gateway free to self-host. As reported on the official pricing page, checked Nov 9, 2026.
litellm.ai/enterprise2. Commercial use
“Content outside of the above mentioned directories or restrictions above is available under the MIT license as defined below.”
MIT for everything outside the enterprise/ folder; Enterprise features need a paid license key.
github.com/BerriAI/litellm/blob/main/LICENSE3. Key & sign-up
Library: each provider's own key from environment variables. Gateway: a virtual key (or the master key) sent as "Authorization: Bearer sk-..." No LiteLLM account is needed for the open-source library or gateway; the AI providers you call may require a card.
docs.litellm.ai/docs/proxy/docker_quick_startChecked against the maker's official pages, pricing on Nov 9, 2026. Tap a verdict to see its source.How we checkedReport an error
What LiteLLM does
LiteLLM is free open-source software, not a service you sign up for. It lets your app talk to many AI model providers, such as OpenAI, Anthropic or Gemini, in one common format, so you can switch models without rewriting code. You use it as a Python library inside your app, or run its gateway server so several apps and teammates share keys, budgets and spend tracking. Each model provider still bills you for its calls.
- LiteLLM is one of 8 APIs in the LLM gateways and routers category on AgentGid.
- It is one of 7 that can be started for free.
- 4 of them ship an official MCP server; LiteLLM does not.
- Its official SDK is the 2nd most downloaded in the category (26.5M a week).
What people build with it
Switch AI models without rewrites
Try a cheaper or newer model by changing one model name, while your other code and the reply format stay the same.
Backup model when a provider fails
If one AI provider is down or slow, the request goes to a second model you named, so users still get an answer.
Shared AI access for a team
Run one gateway for your company so each app or teammate gets its own key with a budget and a spending limit, instead of sharing the real provider keys.
See what each AI request costs
Log the price of every model call, so you can see which feature or customer spends the most.
Coding assistants on any model
Point Claude Code, Codex or Cursor at your own gateway, so their requests use the models and budgets your team picked.
Free test runs for AI features
In automated tests, return a fixed fake answer instead of calling a paid model, so tests are free and repeatable.
LiteLLM popularity
SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026.
Pricing
Open-source gateway free to self-host
No monthly plan
—
Enterprise (SSO/SCIM, audit logs, air-gapped, 24/7 SLA support) is custom-priced via sales; 30-day trial key available. No vendor-run MCP server; LiteLLM can itself act as an MCP gateway.
Price history
- 1 change in our catalog since Oct 9, 2026, last on Oct 9, 2026.
As reported on the official pricing page, checked Nov 9, 2026. Prices change: confirm before you buy. litellm.ai/enterprise
Key and access
Library: each provider's own key from environment variables. Gateway: a virtual key (or the master key) sent as "Authorization: Bearer sk-..."
OPENAI_API_KEY, ANTHROPIC_API_KEY and other provider variables (library); LITELLM_MASTER_KEY and LITELLM_SALT_KEY (gateway)No
Steps only a person can do
- Create an account and an API key with each AI provider you plan to use (for example OpenAI or Anthropic), and add billing there. Put the keys in .env as OPENAI_API_KEY, ANTHROPIC_API_KEY and so on; LiteLLM reads them from the environment.
- For the gateway, install Docker (or Podman) on the machine that will run it and decide who may reach port 4000. Generate LITELLM_MASTER_KEY and LITELLM_SALT_KEY into .env, start the compose file and create virtual keys for each app.
- Only if the team needs single sign-on for more than 5 users, audit logs or an SLA, request an Enterprise trial key. Set the license key on the same gateway; no code change.
Commercial use and your data
The code is MIT-licensed, so you may use it for free in paid products and change it; keep the license notice. Files in its enterprise folder are under a separate license, and some team features need a paid Enterprise license.
MIT for everything outside the enterprise/ folder; Enterprise features need a paid license key.
“Content outside of the above mentioned directories or restrictions above is available under the MIT license as defined below.” source
You may ship it inside your product; include the MIT copyright and permission notice.
“The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.” source
Allowed under MIT with the notice kept; files under enterprise/ follow enterprise/LICENSE instead.
“All content that resides under the "enterprise/" directory of this repository, if that directory exists, is licensed under the license defined in "enterprise/LICENSE".” source
MIT allows use for clients; the clients need their own provider keys and accounts.
“to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software” source
Self-hosted gateways keep data in your own database; LiteLLM servers store nothing unless you send telemetry to them.
“No data or telemetry is stored on LiteLLM Servers when you self-host” source
Wherever you run it; Enterprise is also self-hosted in your own cloud.
“It runs in your cloud, so prompts and responses never leave your environment.” source
Errors to handle
The provider (or gateway) rejected the key.
Check the provider key in .env or the virtual key; do not retry.
The provider account is out of credits.
Top up the provider account, or let the Router fall back to another deployment.
The provider (or a gateway key limit) is rate limiting you.
Retry with backoff, or configure fallbacks to another deployment.
The prompt is too long for the chosen model.
Shorten or trim the messages, or set a context window fallback to a model with a larger window.
The gateway key, user or team has used up its budget.
Raise the budget in the Admin UI or wait for the budget period to reset; do not retry.
Use it from an agent
5 of 6: llms.txt yes, OpenAPI yes, SDK yes, MCP no, status page yes, AI assistants allowed yes
Checked Nov 13, 2026.
None found
pip install litellmInstructions in its docs to check first
“To have Claude Code set up the Gateway for you, install the LiteLLM setup skill and then type /litellm-setup in Claude Code”
Ask the person first. The page's command (npx skills add BerriAI/litellm -g) installs a skill globally from the repository, and the skill installs the gateway, writes config and keys and starts it.
“Agents and CI: the script asks nothing when there is no terminal, under CI or Claude Code”
The quickstart pipes a remote script from the main branch into sh and starts Docker services without questions. Ask the person first, read the script, and prefer the step-by-step compose quickstart with a pinned tag.
Alternatives
LiteLLM This page
Pick OpenRouter when you want one hosted account and one OpenAI-compatible key for hundreds of models, with nothing to run yourself.
Pick Vercel AI Gateway when your app already runs on Vercel and you want a hosted gateway billed at provider list prices.
Prisma AIRS AI Gateway (formerly Portkey)
Pick Portkey when you want a hosted gateway with routing and fallbacks plus prompt management and observability in one product.
Get started
Tell your AI assistant
“Add LiteLLM to my Python app: pin litellm==1.108.3, read provider keys from .env, call completion() with provider-prefixed model names like "openai/...", add a backup model with Router fallbacks, and catch litellm.RateLimitError and AuthenticationError.”
Install the Python package (or pip install litellm), and put each provider key in an environment variable.
uv add litellmMake your first call (example from the official docs); the model name starts with the provider.
from litellm import completion import os os.environ["OPENAI_API_KEY"] = "your-api-key" response = completion( model="openai/gpt-6.1-sol", messages=[{"role": "user", "content": "Hello, how are you?"}] ) print(response.choices[0].message.content)For a shared gateway, start it with Docker Compose and a database (official quickstart), then open the Admin UI at http://localhost:4000/ui.
curl -sSLO https://github.com/BerriAI/litellm/raw/main/docker/docker-compose.quickstart.yml printf 'LITELLM_MASTER_KEY=sk-%s\nLITELLM_SALT_KEY=sk-%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env docker compose -f docker-compose.quickstart.yml up -d
First request
A call to your own self-hosted gateway; the library form is the completion() example in start.
curl http://localhost:4000/v1/chat/completions \
-H 'Authorization: Bearer sk-<your-virtual-key>' \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-6.1-sol",
"messages": [{"role": "user", "content": "Say hello in five words."}]
}'{
"id": "chatcmpl-DzGKiNRbQ4fe9Mgt8HSHFQ6ApfRJi",
"model": "gpt-6.1-sol",
"object": "chat.completion",
"choices": [{"finish_reason": "stop", "index": 0,
"message": {"content": "Hello, nice to meet you.", "role": "assistant"}}],
"usage": {"completion_tokens": 70, "prompt_tokens": 12, "total_tokens": 82}
}Mistakes to avoid
Without a database the global budget check never fires and virtual keys do not work.
The salt key encrypts stored provider keys and has no in-place rotation.
The docs suggest editing the compose file to pin a release; an unpinned tag changes under you.
The two packages contain the same Python files and overwrite each other.
LiteLLM converts every provider's errors to the OpenAI exception types.
Questions
Is LiteLLM a paid service?
No. The library and the gateway are open source under MIT and you run them yourself. You pay the AI providers you call; an Enterprise license is optional.
Do I need to learn a new format for each provider?
No. Every reply comes back in the OpenAI Chat Completions format, whichever provider answered.
Can apps written in JavaScript or other languages use it?
Yes, through the gateway. It speaks the OpenAI format, so an app keeps its OpenAI client and only changes the base address and key.
Does LiteLLM see my prompts?
Not when you self-host; the docs say no data or telemetry is stored on LiteLLM servers. Your prompts still go to the AI provider you call.