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 in litellm_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:4000
    • ANTHROPIC_AUTH_TOKEN=<LITELLM_MASTER_KEY>
  • LITELLM_LOCAL_MODEL_COST_MAP=true skips the remote cost map fetch, avoiding SSL errors behind corporate proxies
  • start_proxy.sh uses uv run with UV_NATIVE_TLS=true to use the system certificate store — another corporate-proxy workaround

Three ways to configure Claude Code

  • Env vars per sessionexport ANTHROPIC_BASE_URL=... before launching claude
  • Persistent — add an env block to ~/.claude/settings.json
  • VS Code — add a claude-code.env block to VS Code settings.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


About Sébastien

Ready to get to the next level?

Found this valuable? Share it with someone who needs it.

Join 6,000+ readers. Get practical systems for knowledge & AI. Free.

Subscribe ✨

Free: Knowledge System Checklist

A clear roadmap to building your own knowledge system. Subscribe and get it straight to your inbox.

6,000+ readers. No spam. Unsubscribe anytime.

Subscribe