Skip to content
Agents tracked: 504 Releases (7d): 602 Agent status: no reported issuesSince last limit reset: Claude 13d · Codex 11d For AI agents: Markdown Updated Nov 24, 2026

LiteLLM

by BerriAI

One way to call 100+ AI model providers.

LLM gateways and routers

WebsitePricingGitHub

1. Price

Free tier: Open-source gateway free to self-host. As reported on the official pricing page, checked Nov 9, 2026.

litellm.ai/enterprise

Checked 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

23.6M
SDK downloads a week
+1.0% on the 4-week average
761
public agent repos use its SDK
63.7K
GitHub stars, BerriAI/litellm
SDK downloads per weekpypi litellm 23,634,409

SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026.

Pricing

Free tier

Open-source gateway free to self-host

Cheapest plan

No monthly plan

Usage price

—

Plans

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

How it signs in

Library: each provider's own key from environment variables. Gateway: a virtual key (or the master key) sent as "Authorization: Bearer sk-..."

Environment variable
OPENAI_API_KEY, ANTHROPIC_API_KEY and other provider variables (library); LITELLM_MASTER_KEY and LITELLM_SALT_KEY (gateway)
Safe in browser code
No, keep it on your server
Card at sign-up

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.

In a paid app
Yes

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

inside-app-bundle
With conditions

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

redistribute-files
With conditions

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

client-work
Yes

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

Keeps your data

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

Where data is stored

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

401 AuthenticationError

The provider (or gateway) rejected the key.

Check the provider key in .env or the virtual key; do not retry.

402 PaymentRequiredError

The provider account is out of credits.

Top up the provider account, or let the Router fall back to another deployment.

429 RateLimitError

The provider (or a gateway key limit) is rate limiting you.

Retry with backoff, or configure fallbacks to another deployment.

400 ContextWindowExceededError

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.

BudgetExceededError

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

Our agent check

5 of 6: llms.txt yes, OpenAPI yes, SDK yes, MCP no, status page yes, AI assistants allowed yes

Checked Nov 13, 2026.

MCP server

None found

PyPI
pip install litellm

Instructions in its docs to check first

The docs say

“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.

The docs say

“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

Free (open source)Free tier

OpenRouter

Pick OpenRouter when you want one hosted account and one OpenAI-compatible key for hundreds of models, with nothing to run yourself.

Free planFree tierOfficial MCP

Vercel AI Gateway

Pick Vercel AI Gateway when your app already runs on Vercel and you want a hosted gateway billed at provider list prices.

Free planFree tier

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.

Free (open source)Free tier

All llm gateways and routers APIs

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.”

  1. Install the Python package (or pip install litellm), and put each provider key in an environment variable.

    uv add litellm

    From github.com/BerriAI/litellm/blob/main/README.md

  2. Make 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)

    From docs.litellm.ai/docs/

  3. 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

    From docs.litellm.ai/docs/proxy/docker_quick_start

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."}]
  }'

Mistakes to avoid

Running the gateway from a plain config file without a database and trusting max_budget to cap spending.
Run the gateway with its Postgres database (the Docker Compose quickstart), or set spending limits at each provider.

Without a database the global budget check never fires and virtual keys do not work.

Regenerating LITELLM_SALT_KEY or losing the .env file after provider keys were added in the Admin UI.
Keep the generated .env (out of git) and back it up together with the database.

The salt key encrypts stored provider keys and has no in-place rotation.

Deploying the image as docker.litellm.ai/berriai/litellm:latest and letting it update on every pull.
Pin a specific release tag in the compose file and upgrade on purpose.

The docs suggest editing the compose file to pin a release; an unpinned tag changes under you.

Installing litellm and litellm-core in the same Python environment.
Install one of them; use litellm when you need the gateway or command line, litellm-core for a lean library install.

The two packages contain the same Python files and overwrite each other.

Catching each provider's own exception classes (openai, anthropic) around litellm calls.
Catch litellm.AuthenticationError, litellm.RateLimitError and the other mapped types once.

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.