$npx -y skills add BerriAI/litellm-skills --skill update-keyUpdate an existing API key on a live LiteLLM proxy. Ask for the key and what to change (budget, models, expiry), then call POST /key/update.
| 1 | # Update Key |
| 2 | |
| 3 | Update an existing API key on a live LiteLLM proxy. |
| 4 | |
| 5 | ## Setup |
| 6 | |
| 7 | ``` |
| 8 | LITELLM_BASE_URL — e.g. https://my-proxy.example.com |
| 9 | LITELLM_API_KEY — proxy admin key |
| 10 | ``` |
| 11 | |
| 12 | API reference: https://litellm.vercel.app/docs/proxy/virtual_keys |
| 13 | |
| 14 | ## Ask the user |
| 15 | |
| 16 | 1. **Key** (required) — the `sk-...` value. If they don't have it, list keys: |
| 17 | ```bash |
| 18 | curl -s "$BASE/key/list?size=25&return_full_object=true" -H "Authorization: Bearer $KEY" |
| 19 | ``` |
| 20 | 2. **What to change** — any combination of: |
| 21 | - `max_budget` (float) |
| 22 | - `models` (list) |
| 23 | - `key_alias` (string) |
| 24 | - `tpm_limit` / `rpm_limit` (int) |
| 25 | - `duration` (e.g. `30d` — extends expiry from now) |
| 26 | - `team_id` / `user_id` (reassign ownership) |
| 27 | |
| 28 | ## Run |
| 29 | |
| 30 | ```bash |
| 31 | curl -s -X POST "$BASE/key/update" \ |
| 32 | -H "Authorization: Bearer $KEY" \ |
| 33 | -H "Content-Type: application/json" \ |
| 34 | -d '{ |
| 35 | "key": "<sk-...>", |
| 36 | "max_budget": <value>, |
| 37 | "models": [<models>], |
| 38 | "duration": "<duration>" |
| 39 | }' |
| 40 | ``` |
| 41 | |
| 42 | Only include the fields being changed. |
| 43 | |
| 44 | ## Output |
| 45 | |
| 46 | Show the updated `key_alias`, `max_budget`, `models`, `expires`. |