New: Skill bounties are live. Post a request, fund the bounty, and creators compete for 7 days to build it -> See open bounties

    Guides
    claude-code
    router
    models

    Claude Code Router: Route Claude Code to Any Model (2026)

    Claude Code Router sits between Claude Code and the model provider, letting you route requests to GPT, Gemini, DeepSeek, or a local model.

    July 31, 20266 min read
    Share:

    Claude Code talks to Anthropic's API by default. Claude Code Router sits in between and lets you send those requests somewhere else, GPT, Gemini, DeepSeek, or a model running on your own machine, while keeping the Claude Code interface, skills, and workflow.

    Quick Answer: Claude Code Router is a community proxy that intercepts Claude Code's API calls and forwards them to another provider. Install with npm install -g @musistudio/claude-code-router, configure providers in ~/.claude-code-router/config.json, then run ccr code instead of claude. Your SKILL.md skills work unchanged.

    Why route to a different model

    Three reasons come up repeatedly.

    Cost. Claude Code on a Pro plan hits usage limits. Routing routine work to a cheaper model and reserving Claude for hard problems stretches the same budget further.

    Privacy. Some codebases can't leave the building. Routing to a local model via Ollama means no code reaches any third-party API.

    Model fit. Different models are better at different jobs. Some teams route planning to one model and implementation to another.

    Recommended skills

    Installing the router

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

    Then create the config at ~/.claude-code-router/config.json:

    {
      "Providers": [
        {
          "name": "openrouter",
          "api_base_url": "https://openrouter.ai/api/v1/chat/completions",
          "api_key": "sk-or-your-key",
          "models": [
            "anthropic/claude-sonnet-4.5",
            "google/gemini-2.5-pro",
            "deepseek/deepseek-chat"
          ]
        }
      ],
      "Router": {
        "default": "openrouter,anthropic/claude-sonnet-4.5",
        "background": "openrouter,deepseek/deepseek-chat",
        "think": "openrouter,google/gemini-2.5-pro"
      }
    }
    

    Start a session with ccr code rather than claude.

    What this config does: routes normal work to Sonnet, background tasks to a cheap model, and extended reasoning to Gemini. The Router block is where the value is, you're assigning models to job types rather than picking one.

    Routing to a local model

    Point a provider at your Ollama endpoint:

    {
      "Providers": [
        {
          "name": "ollama",
          "api_base_url": "http://localhost:11434/v1/chat/completions",
          "api_key": "not-needed",
          "models": ["qwen2.5-coder:14b"]
        }
      ],
      "Router": {
        "default": "ollama,qwen2.5-coder:14b"
      }
    }
    

    Pull the model first with ollama pull qwen2.5-coder:14b. Expect 16GB RAM minimum for a 14B model.

    What this gets you: a fully local coding agent. No API calls, no per-token cost, no code leaving your machine.

    What breaks when you route away from Claude

    Be clear about the trade-offs before switching.

    Anthropic-specific features degrade or stop working. Plan Mode, Channels, and extended thinking are built around Claude's behaviour and may not translate to another provider.

    Tool-calling reliability varies. Claude Code leans heavily on structured tool use. Models with weaker tool-calling will fail at multi-step tasks that Claude handles cleanly.

    Smaller local models follow instructions less reliably. A 7B model will miss steps in a long skill that a frontier model follows exactly.

    You're running unofficial software in the request path. Anthropic doesn't support this configuration.

    Do skills still work

    Yes. SKILL.md files are read by Claude Code before the request leaves your machine, so they're already in the prompt by the time the router forwards it. Skills work with any provider.

    Quality depends on the model. code-reviewer (764 installs, free) needs a capable model to apply severity ratings well. git-commit-writer (232 installs, free) works fine even on small local models, because writing a commit message from a diff is a simpler task.

    Browse skills that work across every agent on Agensi.

    Setting it up

    1. Install the router globally with npm
    2. Create ~/.claude-code-router/config.json with at least one provider
    3. Set a default route, then add background and think routes if you want job-specific models
    4. Start with ccr code
    5. Test with a small task before trusting it with a refactor

    To go fully local, read OpenClaw + Ollama, the Ollama setup is identical.

    Keep reading

    Frequently Asked Questions