LiteLLM Gateway Settings
Route Claude Code requests through a local LiteLLM proxy server for centralized model management, logging, and cost tracking. Perfect for teams that need to manage API keys centrally, enforce usage policies, or route between multiple model providers.
Provider Configuration
# Point Claude Code at your LiteLLM gateway export ANTHROPIC_BASE_URL=http://localhost:4000 export ANTHROPIC_API_KEY=sk-litellm-master-key
Settings File
{ "env": { "ANTHROPIC_BASE_URL": "http://localhost:4000", "ANTHROPIC_API_KEY": "sk-litellm-master-key" } }
LiteLLM Proxy Setup
1. Install LiteLLM
pip install litellm[proxy]
2. Create Configuration (litellm_config.yaml)
model_list: - model_name: claude-sonnet-4-20250514 litellm_params: model: anthropic/claude-sonnet-4-20250514 api_key: sk-ant-your-key - model_name: claude-haiku-4-20250514 litellm_params: model: anthropic/claude-haiku-4-20250514 api_key: sk-ant-your-key general_settings: master_key: sk-litellm-master-key database_url: sqlite:///litellm.db litellm_settings: max_budget: 100 # Monthly budget cap in USD budget_duration: monthly
3. Start the Proxy
litellm --config litellm_config.yaml --port 4000
Team Features
- Centralized API keys: Team members don't need individual provider keys
- Budget controls: Set per-user and per-team spending limits
- Usage logging: Track token usage and costs per user
- Model routing: Route different models to different providers
- Fallback chains: Auto-failover between providers
Troubleshooting
| Issue | Solution |
|---|---|
| Connection refused | Ensure LiteLLM proxy is running on port 4000 |
| Auth failed | Check master_key matches ANTHROPIC_API_KEY |
| Model not found | Verify model_name in litellm_config.yaml |
| Slow responses | Check proxy logs with litellm --debug |
Security Notes
- Run the proxy on localhost only, or behind a reverse proxy with TLS
- Use unique API keys per team member for usage tracking
- The proxy stores all API keys - secure the config file appropriately
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Project Standards Config
Claude Code settings preset that enforces consistent coding standards. Configures TypeScript strict mode, ESLint rules, Prettier formatting, and naming conventions.
Bedrock Configuration Blueprint
All-in-one setting covering configure, claude, code, amazon. Includes structured workflows, validation checks, and reusable patterns for api.
Refined Corporate Preset
Production-ready setting that handles configure, proxy, settings, corporate. Includes structured workflows, validation checks, and reusable patterns for api.