---
title: "LiteLLM documentation"
url: "/"
canonical_url: "https://docs.litellm.ai/"
type: "home"
summary: "LiteLLM is an open-source Python SDK and a self-hosted AI Gateway (proxy) that give 100+ LLM providers one OpenAI-compatible API, with virtual keys, spend tracking, budgets, routing and fallbacks, guardrails, and an MCP gateway."
---
# LiteLLM documentation

> LiteLLM is an open-source Python SDK and a self-hosted AI Gateway (proxy) that give 100+ LLM providers one OpenAI-compatible API, with virtual keys, spend tracking, budgets, routing and fallbacks, guardrails, and an MCP gateway.

**Quick Start: start the LiteLLM Gateway**

macOS and Linux:

```bash
curl -fsSL https://raw.githubusercontent.com/BerriAI/litellm/main/scripts/quickstart.sh | sh
```

Windows (PowerShell):

```powershell
irm https://raw.githubusercontent.com/BerriAI/litellm/main/scripts/quickstart.ps1 | iex
```

Python SDK:

```bash
uv add litellm
```

Pick the path that matches who is calling the models:

- **Just my code** (one Python app): the Python SDK. A library you import, nothing to deploy. One `completion()` call for 100+ providers with answers in the OpenAI format, retries and fallbacks, and cost per call. Install: https://docs.litellm.ai/docs/index.md#installation
- **My team or several apps** (any language): the AI Gateway. A self-hosted OpenAI-compatible endpoint with virtual keys, budgets and rate limits per team, spend tracking, logs, guardrails, and an admin UI. Start it: https://docs.litellm.ai/docs/proxy/docker_quick_start.md
- **My whole organization** (SSO, audit logs, security review): LiteLLM Enterprise, a license key on the same gateway. Details: https://docs.litellm.ai/docs/enterprise.md. Talk to sales: https://www.litellm.ai/enterprise#talk-to-sales

## Why developers love LiteLLM

### Python SDK: Use one Python function for 100+ LLM providers.

The completion() function uses the same arguments for OpenAI, Anthropic, Bedrock, and 100+ other providers. It always gives the result in the OpenAI format. To use a different model, you replace one string. The SDK also gives streaming, retries, fallbacks, and the cost of each call.

```python
from litellm import completion

messages = [{"role": "user", "content": "Hello"}]

completion(model="openai/gpt-5.6-terra", messages=messages)
completion(model="anthropic/claude-sonnet-5", messages=messages)
```

Guide: https://docs.litellm.ai/docs/index.md. Agent prompt: "Add the LiteLLM SDK to this project", in https://docs.litellm.ai/docs/agent_resources.md

### AI Gateway: One endpoint for all models, with keys, budgets, and costs for each team.

Apps in all programming languages send requests to the gateway in the OpenAI format. Each app or person gets a virtual key with a budget and a rate limit. The gateway records each request and its cost. Your provider keys stay in the gateway.

```bash
curl http://localhost:4000/v1/chat/completions \
  -H "Authorization: Bearer sk-<virtual-key>" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-5.6-terra",
       "messages": [{"role": "user", "content": "Hello"}]}'
```

Guide: https://docs.litellm.ai/docs/proxy/docker_quick_start.md. Agent prompt: "Run the LiteLLM Gateway locally", in https://docs.litellm.ai/docs/agent_resources.md

60.2k GitHub stars, 91.1M PyPI downloads last month, 1,700+ contributors, and 512M container image pulls.

### Built on the gateway

When your apps call the gateway, the same deployment can also give MCP tools and agents to your apps. It can select the correct model for each request. You can operate it from your terminal or from your coding agent.

#### Tools and agents

**MCP Gateway: Make all MCP tools available from one endpoint.** Add MCP servers to the gateway one time. You do not connect them to each app. Select which keys and teams can use each server.

| MCP server | Search team | Support team |
| --- | --- | --- |
| GitHub | allowed | no access |
| Jira | allowed | allowed |

Guide: https://docs.litellm.ai/docs/mcp.md. Agent prompt: "Put my MCP servers behind the LiteLLM Gateway", in https://docs.litellm.ai/docs/agent_resources.md

**Agent Gateway: Send agent-to-agent calls through the gateway.** Register your A2A agents on the gateway. Each call to these agents then uses a virtual key and shows in your logs with its cost. Only the teams that you select can call these agents.

- POST /a2a/support-agent, search-team, logged
- POST /a2a/billing-agent, search-team, not allowed

Guide: https://docs.litellm.ai/docs/a2a.md. Agent prompt: "Route my A2A agents through the LiteLLM Gateway", in https://docs.litellm.ai/docs/agent_resources.md

#### Models and harnesses

**Auto Router (add-on): Send each request to the model with the lowest cost that can do the task.** Easy prompts go to a model with a lower cost. Your app stays the same.

| Request | Routed to |
| --- | --- |
| Fix the typo in this sentence | a small, cheap model |
| Plan a zero-downtime migration | a frontier model |

Guide: https://docs.litellm.ai/docs/auto_router/index.md. Agent prompt: "Try the LiteLLM Auto Router", in https://docs.litellm.ai/docs/agent_resources.md

**LiteAgents (preview): Use a different agent harness and keep your agent code.** Replace one parameter to move between Deep Agents, Pydantic AI, the Claude Agent SDK, Codex, and OpenCode. Your tools and MCP connections stay the same.

```python
ProfileOptions(
    harness="deepagents",  # or "claude-sdk", "codex", "pydantic-ai"
    model="my-model",
)
```

Guide: https://docs.litellm.ai/blog/liteagents-sdk. Agent prompt: "Try LiteAgents on one of my agents", in https://docs.litellm.ai/docs/agent_resources.md

#### Your terminal and your agent

**lite CLI: Run Claude Code and Codex through your gateway.** The lite CLI signs in to your gateway and starts the tool through it. No person uses a provider API key. Budgets, logs, and guardrails apply to each person.

```bash
lite login    # sign in to your gateway
lite claude   # Claude Code, through the gateway
```

Guide: https://docs.litellm.ai/docs/proxy/management_cli.md. Agent prompt: "Point my tools at my LiteLLM Gateway", in https://docs.litellm.ai/docs/agent_resources.md

**LiteAdmin MCP: Control the gateway with instructions to your agent.** Connect Claude or Codex to your gateway. Then tell the agent to create keys, add models, control teams and budgets, or find a request with an error.

> **You:** Create a key for the search team with a $200 monthly budget.
> **Claude:** Done. The key belongs to team search, with a $200 budget per month.

Guide: https://docs.litellm.ai/docs/proxy/liteadmin_mcp.md. Agent prompt: "Manage my LiteLLM Gateway from this agent with LiteAdmin MCP", in https://docs.litellm.ai/docs/agent_resources.md

### Enterprise: Single sign-on, audit logs, and admin roles for all the teams in your company.

A license key adds Enterprise features to the same gateway. These features are SSO, SCIM, audit logs of all admin changes, and admins for each team. Enterprise also gives deployment in more than one region, and the LiteLLM engineers help your team.

- jane@acme.com via Okta, created key, team: search
- raj@acme.com via Okta, raised budget, team: support

Guide: https://docs.litellm.ai/docs/enterprise.md. Talk to sales: https://www.litellm.ai/enterprise#talk-to-sales

- Python SDK: `uv add litellm` (or `pip install litellm`), then `litellm.completion(model="<provider>/<model>", messages=[...])`. Responses always use the OpenAI Chat Completions shape.
- AI Gateway: Docker image `docker.litellm.ai/berriai/litellm`. Keys, the Admin UI (`/ui`), and spend tracking need Postgres (`DATABASE_URL`) and a `LITELLM_MASTER_KEY`. Any OpenAI or Anthropic SDK works against it by changing the base URL.
- Enterprise: a license key (`LITELLM_LICENSE`) on the same gateway image. Contact: https://www.litellm.ai/enterprise#talk-to-sales
- Every docs page is available as markdown by appending `.md` to its URL, for example https://docs.litellm.ai/docs/proxy/docker_quick_start.md. The full docs are in https://docs.litellm.ai/llms-full.txt.

## LiteLLM at a glance

LiteLLM is the most widely used and most secure open-source AI gateway, trusted by teams at Netflix, Okta, Ramp, NASA, Zurich, Cloudera, AT&T, and Lemonade (https://www.litellm.ai/enterprise). Figures as of 2026-10-05; each links to its source for current values.

- Adoption: 60.2k GitHub stars and 12k forks (https://github.com/BerriAI/litellm), with 1,700+ contributors.
- Usage: 91.1 million downloads of the `litellm` Python package in the last month (https://pypistats.org/packages/litellm).
- Container image: 512M pulls of the LiteLLM Gateway image on GitHub Container Registry and Docker Hub (https://github.com/BerriAI/litellm/pkgs/container/litellm).
- Security: SOC 2 Type II audited (https://trust.litellm.ai/). Every Docker image on GHCR is signed with cosign and can be verified before it runs (https://docs.litellm.ai/docs/proxy/docker_image_security.md). Enterprise support includes a 72-hour security patch SLA (https://docs.litellm.ai/docs/enterprise.md).
- Deployment: self-hosted in your own cloud, so prompts, responses, and provider keys stay in your infrastructure (https://docs.litellm.ai/docs/data_security.md).
- License: open source under MIT; Enterprise features need a license key (https://github.com/BerriAI/litellm/blob/main/LICENSE).

## Start here

- [Python SDK quickstart](https://docs.litellm.ai/docs/index.md): `uv add litellm`, then call any provider with `completion()`
- [AI Gateway quickstart](https://docs.litellm.ai/docs/proxy/docker_quick_start.md): Run the gateway with Docker and Postgres, add a model, create a virtual key
- [Agent resources](https://docs.litellm.ai/docs/agent_resources.md): Copy-paste prompts, MCP, and skills for coding agents setting up LiteLLM
- [Connect clients to the gateway](https://docs.litellm.ai/docs/proxy/client_setup/overview.md): Point Claude Code, Codex, Cursor, or any OpenAI or Anthropic SDK at the gateway
- [Gateway config.yaml reference](https://docs.litellm.ai/docs/proxy/configs.md): Every setting the gateway config file supports
- [Production deployment](https://docs.litellm.ai/docs/proxy/deploy.md): Helm, Terraform, and Kubernetes on AWS, GCP, and Azure
- [LiteLLM Enterprise](https://docs.litellm.ai/docs/enterprise.md): What Enterprise adds on top of the open-source gateway: SSO, audit logs, admin roles, SLAs

Every page: https://docs.litellm.ai/sitemap.md. Agent prompts, MCP, and skills: https://docs.litellm.ai/docs/agent_resources.md
