/anthropic integration.
Endpoint
MODROUTER_BASE_URL in the environment used to launch Claude Code.
Basic Setup
Set the Anthropic-compatible base URL and provide either a ModRouter virtual key or a placeholder key if your deployment does not enforce virtual-key auth:ANTHROPIC_API_KEY instead of ANTHROPIC_AUTH_TOKEN. Use the variable your installed version documents.
Model Routing
Claude Code sends Anthropic-style model names. In ModRouter, you can either:- create routing rules that map Claude Code’s requested model names to the provider/model you want, or
- pin Claude Code’s model variables to ModRouter model IDs if your Claude Code version supports model overrides.
MCP Gateway
Claude Code can also connect to ModRouter’s MCP server:x-bf-vk or X-Api-Key instead of Authorization only if another part of your setup owns the bearer token.
If the same Claude Code session uses ModRouter for LLM traffic and also connects to ModRouter’s
/mcp endpoint, avoid double-injecting the same MCP tools through both paths. See MCP Gateway for the recommended tool-injection setup.