This commit is contained in:
devin-ai-integration[bot] 2026-09-13 00:09:36 +08:00 committed by GitHub
commit 135c77dab0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
91 changed files with 511 additions and 509 deletions

View file

@ -1771,6 +1771,7 @@ jobs:
-e LANGFUSE_PROJECT2_SECRET=$LANGFUSE_PROJECT2_SECRET \
-e RECORDER_OPENAI_BASE_URL=http://host.docker.internal:8090/v1 \
-e LITELLM_LOG=ERROR \
-e LITELLM_MASTER_KEY="sk-1234" \
--add-host host.docker.internal:host-gateway \
--name my-app \
-v $(pwd)/proxy_server_config.yaml:/app/config.yaml \

View file

@ -26,6 +26,7 @@ NOVITA_API_KEY = ""
INFINITY_API_KEY = ""
# Development Configs
LITELLM_MASTER_KEY = "sk-1234"
# Generate one with: python -c "import secrets; print('sk-' + secrets.token_urlsafe(32))"
LITELLM_MASTER_KEY = "sk-<paste-a-long-random-key>"
DATABASE_URL = "postgresql://llmproxy:dbpassword9090@db:5432/litellm"
STORE_MODEL_IN_DB = "True"

View file

@ -272,7 +272,7 @@ docker build -f docker/Dockerfile.non_root -t litellm_dev .
# Run with your config
docker run \
-v $(pwd)/proxy_config.yaml:/app/config.yaml \
-e LITELLM_MASTER_KEY="sk-1234" \
-e LITELLM_MASTER_KEY="sk-<paste-a-long-random-key>" \
-p 4000:4000 \
litellm_dev \
--config /app/config.yaml --detailed_debug

View file

@ -168,7 +168,7 @@ from a2a.utils.constants import TransportProtocol
from uuid import uuid4
base_url = "http://localhost:4000/a2a/my-agent" # LiteLLM proxy + agent name
headers = {"Authorization": "Bearer sk-1234"} # LiteLLM Virtual Key
headers = {"Authorization": "Bearer sk-<your-litellm-api-key>"} # LiteLLM Virtual Key
async with httpx.AsyncClient(headers=headers, timeout=60.0) as http_client:
resolver = A2ACardResolver(httpx_client=http_client, base_url=base_url)
@ -233,7 +233,7 @@ async with stdio_client(server_params) as (read, write):
```bash
curl -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
-H 'Authorization: Bearer sk-1234' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-4o",
@ -255,7 +255,7 @@ curl -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
"LiteLLM": {
"url": "http://localhost:4000/mcp/",
"headers": {
"x-litellm-api-key": "Bearer sk-1234"
"x-litellm-api-key": "Bearer sk-<your-litellm-api-key>"
}
}
}

View file

@ -97,7 +97,7 @@
"source": [
"from openai import OpenAI\n",
"client = OpenAI(\n",
" api_key=\"sk-1234\", # [OPTIONAL] set if you set one on proxy, else set \"\"\n",
" api_key=\"sk-<your-litellm-api-key>\", # [OPTIONAL] set if you set one on proxy, else set \"\"\n",
" base_url=\"http://0.0.0.0:4000\",\n",
")\n",
"\n",
@ -298,14 +298,14 @@
" engine=\"azure-gpt-3.5\", # model_name on litellm proxy\n",
" temperature=0.0,\n",
" azure_endpoint=\"http://0.0.0.0:4000\", # litellm proxy endpoint\n",
" api_key=\"sk-1234\", # litellm proxy API Key\n",
" api_key=\"sk-<your-litellm-api-key>\", # litellm proxy API Key\n",
" api_version=\"2023-07-01-preview\",\n",
")\n",
"\n",
"embed_model = AzureOpenAIEmbedding(\n",
" deployment_name=\"azure-embedding-model\",\n",
" azure_endpoint=\"http://0.0.0.0:4000\",\n",
" api_key=\"sk-1234\",\n",
" api_key=\"sk-<your-litellm-api-key>\",\n",
" api_version=\"2023-07-01-preview\",\n",
")\n",
"\n",
@ -341,7 +341,7 @@
"\n",
"const model = new ChatOpenAI({\n",
" modelName: \"gpt-4\",\n",
" openAIApiKey: \"sk-1234\",\n",
" openAIApiKey: \"sk-<your-litellm-api-key>\",\n",
" modelKwargs: {\"metadata\": \"hello world\"} // 👈 PASS Additional params here\n",
"}, {\n",
" basePath: \"http://0.0.0.0:4000\",\n",
@ -372,7 +372,7 @@
"const { OpenAI } = require('openai');\n",
"\n",
"const openai = new OpenAI({\n",
" apiKey: \"sk-1234\", // This is the default and can be omitted\n",
" apiKey: \"sk-<your-litellm-api-key>\", // This is the default and can be omitted\n",
" baseURL: \"http://0.0.0.0:4000\"\n",
"});\n",
"\n",

View file

@ -24,7 +24,7 @@
"import asyncio\n",
"\n",
"proxy_base_url = \"http://0.0.0.0:4000\" # 👈 SET TO PROXY URL\n",
"master_key = \"sk-1234\" # 👈 SET TO PROXY MASTER KEY"
"master_key = \"sk-<your-litellm-master-key>\" # 👈 SET TO PROXY MASTER KEY"
]
},
{

View file

@ -47,7 +47,7 @@ Set your environment variables:
```bash
export ANTHROPIC_API_KEY="your-anthropic-api-key"
export LITELLM_MASTER_KEY="sk-1234567890" # Generate a secure key
export LITELLM_MASTER_KEY="sk-<paste-a-long-random-key>" # Generate a secure key
```
## Step 2: Start Proxy

View file

@ -58,7 +58,7 @@ Set these environment variables if needed:
```bash
export LITELLM_PROXY_URL="http://localhost:4000"
export LITELLM_API_KEY="sk-1234"
export LITELLM_API_KEY="sk-<your-litellm-api-key>"
export LITELLM_MODEL="bedrock-claude-sonnet-4.5"
```
@ -98,7 +98,7 @@ The key is pointing the Agent SDK to LiteLLM instead of directly to Anthropic:
```python
# Point to LiteLLM gateway (not Anthropic)
os.environ["ANTHROPIC_BASE_URL"] = "http://localhost:4000"
os.environ["ANTHROPIC_API_KEY"] = "sk-1234" # Your LiteLLM key
os.environ["ANTHROPIC_API_KEY"] = "sk-<your-litellm-api-key>" # Your LiteLLM key
# Use any model configured in LiteLLM
options = ClaudeAgentOptions(

View file

@ -13,7 +13,7 @@ class Config:
LITELLM_PROXY_URL = os.getenv("LITELLM_PROXY_URL", "http://localhost:4000")
# LiteLLM API key (master key or virtual key)
LITELLM_API_KEY = os.getenv("LITELLM_API_KEY", "sk-1234")
LITELLM_API_KEY = os.getenv("LITELLM_API_KEY", "sk-<your-litellm-api-key>")
# Model name as configured in LiteLLM (e.g., "bedrock-claude-sonnet-4", "gpt-4", etc.)
LITELLM_MODEL = os.getenv("LITELLM_MODEL", "bedrock-claude-sonnet-4.5")

View file

@ -2,7 +2,7 @@ from openai import OpenAI
client = OpenAI(
base_url="http://0.0.0.0:4000",
api_key="sk-1234",
api_key="sk-<your-litellm-api-key>",
)
BEDROCK_BATCH_MODEL = "bedrock/batch-anthropic.claude-3-5-sonnet-20240620-v1:0"

View file

@ -7,7 +7,7 @@ When using LiteLLM Proxy, you can use the same MCP tools across all your LLM pro
import openai
client = openai.OpenAI(
api_key="sk-1234", # paste your litellm proxy api key here
api_key="sk-<your-litellm-api-key>", # paste your litellm proxy api key here
base_url="http://localhost:4000", # paste your litellm proxy base url here
)
print("Making API request to Responses API with MCP tools")

View file

@ -32,7 +32,7 @@ Set these environment variables if needed:
```bash
export LITELLM_PROXY_URL="http://localhost:4000"
export LITELLM_API_KEY="sk-1234"
export LITELLM_API_KEY="sk-<your-litellm-api-key>"
export LITELLM_MODEL="grok-voice-agent"
```
@ -59,7 +59,7 @@ model_list:
mode: realtime
general_settings:
master_key: sk-1234
master_key: os.environ/LITELLM_MASTER_KEY
```
Then start: `litellm --config config.yaml --port 4000`
@ -73,7 +73,7 @@ from livekit.plugins import xai
model = xai.realtime.RealtimeModel(
voice="ara",
api_key="sk-1234", # LiteLLM proxy key
api_key="sk-<your-litellm-api-key>", # LiteLLM proxy key
base_url="http://localhost:4000", # Point to LiteLLM
)
```

View file

@ -18,4 +18,4 @@ litellm_settings:
telemetry: False
general_settings:
master_key: sk-1234 # Change this to a secure key
master_key: os.environ/LITELLM_MASTER_KEY # Change this to a secure key

View file

@ -13,7 +13,7 @@ import websockets
# Configuration
PROXY_URL = os.getenv("LITELLM_PROXY_URL", "http://localhost:4000")
API_KEY = os.getenv("LITELLM_API_KEY", "sk-1234")
API_KEY = os.getenv("LITELLM_API_KEY", "sk-<your-litellm-api-key>")
MODEL = os.getenv("LITELLM_MODEL", "grok-voice-agent")

View file

@ -59,7 +59,7 @@ litellm_settings:
context_window_fallbacks: [{"gpt-3.5-turbo": ["gpt-3.5-turbo-large"]}]
general_settings:
master_key: sk-1234 # [OPTIONAL] Use to enforce auth on proxy. See - https://docs.litellm.ai/docs/proxy/virtual_keys
master_key: os.environ/LITELLM_MASTER_KEY # [OPTIONAL] Use to enforce auth on proxy. See - https://docs.litellm.ai/docs/proxy/virtual_keys
store_model_in_db: True
proxy_budget_rescheduler_min_time: 60
proxy_budget_rescheduler_max_time: 64

View file

@ -89,7 +89,7 @@ def migrate_models(config_file, proxy_base_url):
# Usage
config_file = "config.yaml"
proxy_base_url = "http://0.0.0.0:4000"
master_key = "sk-1234"
master_key = "sk-<your-litellm-master-key>"
print(f"config_file: {config_file}")
print(f"proxy_base_url: {proxy_base_url}")
migrate_models(config_file, proxy_base_url)

View file

@ -164,7 +164,7 @@
" openai_api_base=\"LITELLM_PROXY_BASE_URL\", # e.g.: http://0.0.0.0:4000\n",
" model = \"gpt-3.5-turbo\", # LITELLM 'model_name'\n",
" temperature=0.1, \n",
" api_key=\"LITELLM_PROXY_API_KEY\" # e.g.: \"sk-1234\"\n",
" api_key=\"LITELLM_PROXY_API_KEY\" # e.g.: \"sk-<your-litellm-api-key>\"\n",
")"
]
},

View file

@ -69,7 +69,7 @@ litellm --config config.yaml
```bash
curl http://0.0.0.0:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"prompt_id": "hello-world-prompt",

View file

@ -33,7 +33,7 @@ CHUNK_SIZE = 1024
# LiteLLM proxy configuration
LITELLM_PROXY_URL = "ws://localhost:4000/v1/realtime?model=bedrock-sonic"
LITELLM_API_KEY = "sk-12345" # Your LiteLLM API key
LITELLM_API_KEY = "sk-<your-litellm-api-key>" # Your LiteLLM API key
class RealtimeClient:

View file

@ -25,7 +25,7 @@ class VeoVideoGenerator:
def __init__(
self,
base_url: str = "http://localhost:4000/gemini/v1beta",
api_key: str = "sk-1234",
api_key: str = "sk-<your-litellm-api-key>",
):
"""
Initialize the Veo video generator.
@ -274,12 +274,12 @@ def main():
Configure these environment variables:
- LITELLM_BASE_URL: Your LiteLLM proxy URL (default: http://localhost:4000/gemini/v1beta)
- LITELLM_API_KEY: Your LiteLLM API key (default: sk-1234)
- LITELLM_API_KEY: Your LiteLLM API key (default: sk-<your-litellm-api-key>)
"""
# Configuration from environment or defaults
base_url = os.getenv("LITELLM_BASE_URL", "http://localhost:4000/gemini/v1beta")
api_key = os.getenv("LITELLM_API_KEY", "sk-1234")
api_key = os.getenv("LITELLM_API_KEY", "sk-<your-litellm-api-key>")
print("🚀 Starting Veo Video Generation Example")
print(f"📡 Using LiteLLM proxy at: {base_url}")

View file

@ -430,7 +430,7 @@ async def new_project(
```bash
curl --location 'http://0.0.0.0:4000/project/new' \\
--header 'Authorization: Bearer sk-1234' \\
--header "Authorization: Bearer $LITELLM_API_KEY" \\
--header 'Content-Type: application/json' \\
--data '{
"project_alias": "flight-search-assistant",
@ -457,7 +457,7 @@ async def new_project(
```bash
curl --location 'http://0.0.0.0:4000/project/new' \\
--header 'Authorization: Bearer sk-1234' \\
--header "Authorization: Bearer $LITELLM_API_KEY" \\
--header 'Content-Type: application/json' \\
--data '{
"project_alias": "hotel-recommendations",
@ -644,7 +644,7 @@ async def update_project(
Example:
```bash
curl --location 'http://0.0.0.0:4000/project/update' \\
--header 'Authorization: Bearer sk-1234' \\
--header "Authorization: Bearer $LITELLM_API_KEY" \\
--header 'Content-Type: application/json' \\
--data '{
"project_id": "project-123",
@ -867,7 +867,7 @@ async def delete_project(
Example:
```bash
curl --location --request DELETE 'http://0.0.0.0:4000/project/delete' \\
--header 'Authorization: Bearer sk-1234' \\
--header "Authorization: Bearer $LITELLM_API_KEY" \\
--header 'Content-Type: application/json' \\
--data '{
"project_ids": ["project-123", "project-456"]
@ -973,7 +973,7 @@ async def project_info(
Example:
```bash
curl --location 'http://0.0.0.0:4000/project/info?project_id=project-123' \\
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import prisma_client
@ -1042,7 +1042,7 @@ async def list_projects(
Example:
```bash
curl --location 'http://0.0.0.0:4000/project/list' \\
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import prisma_client

View file

@ -86,7 +86,7 @@ import anthropic
# point anthropic sdk to litellm proxy
client = anthropic.Anthropic(
base_url="http://0.0.0.0:4000",
api_key="sk-1234",
api_key="sk-<your-litellm-api-key>",
)
response = client.messages.create(
@ -101,7 +101,7 @@ response = client.messages.create(
```bash showLineNumbers title="Example using LiteLLM Proxy Server"
curl -L -X POST 'http://0.0.0.0:4000/v1/messages' \
-H 'content-type: application/json' \
-H 'x-api-key: $LITELLM_API_KEY' \
-H "x-api-key: $LITELLM_API_KEY" \
-H 'anthropic-version: 2023-06-01' \
-d '{
"model": "anthropic-claude",

View file

@ -183,14 +183,14 @@ def get_provider_container_config(
```bash
# Create container via Azure
curl -X POST "http://localhost:4000/v1/containers" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "custom-llm-provider: azure" \
-H "Content-Type: application/json" \
-d '{"name": "My Azure Container"}'
# List container files via Azure
curl -X GET "http://localhost:4000/v1/containers/cntr_123/files" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "custom-llm-provider: azure"
```
@ -224,7 +224,7 @@ cd litellm/proxy && python proxy_cli.py --config proxy_config.yaml --port 4000
# Test endpoints
curl -X GET "http://localhost:4000/v1/containers/cntr_123/files" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
---

View file

@ -148,7 +148,7 @@ litellm --config config.yaml --detailed_debug
```bash
curl -L -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-1234' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "my-bitbucket-model",
"messages": [{"role": "user", "content": "IGNORED"}],

View file

@ -148,7 +148,7 @@ litellm --config config.yaml --detailed_debug
```bash
curl -L -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-1234' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "my-gitlab-model",
"messages": [{"role": "user", "content": "IGNORED"}],

View file

@ -175,7 +175,7 @@ class LoggingCallbackManager:
callback_type: generic_api
endpoint: https://webhook-test.com/30343bc33591bc5e6dc44217ceae3e0a
headers:
Authorization: Bearer sk-1234
Authorization: Bearer sk-<your-litellm-api-key>
"""
callback_config: Final = litellm.callback_settings.get(callback)

View file

@ -1241,7 +1241,7 @@
"paths": {
"/access_group/list": {
"get": {
"description": "List all access groups.\n\nReturns a list of all access groups with their model names, deployment counts, shared budget\nand the spend drawn against it.\n\nExample:\n```bash\ncurl -X GET 'http://localhost:4000/access_group/list' \\\n -H 'Authorization: Bearer sk-1234'\n```\n\nReturns:\n- ListAccessGroupsResponse with all access groups",
"description": "List all access groups.\n\nReturns a list of all access groups with their model names, deployment counts, shared budget\nand the spend drawn against it.\n\nExample:\n```bash\ncurl -X GET 'http://localhost:4000/access_group/list' \\\n -H \"Authorization: Bearer $LITELLM_API_KEY\"\n```\n\nReturns:\n- ListAccessGroupsResponse with all access groups",
"operationId": "list_access_groups_access_group_list_get",
"responses": {
"200": {
@ -1268,7 +1268,7 @@
},
"/access_group/new": {
"post": {
"description": "Create a new access group containing multiple model names.\n\nAn access group is a named collection of model groups that can be referenced\nby teams/keys for simplified access control.\n\nExample:\n```bash\ncurl -X POST 'http://localhost:4000/access_group/new' \\\n -H 'Authorization: Bearer sk-1234' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"access_group\": \"production-models\",\n \"model_names\": [\"gpt-4\", \"claude-3-opus\", \"gemini-pro\"]\n }'\n```\n\nParameters:\n- access_group: str - The access group name (e.g., \"production-models\")\n- model_names: List[str] - List of existing model groups to include\n\nReturns:\n- NewModelGroupResponse with the created access group details\n\nRaises:\n- HTTPException 400: If any model names don't exist\n- HTTPException 500: If database operations fail",
"description": "Create a new access group containing multiple model names.\n\nAn access group is a named collection of model groups that can be referenced\nby teams/keys for simplified access control.\n\nExample:\n```bash\ncurl -X POST 'http://localhost:4000/access_group/new' \\\n -H \"Authorization: Bearer $LITELLM_API_KEY\" \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"access_group\": \"production-models\",\n \"model_names\": [\"gpt-4\", \"claude-3-opus\", \"gemini-pro\"]\n }'\n```\n\nParameters:\n- access_group: str - The access group name (e.g., \"production-models\")\n- model_names: List[str] - List of existing model groups to include\n\nReturns:\n- NewModelGroupResponse with the created access group details\n\nRaises:\n- HTTPException 400: If any model names don't exist\n- HTTPException 500: If database operations fail",
"operationId": "create_model_group_access_group_new_post",
"requestBody": {
"content": {
@ -1315,7 +1315,7 @@
},
"/access_group/{access_group}/budget": {
"delete": {
"description": "Clear the shared budget of an access group, leaving the group itself in place.\n\nExample:\n```bash\ncurl -X DELETE 'http://localhost:4000/access_group/production-models/budget' \\\n -H 'Authorization: Bearer sk-1234'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- DeleteAccessGroupBudgetResponse; budget_deleted is false when there was nothing to clear\n\nRaises:\n- HTTPException 404: If access group not found",
"description": "Clear the shared budget of an access group, leaving the group itself in place.\n\nExample:\n```bash\ncurl -X DELETE 'http://localhost:4000/access_group/production-models/budget' \\\n -H \"Authorization: Bearer $LITELLM_API_KEY\"\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- DeleteAccessGroupBudgetResponse; budget_deleted is false when there was nothing to clear\n\nRaises:\n- HTTPException 404: If access group not found",
"operationId": "delete_access_group_budget_access_group__access_group__budget_delete",
"parameters": [
{
@ -1361,7 +1361,7 @@
]
},
"get": {
"description": "Get the shared budget of an access group, and the spend drawn against it.\n\nExample:\n```bash\ncurl -X GET 'http://localhost:4000/access_group/production-models/budget' \\\n -H 'Authorization: Bearer sk-1234'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- AccessGroupBudgetResponse; budget is null when the group has no budget set\n\nRaises:\n- HTTPException 404: If access group not found",
"description": "Get the shared budget of an access group, and the spend drawn against it.\n\nExample:\n```bash\ncurl -X GET 'http://localhost:4000/access_group/production-models/budget' \\\n -H \"Authorization: Bearer $LITELLM_API_KEY\"\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- AccessGroupBudgetResponse; budget is null when the group has no budget set\n\nRaises:\n- HTTPException 404: If access group not found",
"operationId": "get_access_group_budget_access_group__access_group__budget_get",
"parameters": [
{
@ -1407,7 +1407,7 @@
]
},
"put": {
"description": "Set or replace the shared budget of an access group. Idempotent.\n\nEvery key that can reach a model in the group draws from this one budget.\n\nExample:\n```bash\ncurl -X PUT 'http://localhost:4000/access_group/production-models/budget' \\\n -H 'Authorization: Bearer sk-1234' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"max_budget\": 100.0,\n \"budget_duration\": \"30d\"\n }'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n- max_budget: Optional[float] - Requests fail once the group's shared spend exceeds this\n- soft_budget: Optional[float] - Fires an alert when reached; requests still succeed\n- budget_duration: Optional[str] - Frequency of resetting the group's spend (e.g. '30d')\n- budget_id: Optional[str] - Link an existing budget instead of creating one\n\nReturns:\n- AccessGroupBudgetResponse with the stored budget and current spend\n\nRaises:\n- HTTPException 400: If no budget field is given, or budget_duration cannot be parsed\n- HTTPException 404: If access group not found",
"description": "Set or replace the shared budget of an access group. Idempotent.\n\nEvery key that can reach a model in the group draws from this one budget.\n\nExample:\n```bash\ncurl -X PUT 'http://localhost:4000/access_group/production-models/budget' \\\n -H \"Authorization: Bearer $LITELLM_API_KEY\" \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"max_budget\": 100.0,\n \"budget_duration\": \"30d\"\n }'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n- max_budget: Optional[float] - Requests fail once the group's shared spend exceeds this\n- soft_budget: Optional[float] - Fires an alert when reached; requests still succeed\n- budget_duration: Optional[str] - Frequency of resetting the group's spend (e.g. '30d')\n- budget_id: Optional[str] - Link an existing budget instead of creating one\n\nReturns:\n- AccessGroupBudgetResponse with the stored budget and current spend\n\nRaises:\n- HTTPException 400: If no budget field is given, or budget_duration cannot be parsed\n- HTTPException 404: If access group not found",
"operationId": "set_access_group_budget_access_group__access_group__budget_put",
"parameters": [
{
@ -1465,7 +1465,7 @@
},
"/access_group/{access_group}/delete": {
"delete": {
"description": "Delete an access group.\n\nRemoves the access group from all deployments that have it.\n\nExample:\n```bash\ncurl -X DELETE 'http://localhost:4000/access_group/production-models/delete' \\\n -H 'Authorization: Bearer sk-1234'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- DeleteModelGroupResponse with deletion details\n\nRaises:\n- HTTPException 404: If access group not found",
"description": "Delete an access group.\n\nRemoves the access group from all deployments that have it.\n\nExample:\n```bash\ncurl -X DELETE 'http://localhost:4000/access_group/production-models/delete' \\\n -H \"Authorization: Bearer $LITELLM_API_KEY\"\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- DeleteModelGroupResponse with deletion details\n\nRaises:\n- HTTPException 404: If access group not found",
"operationId": "delete_access_group_access_group__access_group__delete_delete",
"parameters": [
{
@ -1513,7 +1513,7 @@
},
"/access_group/{access_group}/info": {
"get": {
"description": "Get information about a specific access group.\n\nExample:\n```bash\ncurl -X GET 'http://localhost:4000/access_group/production-models/info' \\\n -H 'Authorization: Bearer sk-1234'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- AccessGroupInfo with the access group details, its shared budget and its spend\n\nRaises:\n- HTTPException 404: If access group not found",
"description": "Get information about a specific access group.\n\nExample:\n```bash\ncurl -X GET 'http://localhost:4000/access_group/production-models/info' \\\n -H \"Authorization: Bearer $LITELLM_API_KEY\"\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- AccessGroupInfo with the access group details, its shared budget and its spend\n\nRaises:\n- HTTPException 404: If access group not found",
"operationId": "get_access_group_info_access_group__access_group__info_get",
"parameters": [
{
@ -1561,7 +1561,7 @@
},
"/access_group/{access_group}/update": {
"put": {
"description": "Update an access group's model names.\n\nThis will:\n1. Remove the access group from all current deployments\n2. Add the access group to all deployments for the new model_names list\n\nExample:\n```bash\ncurl -X PUT 'http://localhost:4000/access_group/production-models/update' \\\n -H 'Authorization: Bearer sk-1234' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"model_names\": [\"gpt-4\", \"claude-3-sonnet\"]\n }'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n- model_names: List[str] - New list of model groups to include\n\nReturns:\n- NewModelGroupResponse with the updated access group details\n\nRaises:\n- HTTPException 400: If any model names don't exist\n- HTTPException 404: If access group not found",
"description": "Update an access group's model names.\n\nThis will:\n1. Remove the access group from all current deployments\n2. Add the access group to all deployments for the new model_names list\n\nExample:\n```bash\ncurl -X PUT 'http://localhost:4000/access_group/production-models/update' \\\n -H \"Authorization: Bearer $LITELLM_API_KEY\" \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"model_names\": [\"gpt-4\", \"claude-3-sonnet\"]\n }'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n- model_names: List[str] - New list of model groups to include\n\nReturns:\n- NewModelGroupResponse with the updated access group details\n\nRaises:\n- HTTPException 400: If any model names don't exist\n- HTTPException 404: If access group not found",
"operationId": "update_access_group_access_group__access_group__update_put",
"parameters": [
{
@ -17440,7 +17440,7 @@
},
"/cursor/chat/completions": {
"post": {
"description": "Cursor BYOK endpoint. Accepts both request shapes Cursor sends to its OpenAI-compatible\nbase URL and always answers in chat completions format.\n\nCursor agent mode sends Responses API format bodies (`input`, flat tool defs, `reasoning`,\ncustom tools) to the chat/completions path while expecting chat completions responses;\nthose are routed through the Responses API pipeline and converted back. Genuine chat\ncompletions bodies (`messages` present) are routed through the standard chat completions\npipeline, after normalizing each level of the `tools` array and `tool_choice` to the chat\ncompletions shapes OpenAI requires. Cursor mixes Responses API shapes into chat bodies\nper level, independently: a flat tool def (`{\"type\": \"custom\", \"name\": \"ApplyPatch\", ...}`)\ngets nested under `custom`, and a flat grammar format\n(`{\"type\": \"grammar\", \"definition\", \"syntax\"}`) gets wrapped as\n`{\"type\": \"grammar\", \"grammar\": {...}}` wherever it appears, including inside tool defs\nCursor already sent pre-nested.\n\n```bash\ncurl -X POST http://localhost:4000/cursor/chat/completions -H \"Content-Type: application/json\" -H \"Authorization: Bearer sk-1234\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n}'\nResponds back in chat completions format.\n```",
"description": "Cursor BYOK endpoint. Accepts both request shapes Cursor sends to its OpenAI-compatible\nbase URL and always answers in chat completions format.\n\nCursor agent mode sends Responses API format bodies (`input`, flat tool defs, `reasoning`,\ncustom tools) to the chat/completions path while expecting chat completions responses;\nthose are routed through the Responses API pipeline and converted back. Genuine chat\ncompletions bodies (`messages` present) are routed through the standard chat completions\npipeline, after normalizing each level of the `tools` array and `tool_choice` to the chat\ncompletions shapes OpenAI requires. Cursor mixes Responses API shapes into chat bodies\nper level, independently: a flat tool def (`{\"type\": \"custom\", \"name\": \"ApplyPatch\", ...}`)\ngets nested under `custom`, and a flat grammar format\n(`{\"type\": \"grammar\", \"definition\", \"syntax\"}`) gets wrapped as\n`{\"type\": \"grammar\", \"grammar\": {...}}` wherever it appears, including inside tool defs\nCursor already sent pre-nested.\n\n```bash\ncurl -X POST http://localhost:4000/cursor/chat/completions -H \"Content-Type: application/json\" -H \"Authorization: Bearer $LITELLM_API_KEY\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n}'\nResponds back in chat completions format.\n```",
"operationId": "cursor_chat_completions_cursor_chat_completions_post",
"responses": {
"200": {
@ -18817,7 +18817,7 @@
},
"/openai/deployments/{model}/chat/completions": {
"post": {
"description": "Follows the exact same API spec as `OpenAI's Chat API https://platform.openai.com/docs/api-reference/chat`\n\n```bash\ncurl -X POST http://localhost:4000/v1/chat/completions \n-H \"Content-Type: application/json\" \n-H \"Authorization: Bearer sk-1234\" \n-d '{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ]\n}'\n```",
"description": "Follows the exact same API spec as `OpenAI's Chat API https://platform.openai.com/docs/api-reference/chat`\n\n```bash\ncurl -X POST http://localhost:4000/v1/chat/completions \n-H \"Content-Type: application/json\" \n-H \"Authorization: Bearer $LITELLM_API_KEY\" \n-d '{\n \"model\": \"gpt-4o\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello!\"\n }\n ]\n}'\n```",
"operationId": "chat_completion_openai_deployments__model__chat_completions_post",
"parameters": [
{
@ -18950,7 +18950,7 @@
},
"/openai/deployments/{model}/completions": {
"post": {
"description": "Follows the exact same API spec as `OpenAI's Completions API https://platform.openai.com/docs/api-reference/completions`\n\n```bash\ncurl -X POST http://localhost:4000/v1/completions \n-H \"Content-Type: application/json\" \n-H \"Authorization: Bearer sk-1234\" \n-d '{\n \"model\": \"gpt-3.5-turbo-instruct\",\n \"prompt\": \"Once upon a time\",\n \"max_tokens\": 50,\n \"temperature\": 0.7\n}'\n```",
"description": "Follows the exact same API spec as `OpenAI's Completions API https://platform.openai.com/docs/api-reference/completions`\n\n```bash\ncurl -X POST http://localhost:4000/v1/completions \n-H \"Content-Type: application/json\" \n-H \"Authorization: Bearer $LITELLM_API_KEY\" \n-d '{\n \"model\": \"gpt-3.5-turbo-instruct\",\n \"prompt\": \"Once upon a time\",\n \"max_tokens\": 50,\n \"temperature\": 0.7\n}'\n```",
"operationId": "completion_openai_deployments__model__completions_post",
"parameters": [
{
@ -19003,7 +19003,7 @@
},
"/openai/deployments/{model}/embeddings": {
"post": {
"description": "Follows the exact same API spec as `OpenAI's Embeddings API https://platform.openai.com/docs/api-reference/embeddings`\n\n```bash\ncurl -X POST http://localhost:4000/v1/embeddings \n-H \"Content-Type: application/json\" \n-H \"Authorization: Bearer sk-1234\" \n-d '{\n \"model\": \"text-embedding-ada-002\",\n \"input\": \"The quick brown fox jumps over the lazy dog\"\n}'\n```",
"description": "Follows the exact same API spec as `OpenAI's Embeddings API https://platform.openai.com/docs/api-reference/embeddings`\n\n```bash\ncurl -X POST http://localhost:4000/v1/embeddings \n-H \"Content-Type: application/json\" \n-H \"Authorization: Bearer $LITELLM_API_KEY\" \n-d '{\n \"model\": \"text-embedding-ada-002\",\n \"input\": \"The quick brown fox jumps over the lazy dog\"\n}'\n```",
"operationId": "embeddings_openai_deployments__model__embeddings_post",
"parameters": [
{
@ -19056,7 +19056,7 @@
},
"/openai/deployments/{model}/images/edits": {
"post": {
"description": "Follows the OpenAI Images API spec: https://platform.openai.com/docs/api-reference/images/create\n\n```bash\ncurl -s -D >(grep -i x-request-id >&2) -o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) -X POST \"http://localhost:4000/v1/images/edits\" -H \"Authorization: Bearer sk-1234\" -F \"model=gpt-image-1\" -F \"image[]=@soap.png\" -F 'prompt=Create a studio ghibli image of this'\n```",
"description": "Follows the OpenAI Images API spec: https://platform.openai.com/docs/api-reference/images/create\n\n```bash\ncurl -s -D >(grep -i x-request-id >&2) -o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) -X POST \"http://localhost:4000/v1/images/edits\" -H \"Authorization: Bearer $LITELLM_API_KEY\" -F \"model=gpt-image-1\" -F \"image[]=@soap.png\" -F 'prompt=Create a studio ghibli image of this'\n```",
"operationId": "image_edit_api_openai_deployments__model__images_edits_post",
"parameters": [
{
@ -19242,7 +19242,7 @@
},
"/openai/v1/responses": {
"post": {
"description": "Follows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses\n\nSupports background mode with polling_via_cache for partial response retrieval.\nWhen background=true and polling_via_cache is enabled, returns a polling_id immediately\nand streams the response in the background, updating Redis cache.\n\n```bash\n# Normal request\ncurl -X POST http://localhost:4000/v1/responses -H \"Content-Type: application/json\" -H \"Authorization: Bearer sk-1234\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": \"Tell me about AI\"\n}'\n\n# Background request with polling\ncurl -X POST http://localhost:4000/v1/responses -H \"Content-Type: application/json\" -H \"Authorization: Bearer sk-1234\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": \"Tell me about AI\",\n \"background\": true\n}'\n```",
"description": "Follows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses\n\nSupports background mode with polling_via_cache for partial response retrieval.\nWhen background=true and polling_via_cache is enabled, returns a polling_id immediately\nand streams the response in the background, updating Redis cache.\n\n```bash\n# Normal request\ncurl -X POST http://localhost:4000/v1/responses -H \"Content-Type: application/json\" -H \"Authorization: Bearer $LITELLM_API_KEY\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": \"Tell me about AI\"\n}'\n\n# Background request with polling\ncurl -X POST http://localhost:4000/v1/responses -H \"Content-Type: application/json\" -H \"Authorization: Bearer $LITELLM_API_KEY\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": \"Tell me about AI\",\n \"background\": true\n}'\n```",
"operationId": "responses_api_openai_v1_responses_post",
"responses": {
"200": {
@ -19267,7 +19267,7 @@
},
"/openai/v1/responses/compact": {
"post": {
"description": "Compact a response by running a compaction pass over a conversation.\n\nReturns encrypted, opaque items that can be used to reduce context size.\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/compact\n\n```bash\ncurl -X POST http://localhost:4000/v1/responses/compact -H \"Content-Type: application/json\" -H \"Authorization: Bearer sk-1234\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n}'\n```",
"description": "Compact a response by running a compaction pass over a conversation.\n\nReturns encrypted, opaque items that can be used to reduce context size.\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/compact\n\n```bash\ncurl -X POST http://localhost:4000/v1/responses/compact -H \"Content-Type: application/json\" -H \"Authorization: Bearer $LITELLM_API_KEY\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": [{\"role\": \"user\", \"content\": \"Hello\"}]\n}'\n```",
"operationId": "compact_response_openai_v1_responses_compact_post",
"responses": {
"200": {
@ -19292,7 +19292,7 @@
},
"/openai/v1/responses/input_tokens": {
"post": {
"description": "Count the input tokens of a Responses API request without calling the model.\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/input-tokens\n\n```bash\ncurl -X POST http://localhost:4000/v1/responses/input_tokens -H \"Content-Type: application/json\" -H \"Authorization: Bearer sk-1234\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": \"Hello, how are you?\"\n}'\n```\n\nReturns: `{\"object\": \"response.input_tokens\", \"input_tokens\": <count>}`",
"description": "Count the input tokens of a Responses API request without calling the model.\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/input-tokens\n\n```bash\ncurl -X POST http://localhost:4000/v1/responses/input_tokens -H \"Content-Type: application/json\" -H \"Authorization: Bearer $LITELLM_API_KEY\" -d '{\n \"model\": \"gpt-4o\",\n \"input\": \"Hello, how are you?\"\n}'\n```\n\nReturns: `{\"object\": \"response.input_tokens\", \"input_tokens\": <count>}`",
"operationId": "responses_input_tokens_openai_v1_responses_input_tokens_post",
"responses": {
"200": {
@ -19317,7 +19317,7 @@
},
"/openai/v1/responses/{response_id}": {
"delete": {
"description": "Delete a response by ID.\n\nSupports both:\n- Polling IDs (litellm_poll_*): Deletes from Redis cache\n- Provider response IDs: Passes through to provider API\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/delete\n\n```bash\ncurl -X DELETE http://localhost:4000/v1/responses/resp_abc123 -H \"Authorization: Bearer sk-1234\"\n```",
"description": "Delete a response by ID.\n\nSupports both:\n- Polling IDs (litellm_poll_*): Deletes from Redis cache\n- Provider response IDs: Passes through to provider API\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/delete\n\n```bash\ncurl -X DELETE http://localhost:4000/v1/responses/resp_abc123 -H \"Authorization: Bearer $LITELLM_API_KEY\"\n```",
"operationId": "delete_response_openai_v1_responses__response_id__delete",
"parameters": [
{
@ -19361,7 +19361,7 @@
]
},
"get": {
"description": "Get a response by ID.\n\nSupports both:\n- Polling IDs (litellm_poll_*): Returns cumulative cached content from background responses\n- Provider response IDs: Passes through to provider API\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/get\n\n```bash\n# Get polling response\ncurl -X GET http://localhost:4000/v1/responses/litellm_poll_abc123 -H \"Authorization: Bearer sk-1234\"\n\n# Get provider response\ncurl -X GET http://localhost:4000/v1/responses/resp_abc123 -H \"Authorization: Bearer sk-1234\"\n```",
"description": "Get a response by ID.\n\nSupports both:\n- Polling IDs (litellm_poll_*): Returns cumulative cached content from background responses\n- Provider response IDs: Passes through to provider API\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/get\n\n```bash\n# Get polling response\ncurl -X GET http://localhost:4000/v1/responses/litellm_poll_abc123 -H \"Authorization: Bearer $LITELLM_API_KEY\"\n\n# Get provider response\ncurl -X GET http://localhost:4000/v1/responses/resp_abc123 -H \"Authorization: Bearer $LITELLM_API_KEY\"\n```",
"operationId": "get_response_openai_v1_responses__response_id__get",
"parameters": [
{
@ -19407,7 +19407,7 @@
},
"/openai/v1/responses/{response_id}/cancel": {
"post": {
"description": "Cancel a response by ID.\n\nSupports both:\n- Polling IDs (litellm_poll_*): Cancels background response and updates status in Redis\n- Provider response IDs: Passes through to provider API\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/cancel\n\n```bash\n# Cancel polling response\ncurl -X POST http://localhost:4000/v1/responses/litellm_poll_abc123/cancel -H \"Authorization: Bearer sk-1234\"\n\n# Cancel provider response\ncurl -X POST http://localhost:4000/v1/responses/resp_abc123/cancel -H \"Authorization: Bearer sk-1234\"\n```",
"description": "Cancel a response by ID.\n\nSupports both:\n- Polling IDs (litellm_poll_*): Cancels background response and updates status in Redis\n- Provider response IDs: Passes through to provider API\n\nFollows the OpenAI Responses API spec: https://platform.openai.com/docs/api-reference/responses/cancel\n\n```bash\n# Cancel polling response\ncurl -X POST http://localhost:4000/v1/responses/litellm_poll_abc123/cancel -H \"Authorization: Bearer $LITELLM_API_KEY\"\n\n# Cancel provider response\ncurl -X POST http://localhost:4000/v1/responses/resp_abc123/cancel -H \"Authorization: Bearer $LITELLM_API_KEY\"\n```",
"operationId": "cancel_response_openai_v1_responses__response_id__cancel_post",
"parameters": [
{
@ -44527,7 +44527,7 @@
"paths": {
"/v1/indexes": {
"get": {
"description": "List all vector store indexes. Proxy admin only.\n\n```bash\ncurl -L -X GET 'http://0.0.0.0:4000/v1/indexes' -H 'Authorization: Bearer sk-1234'\n```",
"description": "List all vector store indexes. Proxy admin only.\n\n```bash\ncurl -L -X GET 'http://0.0.0.0:4000/v1/indexes' -H \"Authorization: Bearer $LITELLM_API_KEY\"\n```",
"operationId": "index_list_v1_indexes_get",
"responses": {
"200": {
@ -44552,7 +44552,7 @@
]
},
"post": {
"description": "Create an index. Just writes the index to the database.\n\n```bash\ncurl -L -X POST 'http://0.0.0.0:4000/v1/indexes' -H 'Content-Type: application/json' -H 'Authorization: Bearer sk-1234' -d '{\n \"index_name\": \"dall-e-3\",\n \"litellm_params\": {\n \"vector_store_index\": \"real-index-name\",\n \"vector_store_name\": \"azure-ai-search\"\n }\n }'\n```",
"description": "Create an index. Just writes the index to the database.\n\n```bash\ncurl -L -X POST 'http://0.0.0.0:4000/v1/indexes' -H 'Content-Type: application/json' -H \"Authorization: Bearer $LITELLM_API_KEY\" -d '{\n \"index_name\": \"dall-e-3\",\n \"litellm_params\": {\n \"vector_store_index\": \"real-index-name\",\n \"vector_store_name\": \"azure-ai-search\"\n }\n }'\n```",
"operationId": "index_create_v1_indexes_post",
"requestBody": {
"content": {

View file

@ -80,4 +80,4 @@ litellm_settings:
drop_params: True
general_settings:
master_key: sk-1234 # REPLACE in production
master_key: os.environ/LITELLM_MASTER_KEY

View file

@ -628,7 +628,7 @@ def route_in_additonal_public_routes(current_route: str):
```yaml
general_settings:
master_key: sk-1234
master_key: os.environ/LITELLM_MASTER_KEY
public_routes: ["LiteLLMRoutes.public_routes", "/spend/calculate", "/api/*"]
```
"""

View file

@ -394,7 +394,7 @@ def _get_bearer_token_or_received_api_key(api_key: str) -> str:
api_key = api_key.replace("bearer ", "")
elif api_key.startswith("AWS4-HMAC-SHA256"):
# Handle AWS Signature V4 format from LangChain
# Format: AWS4-HMAC-SHA256 Credential=Bearer sk-12345/date/region/service/aws4_request, SignedHeaders=..., Signature=...
# Format: AWS4-HMAC-SHA256 Credential=Bearer sk-<your-litellm-api-key>/date/region/service/aws4_request, SignedHeaders=..., Signature=...
# Extract the Bearer token from the Credential field
match = re.search(r"Credential=Bearer\s+([^/\s,]+)", api_key)
if match:
@ -490,7 +490,7 @@ def _get_bearer_token(
api_key = api_key.replace("bearer ", "")
elif api_key.startswith("AWS4-HMAC-SHA256"):
# Handle AWS Signature V4 format from LangChain
# Format: AWS4-HMAC-SHA256 Credential=Bearer sk-12345/date/region/service/aws4_request, SignedHeaders=..., Signature=...
# Format: AWS4-HMAC-SHA256 Credential=Bearer sk-<your-litellm-api-key>/date/region/service/aws4_request, SignedHeaders=..., Signature=...
# Extract the Bearer token from the Credential field
match = re.search(r"Credential=Bearer\s+([^/\s,]+)", api_key)
if match:
@ -1308,7 +1308,7 @@ async def _user_api_key_auth_builder(
route=route,
request=request,
)
# if user wants to pass LiteLLM_Master_Key as a custom header, example pass litellm keys as X-LiteLLM-Key: Bearer sk-1234
# if user wants to pass LiteLLM_Master_Key as a custom header, example pass litellm keys as X-LiteLLM-Key: Bearer sk-<your-litellm-api-key>
custom_litellm_key_header_name: Final = general_settings.get("litellm_key_header_name")
if custom_litellm_key_header_name is not None:
api_key = get_api_key_from_custom_header(

View file

@ -123,7 +123,7 @@ async def create_batch(
Example Curl
```
curl http://localhost:4000/v1/batches \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_file_id": "file-abc123",
@ -417,7 +417,7 @@ async def retrieve_batch(
Example Curl
```
curl http://localhost:4000/v1/batches/batch_abc123 \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
```
@ -710,7 +710,7 @@ async def list_batches(
Example Curl
```
curl http://localhost:4000/v1/batches?limit=2 \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
```
@ -891,7 +891,7 @@ async def cancel_batch(
Example Curl
```
curl http://localhost:4000/v1/batches/batch_abc123/cancel \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-X POST

View file

@ -133,7 +133,7 @@ async def cache_delete(request: Request):
```shell
curl -X POST "http://0.0.0.0:4000/cache/delete" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{"keys": ["key1", "key2"]}'
```
@ -226,7 +226,7 @@ async def cache_flushall():
Usage:
```
curl -X POST http://0.0.0.0:4000/cache/flushall -H "Authorization: Bearer sk-1234"
curl -X POST http://0.0.0.0:4000/cache/flushall -H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
try:

View file

@ -73,7 +73,7 @@ def missing_keys_form(missing_key_names: str):
<h1>Environment Setup Instructions</h1>
<p>Please add the following variables to your environment variables:</p>
<pre>
<span class="env-var">LITELLM_MASTER_KEY="sk-1234"</span> <span class="comment"># Your master key for the proxy server. Can use this to send /chat/completion requests etc</span>
<span class="env-var">LITELLM_MASTER_KEY="sk-<paste-a-long-random-key>"</span> <span class="comment"># Your master key for the proxy server. Can use this to send /chat/completion requests etc</span>
<span class="env-var">LITELLM_SALT_KEY="sk-XXXXXXXX"</span> <span class="comment"># Can NOT CHANGE THIS ONCE SET - It is used to encrypt/decrypt credentials stored in DB. If value of 'LITELLM_SALT_KEY' changes your models cannot be retrieved from DB</span>
<span class="env-var">DATABASE_URL="postgres://..."</span> <span class="comment"># Need a postgres database? (Check out Supabase, Neon, etc)</span>
<span class="comment">## OPTIONAL ##</span>

View file

@ -328,7 +328,7 @@ async def get_memory_summary(
- garbage_collector: GC status and pending object counts
Example usage:
curl http://localhost:4000/debug/memory/summary -H "Authorization: Bearer sk-1234"
curl http://localhost:4000/debug/memory/summary -H "Authorization: Bearer $LITELLM_API_KEY"
For detailed analysis, call GET /debug/memory/details
For cache management, use the cache management endpoints
@ -689,7 +689,7 @@ async def get_memory_details(
- include_process_info: Include process-level memory info using psutil (default: true)
Example usage:
curl "http://localhost:4000/debug/memory/details?top_n=30" -H "Authorization: Bearer sk-1234"
curl "http://localhost:4000/debug/memory/details?top_n=30" -H "Authorization: Bearer $LITELLM_API_KEY"
All memory sizes are reported in both bytes and MB.
"""
@ -751,10 +751,10 @@ async def configure_gc_thresholds_endpoint(
- generation_2: Number of gen-1 collections before gen-2 collection (default: 10)
Example for more aggressive collection:
curl -X POST "http://localhost:4000/debug/memory/gc/configure?generation_0=500" -H "Authorization: Bearer sk-1234"
curl -X POST "http://localhost:4000/debug/memory/gc/configure?generation_0=500" -H "Authorization: Bearer $LITELLM_API_KEY"
Example for less aggressive collection:
curl -X POST "http://localhost:4000/debug/memory/gc/configure?generation_0=1000" -H "Authorization: Bearer sk-1234"
curl -X POST "http://localhost:4000/debug/memory/gc/configure?generation_0=1000" -H "Authorization: Bearer $LITELLM_API_KEY"
Monitor memory usage with GET /debug/memory/summary after changes.
"""

View file

@ -52,7 +52,7 @@ async def create_container(
Example:
```bash
curl -X POST "http://localhost:4000/v1/containers" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Container",
@ -66,7 +66,7 @@ async def create_container(
Or specify provider via header:
```bash
curl -X POST "http://localhost:4000/v1/containers" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "custom-llm-provider: azure" \
-H "Content-Type: application/json" \
-d '{
@ -187,13 +187,13 @@ async def list_containers(
Example:
```bash
curl -X GET "http://localhost:4000/v1/containers?limit=20&order=desc" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Or specify provider via header or query param:
```bash
curl -X GET "http://localhost:4000/v1/containers?custom_llm_provider=azure" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import (
@ -290,13 +290,13 @@ async def retrieve_container(
Example:
```bash
curl -X GET "http://localhost:4000/v1/containers/cntr_123" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Or specify provider via header:
```bash
curl -X GET "http://localhost:4000/v1/containers/cntr_123" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "custom-llm-provider: azure"
```
"""
@ -395,13 +395,13 @@ async def delete_container(
Example:
```bash
curl -X DELETE "http://localhost:4000/v1/containers/cntr_123" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Or specify provider via header:
```bash
curl -X DELETE "http://localhost:4000/v1/containers/cntr_123" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "custom-llm-provider: azure"
```
"""

View file

@ -198,7 +198,7 @@ model_list:
api_key: os.environ/OPENAI_API_KEY
general_settings:
master_key: sk-1234
master_key: os.environ/LITELLM_MASTER_KEY
# Opt-in: let CheckBatchCost track cost for unmanaged batches created with a raw
# gs:// (Vertex) or s3:// (Bedrock) input_file_id. Requires a matching deployment
# configured for the batched model. Defaults to false.

View file

@ -49,4 +49,4 @@ litellm_settings:
drop_params: True
general_settings:
master_key: sk-1234 # REPLACE in production
master_key: os.environ/LITELLM_MASTER_KEY

View file

@ -72,4 +72,4 @@ files_settings:
api_key: os.environ/OPENAI_API_KEY
general_settings:
master_key: sk-1234 # [OPTIONAL] Use to enforce auth on proxy. See - https://docs.litellm.ai/docs/proxy/virtual_keys
master_key: os.environ/LITELLM_MASTER_KEY # [OPTIONAL] Use to enforce auth on proxy. See - https://docs.litellm.ai/docs/proxy/virtual_keys

View file

@ -29,7 +29,7 @@ model_list:
model: openai/*
api_key: os.environ/OPENAI_API_KEY
general_settings:
master_key: sk-1234
master_key: os.environ/LITELLM_MASTER_KEY
custom_auth: custom_auth_basic.user_api_key_auth
pass_through_endpoints:
- path: "/azure-config-passthrough"

View file

@ -5,7 +5,7 @@ model_list:
api_key: os.environ/OPENAI_API_KEY
general_settings:
master_key: sk-1234
master_key: os.environ/LITELLM_MASTER_KEY
database_url: "postgresql://user:password@localhost:5432/litellm"
# Reject requests that contain client-side metadata.tags

View file

@ -29,7 +29,7 @@ guardrails:
# Optional: Configure general settings
general_settings:
master_key: sk-1234
master_key: os.environ/LITELLM_MASTER_KEY
# Optional: Add logging configuration
litellm_settings:

View file

@ -87,7 +87,7 @@ async def create_fine_tuning_job(
```
curl http://localhost:4000/v1/fine_tuning/jobs \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"training_file": "file-abc123",

View file

@ -246,7 +246,7 @@ async def create_interaction(
Example:
```bash
curl -X POST "http://localhost:4000/v1beta/interactions" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini/gemini-2.5-flash",

View file

@ -25,7 +25,7 @@ litellm_settings:
# 1. Apply guardrail to a specific request:
# curl --location 'http://localhost:4000/chat/completions' \
# --header 'Authorization: Bearer sk-1234' \
# --header "Authorization: Bearer $LITELLM_API_KEY" \
# --header 'Content-Type: application/json' \
# --data '{
# "model": "gpt-4",
@ -35,7 +35,7 @@ litellm_settings:
# 2. Apply guardrail with dynamic parameters:
# curl --location 'http://localhost:4000/chat/completions' \
# --header 'Authorization: Bearer sk-1234' \
# --header "Authorization: Bearer $LITELLM_API_KEY" \
# --header 'Content-Type: application/json' \
# --data '{
# "model": "gpt-4",

View file

@ -271,7 +271,7 @@ async def health_services_endpoint(
Example:
```
curl -L -X GET 'http://0.0.0.0:4000/health/services?service=datadog' \
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
try:
@ -2038,7 +2038,7 @@ async def test_model_connection(
```bash
# If model is configured in proxy_config.yaml, you only need to specify the model name:
curl -X POST 'http://localhost:4000/health/test_connection' \\
-H 'Authorization: Bearer sk-1234' \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-H 'Content-Type: application/json' \\
-d '{
"litellm_params": {
@ -2051,7 +2051,7 @@ async def test_model_connection(
# You can also override specific params or test with custom credentials:
curl -X POST 'http://localhost:4000/health/test_connection' \\
-H 'Authorization: Bearer sk-1234' \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-H 'Content-Type: application/json' \\
-d '{
"litellm_params": {

View file

@ -260,7 +260,7 @@ class KeyManagementEventHooks:
Args:
secret_name: Name of the virtual key
secret_token: Value of the virtual key (example: sk-1234)
secret_token: Value of the virtual key (example: sk-<virtual-key>)
"""
if litellm._key_management_settings is not None:
if litellm._key_management_settings.store_virtual_keys is True:
@ -298,7 +298,7 @@ class KeyManagementEventHooks:
Args:
current_secret_name: Current name of the virtual key
new_secret_name: New name of the virtual key
new_secret_value: New value of the virtual key (example: sk-1234)
new_secret_value: New value of the virtual key (example: sk-<virtual-key>)
team_id: Optional team ID to get team-specific secret manager settings
"""
if litellm._key_management_settings is not None:

View file

@ -262,7 +262,7 @@ class _PROXY_VirtualKeyModelMaxBudgetLimiter(RouterBudgetLimiting):
"""
Handles budgets for model + virtual key
Example: key=sk-1234567890, model=gpt-4o, max_budget=100, time_period=1d
Example: key=sk-<virtual-key>, model=gpt-4o, max_budget=100, time_period=1d
"""
def __init__(self, dual_cache: DualCache):
@ -431,7 +431,7 @@ class _PROXY_VirtualKeyModelMaxBudgetLimiter(RouterBudgetLimiting):
"""
Track spend for virtual key + model in DualCache
Example: key=sk-1234567890, model=gpt-4o, max_budget=100, time_period=1d
Example: key=sk-<virtual-key>, model=gpt-4o, max_budget=100, time_period=1d
"""
verbose_proxy_logger.debug("in RouterBudgetLimiting.async_log_success_event")
standard_logging_payload: Final[StandardLoggingPayload | None] = kwargs.get("standard_logging_object", None)

View file

@ -253,7 +253,7 @@ async def image_edit_api(
curl -s -D >(grep -i x-request-id >&2) \
-o >(jq -r '.data[0].b64_json' | base64 --decode > gift-basket.png) \
-X POST "http://localhost:4000/v1/images/edits" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-F "model=gpt-image-1" \
-F "image[]=@soap.png" \
-F 'prompt=Create a studio ghibli image of this'

View file

@ -155,7 +155,7 @@ async def block_user(data: BlockUsers):
```
curl -X POST "http://0.0.0.0:8000/user/block"
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
-d '{
"user_ids": [<user_id>, ...]
}'
@ -207,7 +207,7 @@ async def unblock_user(data: BlockUsers):
Example
```
curl -X POST "http://0.0.0.0:8000/user/unblock"
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
-d '{
"user_ids": [<user_id>, ...]
}'
@ -358,7 +358,7 @@ async def new_end_user(
Example curl:
```
curl --location 'http://0.0.0.0:4000/customer/new' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"user_id" : "ishaan-jaff-3",
@ -369,7 +369,7 @@ async def new_end_user(
# With object permissions
curl -L -X POST 'http://localhost:4000/customer/new' \
-H 'Authorization: Bearer sk-1234' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"user_id": "user_1",
@ -513,7 +513,7 @@ async def end_user_info(
Example curl:
```
curl -X GET 'http://localhost:4000/customer/info?end_user_id=test-litellm-user-4' \
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
try:
@ -592,7 +592,7 @@ async def update_end_user(
Example curl:
```
curl --location 'http://0.0.0.0:4000/customer/update' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"user_id": "test-litellm-user-4",
@ -601,7 +601,7 @@ async def update_end_user(
# Updating object permissions
curl -L -X POST 'http://localhost:4000/customer/update' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"user_id": "user_1",
@ -751,7 +751,7 @@ async def delete_end_user(
Example curl:
```
curl --location 'http://0.0.0.0:4000/customer/delete' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"user_ids" :["ishaan-jaff-5"]
@ -826,7 +826,7 @@ async def list_end_user(
Example curl:
```
curl --location --request GET 'http://0.0.0.0:4000/customer/list' \
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
"""

View file

@ -506,7 +506,7 @@ async def new_user(
```shell
curl -X POST "http://localhost:4000/user/new" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"username": "new_user",
"email": "new_user@example.com"
@ -912,7 +912,7 @@ async def user_info(
Example request
```
curl -X GET 'http://localhost:4000/user/info?user_id=krrish7%40berri.ai' \
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import model_max_budget_limiter, prisma_client
@ -1065,7 +1065,7 @@ async def user_info_v2(
Example request:
```
curl -X GET 'http://localhost:4000/v2/user/info?user_id=user123' \\
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import model_max_budget_limiter, prisma_client
@ -1618,7 +1618,7 @@ async def user_update(
```
curl --location 'http://0.0.0.0:4000/user/update' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"user_id": "test-litellm-user-4",
@ -1788,7 +1788,7 @@ async def bulk_user_update(
Example request for specific users:
```bash
curl --location 'http://0.0.0.0:4000/user/bulk_update' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"users": [
@ -1809,7 +1809,7 @@ async def bulk_user_update(
Example request for all users:
```bash
curl --location 'http://0.0.0.0:4000/user/bulk_update' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"all_users": true,
@ -2322,7 +2322,7 @@ async def delete_user(
```
curl --location 'http://0.0.0.0:4000/user/delete' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \

View file

@ -1807,7 +1807,7 @@ async def generate_key_fn(
```bash
curl --location 'http://0.0.0.0:4000/key/generate' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"permissions": {"allow_pii_controls": true}
@ -2003,7 +2003,7 @@ async def generate_service_account_key_fn(
```bash
curl --location 'http://0.0.0.0:4000/key/generate' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"permissions": {"allow_pii_controls": true}
@ -3015,10 +3015,10 @@ async def update_key_fn(
Example:
```bash
curl --location 'http://0.0.0.0:4000/key/update' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"key": "sk-1234",
"key": "sk-<virtual-key>",
"key_alias": "my-key",
"user_id": "user-1234",
"team_id": "team-1234",
@ -3224,12 +3224,12 @@ async def bulk_update_keys(
Example request:
```bash
curl --location 'http://0.0.0.0:4000/key/bulk_update' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"keys": [
{
"key": "sk-1234",
"key": "sk-<virtual-key>",
"max_budget": 100.0,
"team_id": "team-123",
"tags": ["production", "api"]
@ -3662,7 +3662,7 @@ async def delete_key_fn(
Example:
```bash
curl --location 'http://0.0.0.0:4000/key/delete' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"keys": ["sk-QWrxEynunsNpV1zT48HIrw"]
@ -3841,7 +3841,7 @@ async def info_key_fn_v2(
Example Curl:
```
curl -X GET "http://0.0.0.0:4000/key/info" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d {"keys": ["sk-1", "sk-2", "sk-3"]}
```
"""
@ -3967,7 +3967,7 @@ async def info_key_fn(
Example Curl:
```
curl -X GET "http://0.0.0.0:4000/key/info?key=d5345c0ecc68ae6295c69f91926b2bd379e25481a40c34b5884d157a9f65d8fa" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Example Curl - if no key is passed, it will use the Key Passed in Authorization Header
@ -5242,8 +5242,8 @@ async def regenerate_key_fn(
Example:
```bash
curl --location --request POST 'http://localhost:4000/key/sk-1234/regenerate' \
--header 'Authorization: Bearer sk-1234' \
curl --location --request POST 'http://localhost:4000/key/sk-<virtual-key>/regenerate' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"max_budget": 100,
@ -6739,7 +6739,7 @@ async def block_key(
Example:
```bash
curl --location 'http://0.0.0.0:4000/key/block' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"key": "sk-Fn8Ej39NxjAXrvpUGKghGw"
@ -6853,7 +6853,7 @@ async def unblock_key(
Example:
```bash
curl --location 'http://0.0.0.0:4000/key/unblock' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"key": "sk-Fn8Ej39NxjAXrvpUGKghGw"
@ -6970,7 +6970,7 @@ async def key_health(
```bash
curl -X POST "http://localhost:4000/key/health" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json"
```

View file

@ -164,7 +164,7 @@ async def list_budgets(
Example curl:
```
curl --location --globoff 'http://0.0.0.0:4000/management/v1/budgets?sort=-max_budget&filter[budget_duration][in]=7d,30d&page_size=25' \
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
"""
try:

View file

@ -205,7 +205,7 @@ async def list_spend_log_end_users(
Example curl:
```
curl --location --globoff 'http://0.0.0.0:4000/management/v1/spend_logs/end_users?filter[startTime][gte]=2026-07-23T00:00:00Z&filter[startTime][lte]=2026-07-24T00:00:00Z&page_size=50&q=acme' \
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
"""
return await _list_spend_log_facet(

View file

@ -589,7 +589,7 @@ async def create_model_group(
Example:
```bash
curl -X POST 'http://localhost:4000/access_group/new' \\
-H 'Authorization: Bearer sk-1234' \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-H 'Content-Type: application/json' \\
-d '{
"access_group": "production-models",
@ -734,7 +734,7 @@ async def list_access_groups(
Example:
```bash
curl -X GET 'http://localhost:4000/access_group/list' \\
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Returns:
@ -782,7 +782,7 @@ async def get_access_group_info(
Example:
```bash
curl -X GET 'http://localhost:4000/access_group/production-models/info' \\
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Parameters:
@ -846,7 +846,7 @@ async def update_access_group(
Example:
```bash
curl -X PUT 'http://localhost:4000/access_group/production-models/update' \\
-H 'Authorization: Bearer sk-1234' \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-H 'Content-Type: application/json' \\
-d '{
"model_names": ["gpt-4", "claude-3-sonnet"]
@ -998,7 +998,7 @@ async def delete_access_group(
Example:
```bash
curl -X DELETE 'http://localhost:4000/access_group/production-models/delete' \\
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Parameters:
@ -1104,7 +1104,7 @@ async def get_access_group_budget(
Example:
```bash
curl -X GET 'http://localhost:4000/access_group/production-models/budget' \\
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Parameters:
@ -1144,7 +1144,7 @@ async def set_access_group_budget(
Example:
```bash
curl -X PUT 'http://localhost:4000/access_group/production-models/budget' \\
-H 'Authorization: Bearer sk-1234' \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-H 'Content-Type: application/json' \\
-d '{
"max_budget": 100.0,
@ -1218,7 +1218,7 @@ async def delete_access_group_budget(
Example:
```bash
curl -X DELETE 'http://localhost:4000/access_group/production-models/budget' \\
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Parameters:

View file

@ -380,7 +380,7 @@ async def new_organization(
```bash
curl --location 'http://0.0.0.0:4000/organization/new' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
@ -398,7 +398,7 @@ async def new_organization(
```bash
curl --location 'http://0.0.0.0:4000/organization/new' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
@ -1025,13 +1025,13 @@ async def list_organization(
Example:
```
curl --location --request GET 'http://0.0.0.0:4000/organization/list?org_alias=my-org' \
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
Example with org_id:
```
curl --location --request GET 'http://0.0.0.0:4000/organization/list?org_id=123e4567-e89b-12d3-a456-426614174000' \
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import prisma_client
@ -1225,7 +1225,7 @@ async def organization_member_add(
Example:
```
curl -X POST 'http://0.0.0.0:4000/organization/member_add' \
-H 'Authorization: Bearer sk-1234' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"organization_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849",

View file

@ -295,7 +295,7 @@ async def add_team_callbacks(
```
curl -X POST 'http:/localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/callback' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-1234' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"callback_name": "langfuse",
"callback_type": "success",
@ -467,7 +467,7 @@ async def delete_team_callback(
Example curl:
```
curl -X DELETE 'http://localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/callback/langsmith' \
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Covers callbacks registered through POST /team/{team_id}/callback and the Admin UI. Teams still
@ -603,7 +603,7 @@ async def disable_team_logging(
Example curl:
```
curl -X POST 'http://localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/disable_logging' \
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
@ -735,7 +735,7 @@ async def get_team_callbacks(
Example curl:
```
curl -X GET 'http://localhost:4000/team/dbe2f686-a686-4896-864a-4c3924458709/callback' \
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
This will return the callback settings for the team with id dbe2f686-a686-4896-864a-4c3924458709

View file

@ -1256,7 +1256,7 @@ async def new_team(
Example Request:
```
curl --location 'http://0.0.0.0:4000/team/new' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"team_alias": "my-new-team_2",
@ -1268,7 +1268,7 @@ async def new_team(
```
curl --location 'http://0.0.0.0:4000/team/new' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"team_alias": "QA Prod Bot",
@ -1962,7 +1962,7 @@ async def update_team(
```
curl --location 'http://0.0.0.0:4000/team/update' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"team_id": "8d916b1c-510d-4894-a334-1c16a93344f5",
@ -1973,7 +1973,7 @@ async def update_team(
Example - Update Team `max_budget` budget
```
curl --location 'http://0.0.0.0:4000/team/update' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"team_id": "8d916b1c-510d-4894-a334-1c16a93344f5",
@ -2357,7 +2357,7 @@ async def patch_team(
```
curl --location --request PATCH 'http://0.0.0.0:4000/team/8d916b1c-510d-4894-a334-1c16a93344f5' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"metadata": {"cost_center": "1234", "deprecated_key": null}
@ -3091,7 +3091,7 @@ async def team_member_add(
```
curl -X POST 'http://0.0.0.0:4000/team/member_add' \
-H 'Authorization: Bearer sk-1234' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"team_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849", "member": {"role": "user", "user_id": "krrish247652@berri.ai"}}'
@ -3254,7 +3254,7 @@ async def team_member_delete(
```
curl -X POST 'http://0.0.0.0:8000/team/member_delete' \
-H 'Authorization: Bearer sk-1234' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H 'Content-Type: application/json' \
@ -3776,7 +3776,7 @@ async def bulk_team_member_add(
Example request:
```bash
curl --location 'http://0.0.0.0:4000/team/bulk_member_add' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"team_id": "team-1234",
@ -3909,7 +3909,7 @@ async def delete_team(
```
curl --location 'http://0.0.0.0:4000/team/delete' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"team_ids": ["8d916b1c-510d-4894-a334-1c16a93344f5"]
@ -4630,7 +4630,7 @@ async def block_team(
Example:
```
curl --location 'http://0.0.0.0:4000/team/block' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"team_id": "team-1234"
@ -4685,7 +4685,7 @@ async def unblock_team(
Example:
```
curl --location 'http://0.0.0.0:4000/team/unblock' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"team_id": "team-1234"
@ -5324,7 +5324,7 @@ async def list_team(
"""
```
curl --location --request GET 'http://0.0.0.0:4000/team/list' \
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
Parameters:
@ -5528,7 +5528,7 @@ async def team_model_add(
Example Request:
```
curl --location 'http://0.0.0.0:4000/team/model/add' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"team_id": "team-1234",
@ -5633,7 +5633,7 @@ async def team_model_delete(
Example Request:
```
curl --location 'http://0.0.0.0:4000/team/model/delete' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"team_id": "team-1234",

View file

@ -274,7 +274,7 @@ async def ocr(
**1. JSON body** (Mistral OCR API compatible):
```bash
curl -X POST "http://localhost:4000/v1/ocr" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral-ocr",
@ -288,7 +288,7 @@ async def ocr(
**2. Multipart form file upload**:
```bash
curl -X POST "http://localhost:4000/v1/ocr" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-F "model=mistral-ocr" \
-F "file=@document.pdf"
```

View file

@ -389,7 +389,7 @@ async def create_file(
Example Curl
```
curl http://localhost:4000/v1/files \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-F purpose="batch" \
-F file="@mydata.jsonl"
-F expires_after[anchor]="created_at" \
@ -766,7 +766,7 @@ async def get_file_content(
Example Curl
```
curl http://localhost:4000/v1/files/file-abc123/content \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
@ -1071,7 +1071,7 @@ async def get_file(
Example Curl
```
curl http://localhost:4000/v1/files/file-abc123 \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
@ -1480,7 +1480,7 @@ async def list_files(
Example Curl
```
curl http://localhost:4000/v1/files\
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""

View file

@ -49,7 +49,7 @@ mcp_servers:
# General Settings
general_settings:
master_key: sk-1234
master_key: os.environ/LITELLM_MASTER_KEY
store_model_in_db: false
# LiteLLM Settings

View file

@ -10981,7 +10981,7 @@ async def chat_completion(
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "gpt-4o",
@ -11145,7 +11145,7 @@ async def completion(
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "gpt-3.5-turbo-instruct",
@ -11325,7 +11325,7 @@ async def embeddings(
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "text-embedding-ada-002",
@ -11433,7 +11433,7 @@ async def moderations(
```
curl --location 'http://0.0.0.0:4000/moderations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sk-1234' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--data '{"input": "Sample text goes here", "model": "text-moderation-stable"}'
```
"""
@ -13083,7 +13083,7 @@ async def supported_openai_params(model: str):
Example curl:
```
curl -X GET --location 'http://localhost:4000/utils/supported_openai_params?model=gpt-3.5-turbo-16k' \
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.litellm_core_utils.get_llm_provider_logic import declared_authenticating_provider
@ -14321,7 +14321,7 @@ async def model_info_v2(
Example request:
```
curl -X GET 'http://localhost:4000/v2/model/info?include_team_models=true&page=1&size=50' \\
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
```
Example response:
@ -15289,7 +15289,7 @@ async def model_deprecations(
Example:
```shell
curl -X GET 'http://localhost:4000/model/deprecations' \\
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
return collect_model_deprecations(llm_router=llm_router, warn_within_days=warn_within_days)
@ -15351,7 +15351,7 @@ async def model_group_info(
curl -X 'GET' \
'http://localhost:4000/model_group/info' \
-H 'accept: application/json' \
-H 'x-api-key: sk-1234'
-H "x-api-key: $LITELLM_API_KEY"
```
Example Request (Specific Model Group):
@ -15359,7 +15359,7 @@ async def model_group_info(
curl -X 'GET' \
'http://localhost:4000/model_group/info?model_group=rerank-english-v3.0' \
-H 'accept: application/json' \
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Example Request (Specific Wildcard Model Group): (e.g. `model_name: openai/*` on config.yaml)
@ -15367,7 +15367,7 @@ async def model_group_info(
curl -X 'GET' \
'http://localhost:4000/model_group/info?model_group=openai/tts-1'
-H 'accept: application/json' \
-H 'Authorization: Bearersk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Learn how to use and set wildcard models [here](https://docs.litellm.ai/docs/wildcard_routing)

View file

@ -489,7 +489,7 @@ async def rag_ingest(
## Form upload (for files):
```bash
curl -X POST "http://localhost:4000/v1/rag/ingest" \\
-H "Authorization: Bearer sk-1234" \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-F file="@document.pdf" \\
-F 'ingest_options={"vector_store": {"custom_llm_provider": "openai"}}'
```
@ -497,7 +497,7 @@ async def rag_ingest(
## JSON body (for URLs):
```bash
curl -X POST "http://localhost:4000/v1/rag/ingest" \\
-H "Authorization: Bearer sk-1234" \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"file_url": "https://example.com/document.pdf",
@ -508,7 +508,7 @@ async def rag_ingest(
## Bedrock:
```bash
curl -X POST "http://localhost:4000/v1/rag/ingest" \\
-H "Authorization: Bearer sk-1234" \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-F file="@document.pdf" \\
-F 'ingest_options={"vector_store": {"custom_llm_provider": "bedrock"}}'
```
@ -641,7 +641,7 @@ async def rag_query(
## Example Request:
```bash
curl -X POST "http://localhost:4000/v1/rag/query" \\
-H "Authorization: Bearer sk-1234" \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"model": "gpt-4o-mini",
@ -657,7 +657,7 @@ async def rag_query(
## With Reranking:
```bash
curl -X POST "http://localhost:4000/v1/rag/query" \\
-H "Authorization: Bearer sk-1234" \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"model": "gpt-4o-mini",

View file

@ -207,7 +207,7 @@ async def responses_api(
# Normal request
curl -X POST http://localhost:4000/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "gpt-4o",
"input": "Tell me about AI"
@ -216,7 +216,7 @@ async def responses_api(
# Background request with polling
curl -X POST http://localhost:4000/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "gpt-4o",
"input": "Tell me about AI",
@ -498,7 +498,7 @@ async def cursor_chat_completions(
```bash
curl -X POST http://localhost:4000/cursor/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "gpt-4o",
"input": [{"role": "user", "content": "Hello"}]
@ -690,11 +690,11 @@ async def get_response(
```bash
# Get polling response
curl -X GET http://localhost:4000/v1/responses/litellm_poll_abc123 \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
# Get provider response
curl -X GET http://localhost:4000/v1/responses/resp_abc123 \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import (
@ -802,7 +802,7 @@ async def delete_response(
```bash
curl -X DELETE http://localhost:4000/v1/responses/resp_abc123 \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import (
@ -974,7 +974,7 @@ async def compact_response(
```bash
curl -X POST http://localhost:4000/v1/responses/compact \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "gpt-4o",
"input": [{"role": "user", "content": "Hello"}]
@ -1126,7 +1126,7 @@ async def responses_input_tokens(
```bash
curl -X POST http://localhost:4000/v1/responses/input_tokens \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "gpt-4o",
"input": "Hello, how are you?"
@ -1205,11 +1205,11 @@ async def cancel_response(
```bash
# Cancel polling response
curl -X POST http://localhost:4000/v1/responses/litellm_poll_abc123/cancel \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
# Cancel provider response
curl -X POST http://localhost:4000/v1/responses/resp_abc123/cancel \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import (

View file

@ -57,7 +57,7 @@ async def search(
Example with search_tool_name in URL (recommended - keeps body Perplexity-compatible):
```bash
curl -X POST "http://localhost:4000/v1/search/litellm-search" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "latest AI developments 2024",
@ -70,7 +70,7 @@ async def search(
Example with search_tool_name in body:
```bash
curl -X POST "http://localhost:4000/v1/search" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"search_tool_name": "litellm-search",
@ -264,7 +264,7 @@ async def list_search_tools(
Example:
```bash
curl -X GET "http://localhost:4000/v1/search/tools" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Response:

View file

@ -375,7 +375,7 @@ async def spend_key_fn(
Example Request:
```
curl -X GET "http://0.0.0.0:8000/spend/keys" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
@ -443,13 +443,13 @@ async def spend_user_fn(
Example Request:
```
curl -X GET "http://0.0.0.0:8000/spend/users" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
View User Table row for user_id
```
curl -X GET "http://0.0.0.0:8000/spend/users?user_id=1234" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import prisma_client
@ -514,13 +514,13 @@ async def view_spend_tags(
Example Request:
```
curl -X GET "http://0.0.0.0:8000/spend/tags" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Spend with Start Date and End Date
```
curl -X GET "http://0.0.0.0:8000/spend/tags?start_date=2022-01-01&end_date=2022-02-01" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
@ -2018,13 +2018,13 @@ async def global_view_spend_tags(
Example Request:
```
curl -X GET "http://0.0.0.0:4000/spend/tags" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Spend with Start Date and End Date
```
curl -X GET "http://0.0.0.0:4000/spend/tags?start_date=2022-01-01&end_date=2022-02-01" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
import traceback
@ -2168,7 +2168,7 @@ async def calculate_spend(request: SpendCalculateRequest):
```
curl --location 'http://localhost:4000/spend/calculate'
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
--header 'Content-Type: application/json'
--data '{
"model": "anthropic.claude-v2",
@ -2180,7 +2180,7 @@ async def calculate_spend(request: SpendCalculateRequest):
```
curl --location 'http://localhost:4000/spend/calculate'
--header 'Authorization: Bearer sk-1234'
--header "Authorization: Bearer $LITELLM_API_KEY"
--header 'Content-Type: application/json'
--data '{
"completion_response": {
@ -2433,7 +2433,7 @@ async def ui_view_spend_logs(
Example:
```
curl -X GET "http://0.0.0.0:8000/spend/logs/v2?start_date=2025-11-25%2000:00:00&end_date=2025-11-26%2023:59:59&page=1&page_size=50" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import prisma_client
@ -3319,31 +3319,31 @@ async def view_spend_logs(
Example Request for all logs
```
curl -X GET "http://0.0.0.0:8000/spend/logs" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Example Request for specific request_id
```
curl -X GET "http://0.0.0.0:8000/spend/logs?request_id=chatcmpl-6dcb2540-d3d7-4e49-bb27-291f863f112e" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Example Request for specific api_key
```
curl -X GET "http://0.0.0.0:8000/spend/logs?api_key=d5345c0ecc68ae6295c69f91926b2bd379e25481a40c34b5884d157a9f65d8fa" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Example Request for specific user_id
```
curl -X GET "http://0.0.0.0:8000/spend/logs?user_id=ishaan@berri.ai" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Example Request for date range with individual logs (unsummarized)
```
curl -X GET "http://0.0.0.0:8000/spend/logs?start_date=2024-01-01&end_date=2024-01-02&summarize=false" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import prisma_client
@ -4119,7 +4119,7 @@ async def provider_budgets() -> ProviderBudgetResponse:
```bash
curl -X GET http://localhost:4000/provider/budgets \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
Example Response

View file

@ -561,7 +561,7 @@ async def index_create(
```bash
curl -L -X POST 'http://0.0.0.0:4000/v1/indexes' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-1234' \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"index_name": "dall-e-3",
"litellm_params": {
@ -622,7 +622,7 @@ async def index_list(
```bash
curl -L -X GET 'http://0.0.0.0:4000/v1/indexes' \
-H 'Authorization: Bearer sk-1234'
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import prisma_client

View file

@ -57,7 +57,7 @@ async def video_generation(
Example:
```bash
curl -X POST "http://localhost:4000/v1/videos" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sora-2",
@ -142,7 +142,7 @@ async def video_list(
Example:
```bash
curl -X GET "http://localhost:4000/v1/videos" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import (
@ -228,7 +228,7 @@ async def video_status(
Example:
```bash
curl -X GET "http://localhost:4000/v1/videos/video_123" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import (
@ -326,7 +326,7 @@ async def video_content(
Example:
```bash
curl -X GET "http://localhost:4000/v1/videos/{video_id}/content" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
--output video.mp4
```
"""
@ -431,7 +431,7 @@ async def video_remix(
Example:
```bash
curl -X POST "http://localhost:4000/v1/videos/video_123/remix" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A new version with different colors"
@ -533,7 +533,7 @@ async def video_create_character(
Example:
```bash
curl -X POST "http://localhost:4000/v1/videos/characters" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-F "video=@character_video.mp4" \
-F "name=my_character"
```
@ -635,7 +635,7 @@ async def video_get_character(
Example:
```bash
curl -X GET "http://localhost:4000/v1/videos/characters/char_123" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
"""
from litellm.proxy.proxy_server import (
@ -740,7 +740,7 @@ async def video_edit(
Example:
```bash
curl -X POST "http://localhost:4000/v1/videos/edits" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Make it brighter", "video": {"id": "video_123"}}'
```
@ -842,7 +842,7 @@ async def video_extension(
Example:
```bash
curl -X POST "http://localhost:4000/v1/videos/extensions" \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Continue the scene", "seconds": "5", "video": {"id": "video_123"}}'
```

View file

@ -45,7 +45,7 @@ model_list:
api_key: os.environ/OPENAI_API_KEY
general_settings:
master_key: sk-1234
master_key: os.environ/LITELLM_MASTER_KEY
litellm_settings:
drop_params: True

View file

@ -48,7 +48,7 @@ GET /v1/workflows/runs/{run_id}/messages Conversation history (ordered by se
```bash
# Create a run
curl -X POST http://localhost:4000/v1/workflows/runs \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"workflow_type": "shin-builder", "metadata": {"title": "Fix login bug"}}'
@ -56,19 +56,19 @@ curl -X POST http://localhost:4000/v1/workflows/runs \
# Mark step started (sets status → running)
curl -X POST http://localhost:4000/v1/workflows/runs/abc-123/events \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"event_type": "step.started", "step_name": "grill", "data": {"claude_session_id": "sess-789"}}'
# Store a conversation message
curl -X POST http://localhost:4000/v1/workflows/runs/abc-123/messages \
-H "Authorization: Bearer sk-1234" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"role": "user", "content": "What is the expected behavior?", "session_id": "sess-789"}'
# Restart recovery: fetch active runs and resume from last event's data.claude_session_id
curl "http://localhost:4000/v1/workflows/runs?status=running,paused&workflow_type=shin-builder" \
-H "Authorization: Bearer sk-1234"
-H "Authorization: Bearer $LITELLM_API_KEY"
```
## Status Auto-Update Rules

View file

@ -221,7 +221,7 @@ router_settings:
model_group_alias: {"my-special-fake-model-alias-name": "fake-openai-endpoint-3"}
general_settings:
master_key: sk-1234 # [OPTIONAL] Use to enforce auth on proxy. See - https://docs.litellm.ai/docs/proxy/virtual_keys
master_key: os.environ/LITELLM_MASTER_KEY # [OPTIONAL] Use to enforce auth on proxy. See - https://docs.litellm.ai/docs/proxy/virtual_keys
store_model_in_db: True
proxy_budget_rescheduler_min_time: 60
proxy_budget_rescheduler_max_time: 64

View file

@ -1,14 +1,14 @@
#!/usr/bin/env bash
# QA: code interpreter sandbox stickiness via metadata.session_id
# bash qa_sticky_session.sh
# LITELLM_BASE_URL=http://localhost:4000 LITELLM_KEY=sk-1234 bash qa_sticky_session.sh
# LITELLM_BASE_URL=http://localhost:4000 LITELLM_KEY=sk-<your-litellm-api-key> bash qa_sticky_session.sh
set -euo pipefail
BASE="${LITELLM_BASE_URL:-http://localhost:4000}"
KEY="${LITELLM_KEY:-sk-1234}"
KEY="${LITELLM_KEY:-sk-<your-litellm-api-key>}"
MODEL="${LITELLM_MODEL:-gpt-4o-mini}"
# proxy running at http://localhost:4000 (master key: sk-1234)
# proxy running at http://localhost:4000 (master key: sk-<your-litellm-master-key>)
SESSION_A="qa-session-$(date +%s)-A"
SESSION_B="qa-session-$(date +%s)-B"

View file

@ -83,7 +83,7 @@ The dashboard is a single static HTML file. Either:
In the connect bar, fill in:
- **Proxy URL:** `http://localhost:4000`
- **Master Key:** the `master_key` from your config (`sk-1234` in the example).
- **Master Key:** the `master_key` from your config (`sk-<your-litellm-master-key>` in the example).
Click **Connect**. The dashboard polls `GET /adaptive_router/state` every
500ms (admin-only endpoint, returns one snapshot per configured router).
@ -95,7 +95,7 @@ In a second terminal:
```bash
uv run python scripts/adaptive_router_demo/traffic.py \
--proxy-url http://localhost:4000 \
--api-key sk-1234 \
--api-key sk-<your-litellm-api-key> \
--router smart-cheap-router \
--rounds 100 \
--rate 0.5

View file

@ -366,7 +366,7 @@
<div class="connect">
<label>Proxy URL <input id="proxy-url" type="text" value="http://localhost:4000" /></label>
<label>API Key <input id="api-key" type="password" placeholder="sk-1234" /></label>
<label>API Key <input id="api-key" type="password" placeholder="sk-<your-litellm-api-key>" /></label>
<label>Router
<input id="router" type="text" value="smart-cheap-router" style="width:160px" />
</label>

View file

@ -255,7 +255,7 @@
<div class="connect">
<label>Proxy URL <input id="proxy-url" type="text" value="http://localhost:4000" /></label>
<label>Master Key <input id="api-key" type="password" placeholder="sk-1234" /></label>
<label>Master Key <input id="api-key" type="password" placeholder="sk-<your-litellm-master-key>" /></label>
<label>Avg tokens/req <input id="avg-tokens" type="number" value="500" min="1" /></label>
<label>Poll ms <input id="poll-ms" type="number" value="500" min="100" /></label>
<button id="connect-btn">Connect</button>

View file

@ -11,7 +11,7 @@ For each test case:
Run:
uv run python scripts/adaptive_router_demo/eval.py \
--proxy-url http://localhost:4000 \
--api-key sk-1234 \
--api-key sk-<your-litellm-api-key> \
--router smart-cheap-router \
--judge-model smart
"""

View file

@ -23,7 +23,7 @@ Why this shape:
Run:
uv run python scripts/adaptive_router_demo/traffic.py \\
--proxy-url http://localhost:4000 \\
--api-key sk-1234 \\
--api-key sk-<your-litellm-api-key> \\
--router smart-cheap-router \\
--rounds 100 \\
--rate 0.5

View file

@ -41,7 +41,7 @@ import aiohttp
from aiohttp import web
DEFAULT_MODEL = "claude-perf-test"
DEFAULT_API_KEY = "sk-1234"
DEFAULT_API_KEY = "sk-<your-litellm-api-key>"
@dataclass

View file

@ -36,7 +36,7 @@ from aiohttp import web
DEFAULT_MODEL = "perf-test-model"
DEFAULT_API_KEY = "sk-1234"
DEFAULT_API_KEY = "sk-<your-litellm-api-key>"
@dataclass

View file

@ -17,7 +17,7 @@ REQUEST_BODY = {
}
HEADERS = {
"Authorization": "Bearer sk-1234",
"Authorization": "Bearer sk-<your-litellm-api-key>",
"Content-Type": "application/json",
}

View file

@ -9,7 +9,7 @@ USAGE EXAMPLES:
# Set required environment variables
export LITELLM_PROXY_URL='http://localhost:4000/chat/completions'
export PROVIDER_URL='https://api.openai.com/v1/chat/completions'
export LITELLM_PROXY_API_KEY='sk-1234'
export LITELLM_PROXY_API_KEY='sk-<your-litellm-api-key>'
export PROVIDER_API_KEY='sk-openai-key'
# Run from scripts directory
@ -537,7 +537,7 @@ Examples:
# 1. Basic usage (recommended - sequential execution)
export LITELLM_PROXY_URL='http://localhost:4000/chat/completions'
export PROVIDER_URL='https://api.openai.com/v1/chat/completions'
export LITELLM_PROXY_API_KEY='sk-1234'
export LITELLM_PROXY_API_KEY='sk-<your-litellm-api-key>'
export PROVIDER_API_KEY='sk-openai-key'
python scripts/benchmark_proxy_vs_provider.py

View file

@ -400,7 +400,7 @@ class LiteLLMHealthCheckClient:
async def main():
"""Main entry point."""
base_url = os.environ.get("LITELLM_BASE_URL", "http://localhost:4000")
api_key = os.environ.get("LITELLM_API_KEY", "sk-1234")
api_key = os.environ.get("LITELLM_API_KEY", "sk-<your-litellm-api-key>")
yaml_path = os.environ.get("LITELLM_MODELS_YAML")
custom_auth_header = os.environ.get(
"LITELLM_CUSTOM_AUTH_HEADER"

View file

@ -24,7 +24,7 @@ if (-not $env:LITELLM_BASE_URL) {
}
if (-not $env:LITELLM_API_KEY) {
$env:LITELLM_API_KEY = "sk-1234"
$env:LITELLM_API_KEY = "sk-<your-litellm-api-key>"
Write-Warning "LITELLM_API_KEY not set, using default: $env:LITELLM_API_KEY"
}

View file

@ -27,7 +27,7 @@ if [ -z "$LITELLM_BASE_URL" ]; then
fi
if [ -z "$LITELLM_API_KEY" ]; then
export LITELLM_API_KEY="sk-1234"
export LITELLM_API_KEY="sk-<your-litellm-api-key>"
echo "Warning: LITELLM_API_KEY not set, using default: $LITELLM_API_KEY" >&2
fi

View file

@ -82,14 +82,14 @@ llm = AzureOpenAI(
engine="azure-gpt-3.5", # model_name on litellm proxy
temperature=0.0,
azure_endpoint="${base_url}", # litellm proxy endpoint
api_key="sk-1234", # litellm proxy API Key
api_key="sk-<your-litellm-api-key>", # litellm proxy API Key
api_version="2023-07-01-preview",
)
embed_model = AzureOpenAIEmbedding(
deployment_name="azure-embedding-model",
azure_endpoint="${base_url}",
api_key="sk-1234",
api_key="sk-<your-litellm-api-key>",
api_version="2023-07-01-preview",
)

View file

@ -59,7 +59,7 @@ const HowItWorks: React.FC = () => {
language="bash"
code={`curl -X POST -i http://your-proxy:4000/chat/completions \\
-H "Content-Type: application/json" \\
-H "Authorization: Bearer sk-1234" \\
-H "Authorization: Bearer sk-<your-litellm-api-key>" \\
-d '{
"model": "gemini/gemini-2.5-pro",
"messages": [{"role": "user", "content": "Hello"}]

View file

@ -90,7 +90,7 @@ function ConnectTabContent({
? createdKeyValue.startsWith("Bearer ")
? createdKeyValue
: `Bearer ${createdKeyValue}`
: "Bearer sk-1234";
: "Bearer sk-<your-litellm-api-key>";
const curlExample = `curl -L -X POST '${baseUrl}/v1/chat/completions' \\
-H 'x-litellm-api-key: ${apiKeyForCurl}' \\
-d '{

View file

@ -61,7 +61,7 @@ const PromptCodeSnippets: React.FC<PromptCodeSnippetsProps> = ({
apiBase = proxySettings.PROXY_BASE_URL;
}
const effectiveApiKey = accessToken || "sk-1234";
const effectiveApiKey = accessToken || "sk-<your-litellm-api-key>";
// Generate code based on selected language and tab
const generateCode = () => {

View file

@ -1084,7 +1084,7 @@ config = {
"${selectedMcpServer.server_name}": {
"url": "${getProxyBaseUrl()}/${selectedMcpServer.server_name}/mcp",
"headers": {
"x-litellm-api-key": "Bearer sk-1234"
"x-litellm-api-key": "Bearer sk-<your-litellm-api-key>"
}
}
}

View file

@ -1275,7 +1275,7 @@ config = {
"${selectedMcpServer.server_name}": {
"url": "${getProxyBaseUrl()}/${selectedMcpServer.server_name}/mcp",
"headers": {
"x-litellm-api-key": "Bearer sk-1234"
"x-litellm-api-key": "Bearer sk-<your-litellm-api-key>"
}
}
}
@ -1315,7 +1315,7 @@ config = {
"${selectedMcpServer.server_name}": {
"url": "${getProxyBaseUrl()}/${selectedMcpServer.server_name}/mcp",
"headers": {
"x-litellm-api-key": "Bearer sk-1234"
"x-litellm-api-key": "Bearer sk-<your-litellm-api-key>"
}
}
}

View file

@ -19,7 +19,7 @@ const exampleModel = (group: RoutingGroup): string => group.models[0] ?? "<your-
const buildCurlSnippet = (group: RoutingGroup, baseUrl: string): string =>
`curl -X POST '${baseUrl}/v1/chat/completions' \\
-H 'Content-Type: application/json' \\
-H 'Authorization: Bearer $LITELLM_API_KEY' \\
-H "Authorization: Bearer $LITELLM_API_KEY" \\
-d '{
"model": "${exampleModel(group)}",
"messages": [{"role": "user", "content": "Hello!"}]
@ -29,7 +29,7 @@ const buildPythonSnippet = (group: RoutingGroup, baseUrl: string): string =>
`from openai import OpenAI
client = OpenAI(
api_key="$LITELLM_API_KEY",
api_key="sk-<your-litellm-api-key>",
base_url="${baseUrl}",
)

File diff suppressed because it is too large Load diff