skills/litellm-proxy/SKILL.md
Set up LiteLLM AI Gateway proxy with Docker Compose for Claude Code Max subscription. Use when the user wants to route Claude Code through LiteLLM for cost tracking, budget controls, or usage monitoring. Also trigger when user mentions "litellm", "AI gateway", "proxy for Claude Code", "track Claude usage", "Claude Code billing", or wants to set up a local proxy between Claude Code and Anthropic API.
npx skillsauth add razbakov/skills litellm-proxyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Set up a LiteLLM AI Gateway proxy via Docker Compose so Claude Code Max subscription traffic flows through LiteLLM for cost attribution, budget controls, and usage tracking per user or team.
Reference docs: https://docs.litellm.ai/docs/tutorials/claude_code_max_subscription
Claude Code sends two headers on each request:
Authorization: Bearer {oauth_token} — the Max subscription OAuth token, forwarded to Anthropicx-litellm-api-key: Bearer {virtual_key} — authenticates with LiteLLM proxyLiteLLM validates the virtual key, logs the request, then forwards everything (including the OAuth token) to Anthropic.
mkdir -p ~/Projects/litellm && cd ~/Projects/litellm
docker-compose.ymlservices:
litellm:
image: docker.litellm.ai/berriai/litellm:main-stable
volumes:
- ./config.yaml:/app/config.yaml
command:
- "--config=/app/config.yaml"
ports:
- "4000:4000"
environment:
DATABASE_URL: "postgresql://llmproxy:dbpassword9090@db:5432/litellm"
STORE_MODEL_IN_DB: "True"
env_file:
- .env
depends_on:
- db
healthcheck:
test:
- CMD-SHELL
- python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:4000/health/liveliness')"
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:16
restart: always
container_name: litellm_db
environment:
POSTGRES_DB: litellm
POSTGRES_USER: llmproxy
POSTGRES_PASSWORD: dbpassword9090
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"]
interval: 1s
timeout: 5s
retries: 10
prometheus:
image: prom/prometheus
volumes:
- prometheus_data:/prometheus
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=15d"
restart: always
volumes:
prometheus_data:
driver: local
postgres_data:
name: litellm_postgres_data
config.yamlTwo critical settings in general_settings:
forward_client_headers_to_llm_api: true — forwards the OAuth token to Anthropiclitellm_key_header_name: "x-litellm-api-key" — tells LiteLLM to authenticate via this custom header instead of the Authorization header (which carries the OAuth token)model_list:
- model_name: anthropic-claude
litellm_params:
model: anthropic/claude-sonnet-4-6
- model_name: anthropic-opus
litellm_params:
model: anthropic/claude-opus-4-6
- model_name: anthropic-haiku
litellm_params:
model: anthropic/claude-haiku-4-5-20251001
general_settings:
master_key: os.environ/LITELLM_MASTER_KEY
database_url: "postgresql://llmproxy:dbpassword9090@db:5432/litellm"
forward_client_headers_to_llm_api: true
litellm_key_header_name: "x-litellm-api-key"
Update model IDs to the latest available at time of setup. Check https://docs.anthropic.com/en/docs/about-claude/models for current model IDs.
.envGenerate secure random keys for production use. The salt key cannot be changed after adding a model.
LITELLM_MASTER_KEY="sk-change-me-to-a-secure-key"
LITELLM_SALT_KEY="sk-change-me-to-a-secure-salt"
UI_USERNAME="admin"
UI_PASSWORD="admin"
prometheus.ymlglobal:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: "litellm"
static_configs:
- targets: ["litellm:4000"]
All config files (.env, config.yaml, prometheus.yml) must exist before starting — Docker will create directories instead of files if they're missing.
docker compose up -d
Wait for health check to pass:
sleep 15 && curl -s http://localhost:4000/health/liveliness
Use the master key to create a virtual key for Claude Code:
curl -s -X POST 'http://localhost:4000/key/generate' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk-change-me-to-a-secure-key' \
-d '{"key_name": "claude-code"}' | python3 -m json.tool
Save the returned key value (starts with sk-).
Add to ~/.zshrc (or ~/.bashrc):
# LiteLLM Proxy (Claude Code Max subscription)
export ANTHROPIC_BASE_URL=http://localhost:4000
export ANTHROPIC_MODEL="anthropic-claude"
export ANTHROPIC_CUSTOM_HEADERS="x-litellm-api-key: Bearer <YOUR_VIRTUAL_KEY>"
Then source ~/.zshrc and restart Claude Code.
# Check proxy auth works
curl -s -H "x-litellm-api-key: Bearer <YOUR_VIRTUAL_KEY>" http://localhost:4000/model/info
# Test from Claude Code
source ~/.zshrc && echo "say hi" | claude --print
| Service | URL | |---------|-----| | LiteLLM Proxy | http://localhost:4000 | | LiteLLM UI | http://localhost:4000/ui | | Prometheus | http://localhost:9090 | | Postgres | localhost:5432 |
/ui/) authenticates via Authorization header internally. When litellm_key_header_name is set to a custom header, the UI login may not work with API key auth. Use UI_USERNAME/UI_PASSWORD for UI access instead.# Start
cd ~/Projects/litellm && docker compose up -d
# Stop
cd ~/Projects/litellm && docker compose down
# Restart (after config changes)
cd ~/Projects/litellm && docker compose restart litellm
# Logs
cd ~/Projects/litellm && docker compose logs litellm --tail 50
# Health check
curl -s http://localhost:4000/health/liveliness
tools
--- name: handoff description: Get an agent past a browser/UI wall it can't (or must not) cross on its own — a login-gated dashboard, a CAPTCHA, a 2FA prompt, an API that keeps rejecting the write, or an irreversible click that policy says a human must make. This skill is an ESCALATION LADDER, not a first move: it tells you to try the automated browser surfaces FIRST (Chrome-in-Claude, computer-use, an autonomous browser sub-agent) and only fall back to the Handoff app — a wrapper browser that h
documentation
Summarize one or more YouTube videos from their links. Use this whenever the user pastes a youtube.com or youtu.be URL (or several) and wants to know what it's about — phrasings like "summarize to telegram", "tldr these videos", "what do these say", "summary of this talk", or just dropping links with no instruction at all. Fetches each video's real transcript via yt-dlp (not the page text, which never contains the transcript), cleans the captions, and writes a per-video summary. Default delivery is Telegram; honor any other surface the user names ("to my notes", "just here in chat", "email it"). Trigger even when the user only pastes bare links — bare YouTube links almost always mean "tell me what's in these".
data-ai
Daily Digest — Chief-of-Staff role consolidates the six top-managers into one Telegram message to the Commander, instead of six. Implements the protocol from agent-proactivity.md.
development
Seed a new or empty Instagram account with a 9-post grid (3×3) so the profile looks established the moment a new visitor lands. Designed for festivals, new businesses, product launches, conferences, communities — any time an empty IG profile would hurt conversion from external traffic (QR scans, flyer drops, cross-promo). Generates assets via /image-from-gemini (per content-publishing rules — never HTML), writes captions with hashtag sets, and outputs a posting order + cadence plan. Trigger generously: phrases like '9 posts for instagram', 'fill my IG', 'starter grid', 'launch grid', 'instagram seed', '9-post grid', 'IG account not to look empty', 'first instagram posts', 'feed bootstrap', '3x3 grid', 'instagram launch content'. Even if the user mentions only one piece (just the images, just the captions, just the order), use this skill — the grid only works as an integrated bundle.