Skip to content

Claude Code Router Setup on Windows: Route to Any Model

Install and configure Claude Code Router on Windows to route Claude Code to DeepSeek, GLM, Qwen, Kimi, and more. Full config.json, per-task routing, and fixes.

MGMCSA Guru Team June 9, 2026 4 min read
Claude Code Router config.json on Windows routing requests to multiple AI models

Claude Code Router (CCR) is the tool that makes “run Claude Code on any model” actually work. It’s a small open-source proxy that intercepts Claude Code’s requests and forwards them to whatever provider you point it at — DeepSeek, Qwen, GLM, Kimi, a local Ollama model, or OpenRouter — and it can route different kinds of work to different models. This is the setup most cost-cutting guides are built on.

Here’s the full install and config on Windows, the routing rules that save the most money, and the errors people hit. For the bigger picture of why you’d do this, see use cheap AI models with Claude Code.

Install

CCR runs on Node. Install Claude Code first, then the router:

npm install -g @anthropic-ai/claude-code
npm install -g @musistudio/claude-code-router

On Windows this works in PowerShell, but the shell scripting around it is smoother in WSL — if you go that route, see the WSL install guide.

Configure

CCR reads ~/.claude-code-router/config.json — on Windows that’s C:\Users\YourName\.claude-code-router\config.json. A minimal config that routes everything to DeepSeek looks like this:

{
  "Providers": [
    {
      "name": "deepseek",
      "api_base_url": "https://api.deepseek.com/chat/completions",
      "api_key": "sk-your-deepseek-key",
      "models": ["deepseek-chat", "deepseek-reasoner"],
      "transformer": { "use": ["deepseek"] }
    }
  ],
  "Router": {
    "default": "deepseek,deepseek-chat",
    "think": "deepseek,deepseek-reasoner"
  }
}

Each provider needs a name, the api_base_url (the full chat-completions URL), your api_key, the models list, and an optional transformer that adapts the request format. Built-in transformers exist for deepseek, gemini, openrouter, groq, and more.

Run it

Start Claude Code through the router:

ccr code

That’s ccr code, not claude. After any config edit, reload:

ccr restart

There’s also a web UI for editing the config visually:

ccr ui

Route different tasks to different models

This is where CCR earns its keep. The Router section maps task types to models, so you can spend cheaply where quality doesn’t matter and pay up where it does:

Router keys

default General requests
background Cheap/local model for background tasks
think Reasoning-heavy work like Plan Mode
longContext Model with a large context window
longContextThreshold Token count that triggers longContext
webSearch Model handling web search

A multi-provider example — local model for background, DeepSeek for the rest:

{
  "Providers": [
    {
      "name": "deepseek",
      "api_base_url": "https://api.deepseek.com/chat/completions",
      "api_key": "$DEEPSEEK_API_KEY",
      "models": ["deepseek-chat", "deepseek-reasoner"],
      "transformer": { "use": ["deepseek"] }
    },
    {
      "name": "ollama",
      "api_base_url": "http://localhost:11434/v1/chat/completions",
      "api_key": "ollama",
      "models": ["qwen2.5-coder:latest"]
    }
  ],
  "Router": {
    "default": "deepseek,deepseek-chat",
    "background": "ollama,qwen2.5-coder:latest",
    "think": "deepseek,deepseek-reasoner",
    "longContextThreshold": 60000
  }
}

Switch models on the fly

Inside Claude Code you don’t have to commit to one model. The /model command swaps providers live:

/model deepseek,deepseek-reasoner

The format is always provider_name,model_name, matching what’s in your config.

Common problems

  • ccr: command not found — the global npm bin isn’t on your PATH. Reopen the terminal, or check npm config get prefix.
  • Requests hang in automation — set "NON_INTERACTIVE_MODE": true in the config for CI, Docker, or scripted runs.
  • Tool calls fail on some models — add the tooluse or enhancetool transformer for that model to harden tool-call handling.
  • Wrong model answering — confirm the Router.default value and that you reloaded with ccr restart.

Wrapping up

Claude Code Router is the bridge that lets one config file point Claude Code at any model — and route background, thinking, and long-context work to different ones. Install both packages, drop a config.json in ~/.claude-code-router/, launch with ccr code, and reload with ccr restart after edits.

From here, pick a backend: DeepSeek for the lowest pay-per-token cost, GLM for a flat coding plan, or Qwen3-Coder for big context. Prefer fewer moving parts? Some providers skip the proxy entirely — see anthropic-compatible endpoints.

Frequently asked questions

What is Claude Code Router?

It's an open-source proxy (ccr) that sits between Claude Code and your model providers. It intercepts each request and forwards it to whichever model you configure — DeepSeek, Qwen, GLM, Ollama, OpenRouter and more — and can route different task types to different models.

Do I still need Claude Code installed?

Yes. Claude Code Router doesn't replace Claude Code; it routes its requests. Install both with npm, then launch with ccr code instead of claude. The agent experience stays the same.

Where is the config file on Windows?

In your home directory at ~/.claude-code-router/config.json, which on Windows is C:\Users\YourName\.claude-code-router\config.json. Edit it directly or use the web UI with ccr ui.

Can I switch models without restarting?

Yes. Inside Claude Code, the /model command switches on the fly using the provider,model format — for example /model deepseek,deepseek-chat. After editing config.json, though, you must run ccr restart for changes to load.

Why route different tasks to different models?

Cost and speed. You can send cheap background work to a small or local model, reasoning-heavy planning to a stronger model, and long-context requests to a model with a big window — each defined under the Router section of the config.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.