Claude Code
Claude Code talks to an Anthropic Messages endpoint. Point it at Routeplane instead of api.anthropic.com and every request flows through the registry. So the same agent can run on Anthropic, OpenAI, Google, or an open model, with provider selection and fallback underneath.
Prerequisites
Section titled “Prerequisites”-
Routeplane running: local proxy at
http://127.0.0.1:4356, with your own provider keys configured. -
Claude Code installed:
Terminal window npm install -g @anthropic-ai/claude-code# or the native installer:curl -fsSL https://claude.ai/install.sh | bash
Point Claude Code at Routeplane
Section titled “Point Claude Code at Routeplane”Claude Code reads three environment variables. Set the base URL to Routeplane’s host root. It appends /v1/messages itself.
export ANTHROPIC_BASE_URL=http://127.0.0.1:4356export ANTHROPIC_AUTH_TOKEN=local-placeholder # sent as a bearer tokenexport ANTHROPIC_MODEL=anthropic/claude-sonnet-4-6claudePrefer a file? Put the same values in .claude/settings.json so they apply per-project without exporting:
{ "env": { "ANTHROPIC_BASE_URL": "http://127.0.0.1:4356", "ANTHROPIC_AUTH_TOKEN": "local-placeholder", "ANTHROPIC_MODEL": "anthropic/claude-sonnet-4-6" }}Pick a model
Section titled “Pick a model”ANTHROPIC_MODEL takes any registry id in provider/model form: anthropic/claude-sonnet-4-6, openai/gpt-4o, google/gemini-2.5-pro. Add a :cost or :latency suffix to bias provider selection for the session. Switch mid-session with /model <id>, or at launch with claude --model <id>. See Models for the full id scheme.
Verify
Section titled “Verify”Launch claude, ask it anything, and confirm the response. Routeplane’s routeplane-served-by response header tells you which provider actually answered.
Learn more
Section titled “Learn more”- Claude Code LLM gateway config
- Model fallback: pass an ordered model list and walk it on failure.
- OpenTelemetry: trace every Claude Code request.