Skip to content

Commit 0995b33

Browse files
Merge pull request #15004 from BerriAI/cursor/update-litellm-docs-from-latest-release-d2ca
Update litellm docs from latest release
2 parents b685102 + c684a18 commit 0995b33

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

docs/my-website/docs/mcp.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,16 @@ mcp_servers:
149149
auth_type: "api_key"
150150
auth_value: "abc123" # headers={"X-API-Key": "abc123"}
151151
152+
# NEW – OAuth 2.0 Client Credentials (v1.77.5)
153+
oauth2_example:
154+
url: "https://my-mcp-server.com/mcp"
155+
auth_type: "oauth2" # 👈 KEY CHANGE
156+
authorization_url: "https://my-mcp-server.com/oauth/authorize" # optional for client-credentials
157+
token_url: "https://my-mcp-server.com/oauth/token" # required
158+
client_id: os.environ/OAUTH_CLIENT_ID
159+
client_secret: os.environ/OAUTH_CLIENT_SECRET
160+
scopes: ["tool.read", "tool.write"] # optional
161+
152162
bearer_example:
153163
url: "https://my-mcp-server.com/mcp"
154164
auth_type: "bearer_token"

docs/my-website/docs/proxy/virtual_keys.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,50 @@ curl 'http://0.0.0.0:4000/key/generate' \
6666
--data-raw '{"models": ["gpt-3.5-turbo", "gpt-4"], "metadata": {"user": "[email protected]"}}'
6767
```
6868

69+
## 🔁 Scheduled Key Rotations (NEW in v1.77.5)
70+
71+
LiteLLM can now rotate **virtual keys automatically** on a schedule you define.
72+
73+
### How it works
74+
1. When creating a virtual key you set `rotation_schedule` – a [cron expression](https://crontab.guru/).
75+
2. LiteLLM stores the schedule in the DB and runs a background job that regenerates the key at the specified time.
76+
3. Existing key string is invalidated; a **notification webhook** (if configured) is sent with the new key value.
77+
78+
### Create a key with rotation
79+
80+
```bash
81+
curl 'http://0.0.0.0:4000/key/generate' \
82+
-H 'Authorization: Bearer <your-master-key>' \
83+
-H 'Content-Type: application/json' \
84+
-d '{
85+
"models": ["gpt-4o"],
86+
"rotation_schedule": "0 0 * * SUN", # rotate every Sunday at 00:00 UTC
87+
"webhook_url": "https://example.com/key-rotated"
88+
}'
89+
```
90+
91+
### Enable globally via env
92+
93+
Set these env vars when starting the proxy:
94+
95+
| Variable | Description | Default |
96+
|----------|-------------|---------|
97+
| `LITELLM_KEY_ROTATION_ENABLED` | Enable the rotation worker | `false` |
98+
| `LITELLM_KEY_ROTATION_CHECK_INTERVAL_SECONDS` | How often to scan for keys to rotate | `86400` |
99+
100+
### Webhook payload
101+
102+
```json
103+
{
104+
"event": "virtual_key.rotated",
105+
"old_key_id": "sk-abc...",
106+
"new_key": "sk-def...",
107+
"rotation_time": "2025-10-05T00:00:00Z"
108+
}
109+
```
110+
111+
If no `webhook_url` is provided the new key value is returned in the response of the `/key/rotate` REST call instead.
112+
69113
## Spend Tracking
70114

71115
Get spend per:

0 commit comments

Comments
 (0)