Catalog
BerriAI/add-key

BerriAI

add-key

Generate a new API key on a live LiteLLM proxy. Asks for alias, scope (user/team), budget, models, and expiry, then calls POST /key/generate. Use when the user wants to create, generate, or provision an API key on a LiteLLM proxy instance.

v1.0LATEST
NewUpdated Oct 12, 2026

Add Key

Generate a new API key on a live LiteLLM proxy.

Setup

Ask for these if not already known:

LITELLM_BASE_URL  — e.g. https://my-proxy.example.com
LITELLM_API_KEY   — proxy admin key

API reference: https://litellm.vercel.app/docs/proxy/virtual_keys

Ask the user

  1. Key alias (optional but recommended, e.g. my-app-prod)
  2. Scope — assign to a team_id or user_id? (optional)
  3. Allowed models (optional, e.g. gpt-4o, claude-3-5-sonnet)
  4. Max budget (optional, e.g. 5.00)
  5. Expiry (optional, e.g. 7d, 30d, 90d) — omit for no expiry

Run

BASE="$LITELLM_BASE_URL"
KEY="$LITELLM_API_KEY"

curl -s -X POST "$BASE/key/generate" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "key_alias": "<alias>",
    "team_id": "<team_id_or_omit>",
    "user_id": "<user_id_or_omit>",
    "models": [<models_or_empty>],
    "max_budget": <budget_or_null>,
    "duration": "<duration_or_omit>"
  }'

Verify

Confirm the key was created:

curl -s "$BASE/key/info" \
  -H "Authorization: Bearer <new_key>" | python3 -c "
import sys, json
d = json.load(sys.stdin)
info = d.get('info', {})
print(f'Alias: {info.get(\"key_alias\")}')
print(f'Expires: {info.get(\"expires\")}')
print(f'Budget: {info.get(\"max_budget\")}')
print(f'Models: {info.get(\"models\")}')
"

Output

Show the user:

  • key — the actual key value (only shown once, tell them to save it)
  • key_alias, expires, max_budget, models

On error:

  • 401 — check that LITELLM_API_KEY is a valid admin key
  • 400 — check required fields; verify team_id/user_id exists
  • Other errors — show detail and the likely fix
Files1
1 files · 1.0 KB

Select a file to preview

Overall Score

77/100

Grade

B

Good

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

75

Quality

82

Clarity

80

Completeness

68

Summary

This skill guides an agent to generate a new API key on a live LiteLLM proxy instance by collecting user parameters (alias, scope, budget, models, expiry) and calling the POST /key/generate endpoint via curl. It includes verification steps and error-handling guidance.

Detected Capabilities

network request (curl POST/GET)environment variable readjson parsinguser prompt

Trigger Keywords

Phrases that agents use to match this skill to user intent.

generate api keycreate litellm keyprovision proxy keyadd api credentialslitellm key management

Risk Signals

WARNING

Requires LITELLM_API_KEY (proxy admin credential) as environment variable or user input

Setup section, Run section
WARNING

Outbound network request to LITELLM_BASE_URL without validation

Run section (curl POST to /key/generate)
INFO

New API key value is displayed once in response — user must capture it or lose access

Output section

Referenced Domains

External domains referenced in skill content, detected by static analysis.

litellm.vercel.appmy-proxy.example.com

Use Cases

  • Provision a new API key for an application or service integrating with LiteLLM proxy
  • Create team-scoped or user-scoped API keys with budget and model restrictions
  • Generate API keys with automatic expiry for temporary access or testing
  • Manage LiteLLM proxy access control by issuing keys with granular permissions

Quality Notes

  • Clear step-by-step structure: Setup → Ask → Run → Verify → Output
  • API reference link provided for context
  • Error codes documented with actionable fixes (401, 400)
  • Verification step includes practical command to confirm key creation and display metadata
  • Example inputs provided for most parameters (alias, models, budget, duration)
  • Limitations noted: key is only shown once; lacks guidance on secure credential storage
  • Scope is well-bounded: single LiteLLM proxy instance, no cross-project access
Model: claude-haiku-4-5-20251001Analyzed: Oct 12, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use BerriAI/add-key in your dev environment

Command Palette

Search for a command to run...