claude-code-router Explained: What It Is and How It Works With a Relay

The name suggests a relay, but claude-code-router is something different, and the two are easy to mix up. This page explains what the project is, how it relates to the API relays we list, and how to add a relay to it. It follows the project's own README as read on November 10, 2026; the project is still changing, so check the README for current steps.

What Claude Code Router is

The README describes Claude Code Router (CCR) as a local model gateway and control plane for coding agents. It gives agents such as Claude Code, Codex, Kilo Code and OpenCode one stable local endpoint, while you manage the providers, models, accounts, routing rules and tools behind it in one place. It lists switching providers without editing each agent's configuration, retries and ordered fallback models, and request logs showing the resolved route, latency and token usage. It supports several API formats, including OpenAI Chat and Responses, Anthropic Messages and Gemini, plus custom compatible providers. The repository is public on GitHub under the MIT license.

Claude Code Router vs an API relay

A router like this and a relay solve different problems. A relay supplies model access; a local router decides which configured provider each request goes to, so a relay can be one of the providers you add to it.

Claude Code RouterAPI relay
What it isSoftware you run on your own machine: a local gateway and control plane for coding agents.A hosted service run by someone else: it gives you a base URL and a key and forwards requests to upstream providers.
What it sellsNothing, as far as the README describes. It is an open-source project under the MIT license.Access to models, billed by the relay, usually through a balance you top up.
Where the model comes fromFrom the providers you add to it: a built-in preset or a custom endpoint, with your own key.From the relay's own upstream channels, which is why a relay's price and reliability vary.

New to relays? Start with what an API relay is.

Using a relay as a custom endpoint in Claude Code Router

The README's quick start is the desktop app, which you download from the project's releases page. Adding a relay uses the same Providers screen as any other provider:

  1. Open Providers, then Add Provider.
  2. Choose a built-in preset, or choose Other / custom API endpoint and enter a name and the API endpoint.
  3. Enter the API key. For a relay, that is the key the relay issued.
  4. Let CCR detect the protocols and models the endpoint supports, or pick the protocol yourself, then run Check Connection and save.
  5. Open Server and click Start. The local gateway listens on http://127.0.0.1:3456 by default.
  6. Open Agent Config, choose your agent (Claude Code is first in the README's list), select a model and apply the profile.

The README also describes an npm CLI that needs Node.js 22 or newer and starts the same gateway with a browser-based management page:

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

It says to open http://127.0.0.1:3458 and follow the same Providers, Server and Agent flow, with the model gateway still at http://127.0.0.1:3456. For the provider fields, protocols and connection check, see the project's provider guide. Which protocol to choose depends on the relay, so use the format its documentation names (OpenAI-style or Anthropic-style). If you would rather skip the router and point Claude Code straight at a relay, our Claude Code relay setup article covers the two environment variables involved.

Things to keep in mind

  • Your prompts still travel to the provider you add. A router does not change what a relay can see; the usual relay checks apply (common pitfalls).
  • CCR's provider guide says Check Connection sends a real request that can use a few tokens, so select only the models you need to test.
  • A reply through the router does not prove which model answered. To check a relay's model, use our verification tool.

Official sources used

FAQ

Is Claude Code Router the same as Claude Code?

No. Claude Code is Anthropic's coding agent. Claude Code Router is a separate open-source project by musistudio that sits between coding agents, Claude Code among them, and the model providers you configure. Its README lists Claude Code, Codex, Kilo Code, OpenCode and others as agents it can connect.

Is claude-code-router an API relay?

Not in the sense this site uses the word. A relay is a hosted service that resells model access. According to the README, CCR is a local gateway you run yourself and it routes requests to the providers you add. You can add a relay as one of those providers, which is the setup described above.

How do I point it at a custom endpoint?

In the app, go to Providers, then Add Provider, and choose Other / custom API endpoint. Enter a name, the endpoint and your key. CCR's provider guide says it then detects the protocols and models the endpoint supports, and you can verify the full path with Check Connection, which sends a real request and may use a few tokens.

Does using it make a relay cheaper or safer?

The README describes routing, retries, fallback models and request logs. It does not say it changes what a relay charges or how a relay handles your data. Your prompts still go to whichever provider you choose, so the checks in our relay guides still apply.

Claude relaysHow to connect and useCodex CLI guideBrowse all relays