Claude Code Router: run Claude Code on DeepSeek, GPT and other models

Claude Code only speaks Anthropic's Messages API. Claude Code Router (CCR) is a free, open-source gateway on your own machine that translates for it, so Claude Code can run on DeepSeek, GPT, Gemini or any model behind an OpenAI-compatible API. We set it up and ran real tasks through it.

· Zurelay guides · Prices update live

Do you need a router?

  • For Claude models, no. Point Claude Code at another Anthropic-compatible API with two environment variables; Claude Code pricing has the setup for Zurelay.
  • For DeepSeek, Kimi, GLM or MiniMax, maybe not. Those labs serve Anthropic's format themselves, so ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN are enough; the Anthropic-compatible URLs list has each one, and the DeepSeek key guide shows it.
  • For GPT, Gemini, Grok, Qwen and anything served only OpenAI-style, yes. CCR also lets you mix providers, pick models per task and fall back when one fails.

Set it up

Version 3 of CCR is managed in a local web page rather than a JSON file. These steps are from CCR 3.1.3 with Claude Code 2.1.312.

  1. Install it (Node.js 22 or later), with Claude Code if you don't have it yet.
terminal
npm install -g @musistudio/claude-code-router @anthropic-ai/claude-code
ccr ui
  1. Open the management page. ccr ui starts CCR in the background and opens it at http://127.0.0.1:3458. The gateway Claude Code talks to runs at http://127.0.0.1:3456 once a provider has a model.
  2. Add a provider. Choose Other / custom API endpoint, give it a name, and enter its base URL and API key. For Zurelay that's https://api.zurelay.com/v1 and a zr_live_ key. CCR reads the provider's model list; add the models you want.
  3. Set the protocol by hand. In the provider's Advanced settings, turn off Auto detect protocols and leave only OpenAI Chat selected. See the next section for why.
  4. Create a Claude Code profile under Agent Profiles: a name, the default model, and optionally a model for each of Claude Code's Opus, Sonnet and Haiku tiers. An effect scope of Only opened from CCR leaves your normal claude untouched.
  5. Launch Claude Code through it with the profile's name. Inside, /model lists the models CCR offers.
terminal
ccr zurelay cli
# or start on another model from the same provider
ccr zurelay cli -- --model zurelay/gpt-6.1-terra

The setting that breaks it

Our first run failed with API Error: 400 All target providers failed. CCR had detected that Zurelay also answers Anthropic's Messages API, so it passed Claude Code's requests through unchanged. Zurelay serves that API for Claude models only, so every DeepSeek and GPT request was refused. With auto detection off and only OpenAI Chat selected, CCR translated the requests and the same tasks worked. Any provider that serves Anthropic's format for some models and not others needs the same setting.

One more, on Windows: passing a quoted prompt with -p through the ccr command lost every word after the first in our test. Piping the prompt in worked: echo "your prompt" | ccr zurelay cli -- -p.

What it cost in our test

We asked Claude Code, through CCR, to write a small Python file on DeepSeek V4.1 Flash, then to edit it on GPT-6.1 Terra. Both used Claude Code's file tools correctly. Zurelay billed:

ModelTaskRequestsPrompt tokens (cached)Cost
DeepSeek V4.1 FlashCreate hello.py338,265 (21,760)$0.0006
GPT-6.1 TerraEdit hello.py444,407 (21,632)$0.0063

Every request carried 11,000 to 13,000 tokens of Claude Code's instructions and tool definitions before any of the conversation, which is why prompt caching matters: from the second or third request on, most of the prompt came back from the cache at a fraction of the input price. Caching worked through CCR without any setting.

Things to know

  • Claude Code's prompts are written for Claude. Other models follow its tool instructions well on short tasks; on long, many-step ones, results vary more by model, so try a couple on your own work.
  • Pick models that support tool calling. A model without it can chat but can't read or edit files.
  • Keep CCR on 127.0.0.1. Its own docs warn against exposing it on 0.0.0.0 without a strong token, a firewall and TLS.
  • CCR is a third-party project, not Anthropic's. Check its docs after an update: version 3 changed the setup completely from version 2's config.json.

Prices for the models you'd route to

Per 1M tokens, the lab's list price and Zurelay's:

ModelInputOutputOn Zurelay (in / out)
DeepSeek V4.1 Flash$0.30$1.20$0.03 / $0.12
GPT-6.1 Terra$1.00$5.00$0.25 / $1.25
GPT-6 Astra$10.00$50.00$2.50 / $12.50
Gemini 3.8 Flash$0.75$3.75$0.32 / $1.59
Kimi K3.1 Pro$2.00$10.00$0.80 / $4.00
GLM-5.3$1.40$4.40$0.38 / $1.21
Qwen 3.8 Max$2.00$6.00$1.20 / $3.60

Tested on October 28, 2026 with Claude Code Router 3.1.3 and Claude Code 2.1.312 on Windows, against Zurelay's OpenAI-compatible API. CCR's own documentation: GitHub and provider settings.

Every model on one OpenAI-compatible key, below list price. Credit from $10, no subscription.Get your API key

FAQ

Questions people ask

Anything else? Ask our team and we’ll answer by email.

What is Claude Code Router?

A free, open-source gateway (CCR) that runs on your own machine between Claude Code and model providers. It translates Claude Code's Anthropic-format requests to other APIs, such as OpenAI's Chat Completions, so Claude Code can run on DeepSeek, GPT, Gemini and other models.

Why does Claude Code Router say All target providers failed?

In our test it was the protocol: CCR had detected that the provider also serves Anthropic's Messages API and passed requests through unchanged, but the provider serves that API for Claude only. In the provider's Advanced settings, turn off Auto detect protocols and select only OpenAI Chat.

Can Claude Code use DeepSeek without a router?

Yes. DeepSeek serves Anthropic's format at https://api.deepseek.com/anthropic. Set ANTHROPIC_BASE_URL to that and ANTHROPIC_AUTH_TOKEN to a DeepSeek key, then run claude.

Does prompt caching work through Claude Code Router?

In our test, yes. After the first request of each task, 9,000 to 12,500 of the roughly 12,000 prompt tokens were read from the cache and billed at the cached price, with no setting needed.

Which ports does Claude Code Router use?

Version 3 serves its management page at http://127.0.0.1:3458 and the model gateway that Claude Code calls at http://127.0.0.1:3456.

Where does Claude Code Router 3 keep its settings?

In a SQLite database in ~/.claude-code-router on macOS and Linux, or %APPDATA%\claude-code-router on Windows. Version 3 is configured in its web page rather than by editing config.json.

More guides

Stop paying list price.
Start saving today.

Create a key in seconds, point the SDK you already use at Zurelay, and every request costs up to 90% less from the first token.