Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.routing.run/llms.txt

Use this file to discover all available pages before exploring further.

Claude Code is Anthropic’s terminal agent. It expects Anthropic-shaped endpoints by default. Point ANTHROPIC_BASE_URL at the routing.run host, authenticate with ANTHROPIC_API_KEY, and use route/... model ids. Official references:

Setup

1

Get your API key

Create an API key at app.routing.run. Copy the key. It starts with rk_.
2

Set environment variables

Copy the Connection prompt block below into your shell profile or run the exports in each terminal session before claude.
3

Start Claude Code

Run claude and all requests will be routed through routing.run.

Connection prompt

Copy this into your terminal notes, team wiki, or any assistant that is helping you wire up Claude Code. It includes the full setup sequence, not just the env vars.

Claude Code CLI - connect to routing.run

Manual configuration

If you want to configure Claude Code manually instead of using the prompt above, export these exact values before you run claude:
export ROUTING_RUN_API_KEY='rk_REPLACE_ME'
export ANTHROPIC_API_KEY="$ROUTING_RUN_API_KEY"
export ANTHROPIC_BASE_URL="https://api.routing.run"
export ANTHROPIC_MODEL="route/deepseek-v4-pro-precision"
export ANTHROPIC_DEFAULT_OPUS_MODEL="route/deepseek-v4-pro-precision"
export ANTHROPIC_DEFAULT_SONNET_MODEL="route/deepseek-v4-pro-precision"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="route/deepseek-v4-pro-precision"
export ANTHROPIC_SMALL_FAST_MODEL="route/deepseek-v4-pro-precision"
export CLAUDE_CODE_SUBAGENT_MODEL="route/deepseek-v4-pro-precision"
export ANTHROPIC_CUSTOM_MODEL_OPTION="route/deepseek-v4-pro-precision"
export ANTHROPIC_CUSTOM_MODEL_OPTION_NAME="DeepSeek V4 Pro Precision (routing.run)"
export ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION="Custom DeepSeek model via routing.run"
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
If you keep multiple CLI backends locally, save these exports in a shell wrapper or env file named routing.run so switching providers is simpler. Use a model id with the route/ prefix when you select or override models. Pin all Claude Code alias model variables to routing.run model IDs too. Otherwise Claude Code may still use a built-in Anthropic model such as claude-haiku-4-5-20251001 for background tasks, which routing.run will reject. Claude Code also documents settings files at ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json. The documented knobs include env and apiKeyHelper, but the core routing.run connection is still ANTHROPIC_BASE_URL plus ANTHROPIC_API_KEY. A minimal ~/.claude/settings.json example:
{
  "env": {
    "ANTHROPIC_API_KEY": "rk_REPLACE_ME",
    "ANTHROPIC_BASE_URL": "https://api.routing.run",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "route/deepseek-v4-pro-precision",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "route/deepseek-v4-pro-precision",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "route/deepseek-v4-pro-precision",
    "ANTHROPIC_SMALL_FAST_MODEL": "route/deepseek-v4-pro-precision",
    "CLAUDE_CODE_SUBAGENT_MODEL": "route/deepseek-v4-pro-precision",
    "ANTHROPIC_CUSTOM_MODEL_OPTION": "route/deepseek-v4-pro-precision",
    "ANTHROPIC_CUSTOM_MODEL_OPTION_NAME": "DeepSeek V4 Pro Precision (routing.run)",
    "ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION": "Custom DeepSeek model via routing.run",
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1",
    "API_TIMEOUT_MS": "600000"
  },
  "model": "route/deepseek-v4-pro-precision"
}
Add the exports to ~/.bashrc or ~/.zshrc, or load them from a secrets manager in CI.
Claude Code does not have a general OpenAI-compatible provider mode. It expects Anthropic semantics. Point it at https://api.routing.run, not https://api.routing.run/v1, because Claude Code appends /v1/messages itself.
For coding agents in general, routing.run recommends /v1/chat/completions. Claude Code is the exception because it requires Anthropic-style requests.
Published model IDs are listed on the models page. Exact access depends on your plan tier and the dashboard; common picks:
ModelUse case
route/deepseek-v4-pro-precisionBest current Claude Code starting point
route/deepseek-v4-proLower-cost DeepSeek V4 option
route/glm-5.1-precisionStrong reasoning alternative
route/qwen3.6-plusQwen option if your workflow is compatible
route/minimax-m2.7Long-context sessions
route/kimi-k2.6-precisionAgentic and tool-heavy flows