Skip to content

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.

  • 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

Claude Code reads three environment variables. Set the base URL to Routeplane’s host root. It appends /v1/messages itself.

Terminal window
export ANTHROPIC_BASE_URL=http://127.0.0.1:4356
export ANTHROPIC_AUTH_TOKEN=local-placeholder # sent as a bearer token
export ANTHROPIC_MODEL=anthropic/claude-sonnet-4-6
claude
**No key for the local proxy.** The local proxy accepts loopback requests without auth, so `ANTHROPIC_AUTH_TOKEN` can be any placeholder.

Prefer 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"
}
}

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.

Launch claude, ask it anything, and confirm the response. Routeplane’s routeplane-served-by response header tells you which provider actually answered.