LiteLLM Claude Code Proxy
Canonical version: LiteLLM Claude Code Proxy.
Open-source LiteLLM configuration that lets Claude Code run against an Azure AI Foundry deployment instead of Anthropic's hosted API. Published by National Bank of Belgium. It's a thin wrapper: a litellm_config.yaml with a wildcard model route, a start_proxy.sh launcher, a Dockerfile, and a .env template. Any model name Claude Code sends is forwarded to one Azure deployment (for instance azure/responses/gpt-5.3-codex).
Why it exists
Claude Code speaks Anthropic's /v1/messages API. Enterprises often can't use Anthropic directly but have an Azure AI Foundry tenant with approved models. LiteLLM translates between Anthropic's format and Azure's responses / Chat Completions API, so Claude Code keeps working against a corporate-approved backend.
How it works
model_name: "*"wildcard inlitellm_config.yaml— every model name is routed to a single Azure deployment- Claude Code points at the proxy via two env vars:
ANTHROPIC_BASE_URL=http://localhost:4000ANTHROPIC_AUTH_TOKEN=<LITELLM_MASTER_KEY>
LITELLM_LOCAL_MODEL_COST_MAP=trueskips the remote cost map fetch, avoiding SSL errors behind corporate proxiesstart_proxy.shusesuv runwithUV_NATIVE_TLS=trueto use the system certificate store — another corporate-proxy workaround
Three ways to configure Claude Code
- Env vars per session —
export ANTHROPIC_BASE_URL=...before launchingclaude - Persistent — add an
envblock to~/.claude/settings.json - VS Code — add a
claude-code.envblock to VS Codesettings.json
Docker
Uses the official docker.litellm.ai/berriai/litellm:main-stable image. Two options: build the included Dockerfile, or mount litellm_config.yaml directly into the upstream image. Configuration stays in .env.
Takeaways
- Clean pattern for using Claude Code with enterprise-hosted non-Anthropic models (Bring Your Own Key (BYOK) inverted: bring your own model, keep the client)
- Same pattern works for any Anthropic-compatible client — not just Claude Code
- Practical reference for corporate SSL-proxy workarounds in LiteLLM Proxy Configuration
- Complements Claude Max API Proxy, which goes the other direction (Max subscription → OpenAI-compatible API)
References
- https://github.com/NationalBankBelgium/litellm-claude-code-proxy
- https://docs.litellm.ai/docs/tutorials/claude_non_anthropic_models
- https://docs.litellm.ai/docs/proxy/docker_quick_start
Related
- LiteLLM
- LiteLLM Proxy Configuration
- Claude Code
- Claude Code via GitHub Copilot
- Claude Max API Proxy
- AI Gateway
- Anthropic
About Sébastien
Ready to get to the next level?
Found this valuable? Share it with someone who needs it.