Claude Code Router: Set Up CCR v3 and Route Claude Code to Any Model

By TwitterAPI.io Team•17 min read
Diagram of Claude Code Router. Left: agents Claude Code, Codex and OpenCode / Kimi CLI plus six more. Center: Claude Code Router with gateway port 3456 and UI port 3458, Agent Config profiles, routing rules and fallbacks, credential pools, Fusion and request logs. Right: providers Anthropic, OpenRouter, DeepSeek / Kimi / GLM presets, Gemini and Ollama as a custom endpoint. Bottom: X (Twitter) data reaches the agent as a tool through the MCP server mcp.twitterapi.io/mcp, not through the model gateway.
Claude Code talks to one local endpoint; CCR resolves the provider and model per request. X data enters as an MCP tool on the agent side.
TL;DR
  • What it is: musistudio/claude-code-router, MIT, about 38,000 GitHub stars when we checked in 2026; a local gateway on port 3456 that lets Claude Code (and Codex, OpenCode, Kimi CLI and six more agents) use any provider you configure.
  • v3 changed the setup: desktop app or npm install -g @musistudio/claude-code-router (Node.js 22+) then ccr ui; add a provider, create a CCR client key, start the gateway, then create a Claude Code profile and run ccr "<profile>".
  • ccr code and config.json are the legacy (v1/v2) flow. v3 stores settings in config.sqlite and imports config.json only once when no SQLite config exists; edits to config.json afterwards do nothing.
  • Routing is per tier and per rule: set separate models for Claude Code's Fable, Opus, Sonnet and Haiku tiers, write ordered rules on headers or body fields, or a Node.js script rule, with retry and fallback on failure.
  • Measured on X: 405 posts about CCR, collected in 2026: 32.6% are setup / config talk, 29.1% mention cost or free use, 44.7% name a non-Anthropic model; OpenRouter appears in 12.8%.
  • Add X data to the routed agent: TwitterAPI.io's hosted MCP server is one claude mcp add command; X reads cost $0.15 per 1,000 tweets returned vs $5.00 per 1,000 post reads on the official X API pay-per-use rate card (about 33x).

Most guides for "claude code router" were written for the v1 and v2 releases: install the npm package, hand-write ~/.claude-code-router/config.json with a Providers array and a Router block, then run ccr code. The current release works differently, and a lot of people searching for the old commands hit a CLI that no longer lists them. This page covers the v3 setup from the project's own README and docs at ccrdesk.top, maps the old config keys to the new screens for anyone migrating, and compares CCR with simply pointing ANTHROPIC_BASE_URL at a provider that already speaks Anthropic's API.

It also adds something the top results do not have: a measured look at how developers on X (Twitter) talk about CCR. We collected 405 original posts that mention it, in 2026, and counted which models they pair it with, what they ask about and how the conversation shifted after v3. The plan prices and limits of Claude Code itself are on our Claude Code pricing page and broader options on Claude Code alternatives; this page stays on the router.

Share of X posts about Claude Code Router that name a non-Anthropic model

44.7% of 405 posts (collected in 2026); OpenRouter appears in 12.8%, Gemini in 11.9%, Kimi in 9.1%.

01 — Section

What Claude Code Router is, and what changed in v3

Claude Code Router is a community project by the GitHub user musistudio, MIT-licensed, created in February 2025 and published on npm as @musistudio/claude-code-router (binary ccr). When we read the repository in 2026 it had 38,096 stars, 3,203 forks and a latest release of v3.1.3, and npm counted 193,927 downloads in the 30 days before collection. It is not an Anthropic product.

The README now calls it "a local model gateway and control plane for coding agents". Claude Code, Claude Design, Codex, Grok CLI, Kimi CLI, Kilo Code, OpenCode, Pi, ZCode and WorkBuddy all get one stable local endpoint, and behind it you manage providers, models, accounts, routing rules and tools in one place. Supported upstream protocols are OpenAI Chat and Responses, Anthropic Messages, and Gemini Generate Content and Interactions, and named support for OpenRouter, DeepSeek, SiliconFlow, Moonshot, Kimi Code, Mistral, Z.AI, Bailian and custom compatible endpoints.

Why people use it. Claude Code is built for Anthropic's models and its own billing. CCR lets you keep the Claude Code interface and tools while paying a different provider per token, mixing a strong model for planning with a lower-cost one for background work, or running a local model. The README lists the jobs it does: switch providers without editing agent config files, keep requests running with retries, credential pools, key rotation and ordered fallbacks, add capabilities (vision, web search, MCP tools) to models that lack them through its Fusion feature, and show request logs with the resolved route, latency, tokens and an estimated cost.

The project has had three major versions on npm: 1.0.0 in June 2025, 2.0.0 in January 2026 and 3.0.0 in July 2026. The table shows what moved.

Areav1 / v2 (legacy)v3 (current)
Installnpm install -g @musistudio/claude-code-routerDesktop app (macOS, Windows, Linux) or the same npm package, Node.js 22+
Config~/.claude-code-router/config.json edited by handconfig.sqlite edited in the UI; config.json read once as a migration source
Start Claude Codeccr code (restart with ccr restart)ccr "<profile name>" from an Agent Config profile, or the desktop button
RoutingRouter keys: default, background, think, longContext, webSearchPer-tier models, ordered rules, Node.js script rules, retries and fallbacks
Portsgateway 3456gateway 3456, CLI management UI 3458
02 — Section

Install Claude Code Router and start the gateway

There are three distributions, and they read the same local configuration directory (~/.claude-code-router on macOS and Linux, %APPDATA%\claude-code-router on Windows).

Desktop app. Download the installer for your OS from the GitHub releases page (.dmg for Apple Silicon or Intel, .exe for Windows, .AppImage for Linux). It adds a tray icon, notifications and automatic updates. The docs call its launcher command ccr-app; do not mix it up with the npm ccr command.

npm CLI. For servers, SSH sessions or anyone who does not want Electron. It needs Node.js 22 or newer and starts the same gateway plus a browser-based management UI. If ccr is not found after install, check that the directory from npm prefix -g is on your PATH.

Docker. From a source checkout, the compose file publishes one Nginx endpoint on http://127.0.0.1:3458 that serves both the UI and the gateway routes, and stores data under /data/.claude-code-router. The docs ask you to read the Docker guide before exposing CCR beyond localhost.

First-run order (all three). Add a provider and at least one model, create a CCR client key on the API Keys page, set the default model and any routing rules, start the gateway on the Server page, then connect an agent. The management token that protects the UI and the CCR client keys that authenticate model requests are separate credentials. The ccr ui URL contains a ccr_web_token parameter, so treat the whole URL as a password.

Verify. The docs' check is a /health request on the gateway address that should return 200, one small model request with the client key, and a look at Logs for the requested model, the resolved provider and model, status and latency. A UI that loads does not prove the gateway works.

bash
# Requires Node.js 22 or newer (CCR v3 npm CLI)
npm install -g @musistudio/claude-code-router
ccr --help

# Start the background service and open the management UI (http://127.0.0.1:3458)
ccr ui
# On SSH or a headless box
ccr ui --no-open

# Foreground, for reading startup errors or running under a process manager
ccr serve --no-open
ccr stop          # stops only a background service started by start or ui

# After you add a provider, a CCR client key and a Claude Code profile in the UI:
ccr "Claude Code - Work"
ccr "Claude Code - Work" cli -- --model sonnet

# Health check of the model gateway (expects 200 once a provider + model exist)
curl -s http://127.0.0.1:3456/health
03 — Section

Connect Claude Code and set routing rules

In v3 you no longer export environment variables by hand. On the Agent Config page, choose Add profile, pick Claude Code and give it a name such as Claude Code - Work. The fields that matter:

FieldWhat to setEffect
Effect scopeOnly opened from CCR, or System defaultLimit changes to launches from CCR, or make this the default for every claude start (one system-default profile allowed)
Entry modeCLI & APP, CLI only, App onlyWhich launchers CCR generates
ModelA provider model or Fusion modelDefault when Claude Code has not picked a model CCR recognizes
Fable / Opus / Sonnet / Haiku modelOptional per-tier modelOverrides the model Claude Code uses for that tier
CCR managed compactToggleLets CCR manage context compaction for the profile

Tier mapping is the useful part. Claude Code picks a model per tier, so you can put a strong provider model on the Opus tier and a lower-cost one on Haiku, the small and fast tier. Leave a tier empty to keep Claude Code's own choice. Inside a CCR-launched session, /model lists the models CCR exposes, including Fusion models.

Launch. Run ccr "Claude Code - Work" (or the copied ccr-app command from the desktop card). Add Claude Code's own flags after --. If requests do not show up in CCR's logs, the docs list four causes in order: the service is not running, Claude Code was opened directly instead of from CCR, the profile is not applied or not enabled, or its scope does not cover the current project.

Subscriptions and billing. Anthropic's gateway docs say that while a gateway credential is active, requests carry it instead of your claude.ai login, the subscription's usage limits do not apply, and the traffic is billed per token to whoever owns the upstream credential. With CCR that means your DeepSeek, OpenRouter or other provider account pays, not your Claude plan.

Built-in Claude Code route. CCR detects requests from Claude Code and sends main requests to the profile's model when the client has not selected a model CCR recognizes. An explicit model you choose with /model wins. CCR also strips the billing helper system message Claude Code injects so it does not skew routing.

Subagent routing. When Claude Code spawns an Agent, Task or Workflow, CCR can let it choose a model. Fill the Description field for models on the Models page (for example "good for code search, file triage, summaries, small edits"). CCR then injects the list into the Agent / Task tool description, Claude Code writes a <CCR-SUBAGENT-MODEL>provider/model</CCR-SUBAGENT-MODEL> tag at the start of the spawned prompt, and CCR removes the tag and routes that request to the tagged model. With no descriptions, nothing is injected.

Custom rules. The Routing page holds an ordered list. Each rule has a condition on request.header or request.body (field, operator, value), one or more rewrites of the request, and its own on-failure behavior. The first enabled rule that matches wins, so order is priority.

Script rules. When one condition is not enough, choose Node.js script. The file is an async function body that receives a read-only input (full body and headers, an estimated tokenCount, a summary with lastUserText, toolNames, messageCount and hasImage) and returns null for no match or an object with a model, rewrites and fallback. Timeouts run from 10 to 30,000 ms, files may be up to 5 MiB, and CCR re-reads the file on each execution. Errors and timeouts fail open: CCR logs a diagnostic and moves to the next rule. The example below sends small turns that involve an X search tool to a lower-cost model.

Fallbacks. A global fallback and rule-level fallbacks retry or fail over to other models when a request fails, which is what keeps a long agent run alive when one provider request fails.

javascript
// CCR v3 Node.js script rule (Routing -> Add -> Rule type: Node.js script).
// The file is an async function body: CCR injects `input` and `api`; return null for "no match".
// Goal: when Claude Code's tool list includes the X (Twitter) MCP search tool and the turn is
// small, send it to a lower-cost model; everything else keeps the profile's default model.

const tools = input.summary.toolNames || [];
const hasXSearch = tools.some((name) => name.includes("search_tweets"));

if (!hasXSearch || input.tokenCount > 40000) {
  return null; // fall through to the next rule / the Agent Config model
}

return {
  model: "DeepSeek/deepseek-flash", // "<provider name in CCR>/<model id>"
};
04 — Section

Coming from config.json and ccr code (v1 / v2)

If you have an older install, your file looks like the one below. The v2 README defined Providers (each with name, api_base_url, api_key, models and optional transformer) and a Router block whose values are provider,model pairs: default for everything, background for small background calls, think for reasoning or plan mode, longContext above longContextThreshold tokens (60,000 in the README example), and webSearch. API keys could be written as $VAR or ${VAR} and were read from the environment.

What happens on upgrade. v3's configuration-file doc is explicit: a legacy config.json is read once as a migration source when no SQLite config exists, and after migration editing config.json has no effect. Back it up, upgrade, open the UI and check that each provider passes Check Connection, then re-create your routing intent with tier models and rules: background maps naturally to the Haiku tier, think to the Opus tier, and longContext to a rule on the estimated token count.

Commands that moved. ccr code launched Claude Code through the router; the v3 CLI reference lists start, ui, stop, serve, web and ccr <profile>, not code. ccr restart after editing JSON is gone because the UI applies changes. Do not edit config.sqlite while CCR runs; use Settings, Export data for backups.

How many people still describe the old flow? Among the 118 posts we collected from after the 3.0.0 release, 2.5% still mention ccr code or config.json, and 11.0% mention the desktop app, ccr ui, profiles or v3. Most posts do not name a version at all, so check the date of any tutorial you follow.

json
{
  "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": "openrouter",
      "api_base_url": "https://openrouter.ai/api/v1/chat/completions",
      "api_key": "$OPENROUTER_API_KEY",
      "models": ["google/gemini-2.5-pro-preview"],
      "transformer": { "use": ["openrouter"] }
    }
  ],
  "Router": {
    "default": "deepseek,deepseek-chat",
    "think": "deepseek,deepseek-reasoner",
    "longContext": "openrouter,google/gemini-2.5-pro-preview",
    "longContextThreshold": 60000
  }
}
05 — Section

Claude Code Router vs ANTHROPIC_BASE_URL straight to a provider

A router is no longer the only way to put another model behind Claude Code. Several providers now expose an Anthropic-compatible endpoint, and Claude Code only needs ANTHROPIC_BASE_URL plus a credential. DeepSeek's docs give ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic with your DeepSeek key, and map model names that start with claude-opus to deepseek-v4-pro and claude-sonnet / claude-haiku to deepseek-flash. OpenRouter's Claude Code guide sets ANTHROPIC_BASE_URL to https://openrouter.ai/api, the OpenRouter key in ANTHROPIC_AUTH_TOKEN and an explicitly empty ANTHROPIC_API_KEY, and says no local proxy server is required.

NeedCCR v3Direct ANTHROPIC_BASE_URL
One provider that speaks Anthropic MessagesWorks, extra moving partSimplest: two environment variables
Mix providers per tier or per subagentYes: tier models, rules, subagent tagsNo: one endpoint per session
Provider with only an OpenAI or Gemini APIYes: protocol translationNo
Retries, key pools, fallback modelsYesOnly what the provider offers
Per-request logs with resolved model, tokens, cost estimateYes, locallyProvider dashboard only

What breaks either way. Anthropic's LLM gateway page says any gateway that exposes a supported API format works, but Anthropic does not endorse or audit third-party gateways and does not support routing Claude Code to non-Claude models through any gateway. OpenRouter says its Claude Code path is only guaranteed with the Anthropic first-party provider. DeepSeek's Anthropic endpoint lists unsupported or ignored fields, including mcp_tool_use blocks, cache_control and budget_tokens. Expect some Claude Code features, tool-calling quality and prompt caching to vary by model, and keep a Claude model on the tier that does your hardest planning if results matter.

Which to pick. One provider with an Anthropic endpoint: skip the router. Several providers, per-tier mixing, OpenAI-only or local models, or you want logs and fallbacks: use CCR. Model and price detail for the two providers people pair most often is on our OpenRouter API and DeepSeek V4 Flash pages.

06 — Section

What developers on X say about Claude Code Router

We searched X for posts that mention Claude Code Router by name, by its repository URL or by the ccr code command, and kept 405 original posts by 322 distinct accounts (151 from 2025 and 254 from 2026). The first question was which models people route Claude Code to.

44.7% of posts name at least one non-Anthropic provider or model family. OpenAI, GPT or Codex lead at 19.0% (Codex is also one of the agents CCR v3 serves), then OpenRouter 12.8%, Gemini 11.9%, Ollama or other local setups 9.6% and Kimi 9.1%. Claude model names (Sonnet, Opus, Haiku) appear in 24.0%, usually as the thing being replaced or kept for one tier.

Provider / model familyPostsShare of posts
Claude models (Sonnet/Opus/Haiku)9724.0%
OpenAI / GPT / Codex7719.0%
OpenRouter5212.8%
Gemini4811.9%
Ollama / local399.6%
Kimi / Moonshot379.1%
DeepSeek286.9%
GLM / Z.ai286.9%

What they talk about. 32.6% of posts are setup or configuration talk (install, config, tutorial, guide), 29.1% mention cost, price or free use, and 10.4% report an error or problem. The conversation is international: English 58.8%, Chinese 17.8%, Japanese 9.9%. 31.9% link the GitHub repository and 54.8% carry an image or video, which fits a topic where people share screenshots of config and logs.

Reach is concentrated. The median post has 8 likes and 1,354 views, while the 10 most-liked posts hold 62.7% of all likes in the sample (the top one has 9,615). Posts in X's Top tab had a median of 10 likes against 6 for posts that appeared only in Latest. The project account linked from the README, @musistudio2026, had 65 followers at collection, and 23.7% of its last 93 non-repost posts mention CCR, so most discovery happens through other people's threads and the GitHub page rather than the maintainer's feed.

Horizontal bar chart of 405 X posts about Claude Code Router by provider or model family named: Claude models 24.0%, OpenAI / GPT / Codex 19.0%, OpenRouter 12.8%, Gemini 11.9%, Ollama / local 9.6%, Kimi 9.1%, GLM 6.9%, DeepSeek 6.9%, Qwen 5.4%, Grok 3.0%, MiniMax 1.5%.
Share of 405 X posts about Claude Code Router naming each provider or model family (one post can name several). Collected in 2026 via TwitterAPI.io.
07 — Section

Topics, languages and the v3 shift on X

The second chart puts the topic buckets next to the language mix. Buckets are keyword lists fixed before collection and overlap, so a post about a free model setup counts in both setup and cost.

Topic bucketPostsShare
setup / config how-to13232.6%
errors / problems4210.4%
cost / free / cheap11829.1%
legacy flow (ccr code / config.json)204.9%
v3 flow (desktop app / ccr ui / profiles)358.6%

Reading it. Setup and cost dominate: people arrive at CCR to run Claude Code on a model they already pay for, or on a free or lower-cost tier, and the first obstacle is configuration. Only 10.4% read as problem reports, which is lower than setup talk by a factor of three. Since 3.0.0, the share of posts that mention the v3 flow (11.0%) is above the share still describing ccr code or config.json (2.5%), but both are small next to the 118 posts in that period: most people do not say which version they run.

A practical use of this data. Before you move a tier to a new model, search X for that model plus Claude Code and read the problem posts. The Python example at the end of this page does that for any list of model names.

Two bar charts. Left: topic share of 405 X posts about Claude Code Router: setup / config 32.6%, errors / problems 10.4%, cost / free / price 29.1%, legacy ccr code / config.json 4.9%, v3 desktop / ccr ui / profiles 8.6%. Right: language mix English 58.8%, Chinese 17.8%, Japanese 9.9%, Spanish 3.7%.
Topic buckets (overlapping) and language of 405 X posts about Claude Code Router, collected in 2026 via TwitterAPI.io.
08 — Section

Give the routed Claude Code live X (Twitter) data

CCR routes model traffic; it does not give the model new data. For an agent that has to answer "what are developers saying about this model" or watch a launch on X, add X data as a tool. Tools are called by Claude Code on the agent side, so they work the same whichever provider CCR routes the model to, as long as that model handles tool calls well.

MCP server. TwitterAPI.io runs a hosted MCP server at https://mcp.twitterapi.io/mcp with 12 tools for public X data (search_tweets, get_user_info, get_user_last_tweets, get_tweet_replies, get_trends and others). It takes your API key as a Bearer token. No X account and no X developer approval are needed for reads. New accounts that pass the automatic bot check get up to $1 of free credits (at most 100,000 credits, no card, one per person or network, expiring after 31 days).

REST. Scripts and hooks can call the same data directly: GET https://api.twitterapi.io/twitter/tweet/advanced_search with an X-API-Key header, reading tweets[], has_next_page and next_cursor. That is how the study on this page was collected.

The X data bill. TwitterAPI.io charges per result: $0.15 per 1,000 tweets returned (15 credits per tweet), so a full 20-tweet search page costs $0.003 and an empty search costs the 15-credit minimum, $0.00015. The official X API pay-per-use rate card at docs.x.com/x-api/getting-started/pricing lists $0.005 per post read, $5.00 per 1,000, about 33x more, with pay-per-use capped at 3 million post reads a month. Profiles cost $0.18 per 1,000 on TwitterAPI.io against $0.010 per user read on X.

WorkloadTwitterAPI.ioOfficial X API (pay-per-use)
This page's study: 588 tweets returned$0.09$2.94
One agent research task: 5 searches x 20 tweets$0.015$0.50
1,000 tweets$0.15$5.00
1,000 user profiles$0.18$10.00

Rate limits start at 0.2 requests per second before the first payment and rise to 20 once paid, which is plenty for an interactive coding session. Plans and credit packs are on the pricing page.

bash
# Give the routed Claude Code session live X (Twitter) data: one command, user scope
claude mcp add --transport http --scope user twitterapi-io https://mcp.twitterapi.io/mcp \
  --header "Authorization: Bearer your_key_here"

# Then start Claude Code through your CCR profile as usual
ccr "Claude Code - Work"
# and ask: "search X for posts about kimi in Claude Code from the last week, summarize the problems"
09 — Section

How we collected this

Question. How do people on X talk about Claude Code Router: which models they pair it with, what they ask about, which languages they post in, how much reach a typical post gets and whether they describe the v3 or the legacy flow.

Queries. /twitter/tweet/advanced_search with "claude code router" OR "claude-code-router" OR "ccr code" in Latest (all pages the search returned) and Top (10 pages), plus url:claude-code-router OR musistudio OR ccrdesk in Latest; and /twitter/user/info plus /twitter/user/last_tweets (5 pages, replies included) for the project account musistudio2026. 46 requests, 588 tweets returned, about $0.09 at our rates.

Sample. 488 unique search posts; 405 matched a Claude Code Router pattern in text or links and were posted after the repository was created (February 25, 2025); 5 older ccr code matches were unrelated and dropped. No reposts were returned. Collected in 2026.

Method. Provider, topic and version buckets are case-insensitive keyword lists fixed in the study protocol before collection; one post can fall in several. Engagement figures are at collection time. The v3 split uses the 3.0.0 npm publish date.

What the sample cannot show. X search does not return every post, so this is a sample of the visible conversation, not a census. Keyword buckets miss posts that describe a model without naming it, and "Codex" counts both OpenAI's model family and the Codex agent. Mentions are not usage: a post naming DeepSeek is not proof that DeepSeek works well in CCR. Nothing here measures CCR's install base.

Privacy. Aggregates only. Search results come mostly from private individuals, so raw pages were not kept in the repository; the published sample has no IDs, URLs, text or handles. The only account named is the project's own account linked from its README.

python
"""model_buzz.py - before you route Claude Code to a new model with Claude Code Router,
check what developers on X (Twitter) report about that model in coding agents.

    pip install requests
    export TWITTERAPI_IO_API_KEY=...   # twitterapi.io dashboard
    python model_buzz.py "kimi" "deepseek" "glm" "qwen" --pages 3

For each model name it searches recent X posts that mention the model together with
Claude Code or Claude Code Router, then prints volume, median likes and how many posts
read like problem reports. Cost: $0.15 per 1,000 tweets returned (15 credits per tweet);
a full 20-tweet page is $0.003, so 4 models x 3 pages is at most 240 tweets = $0.036.
No X account and no X developer approval are needed for reads.
"""
import os
import re
import statistics
import sys

import requests

BASE = "https://api.twitterapi.io"
HEADERS = {"X-API-Key": os.environ["TWITTERAPI_IO_API_KEY"]}
PROBLEM = re.compile(r"error|bug|broken|fail|not work|doesn'?t work|timeout|429|loop", re.I)


def search(query, pages):
    """Yield tweets for an advanced_search query, following next_cursor."""
    cursor = ""
    for _ in range(pages):
        params = {"query": query, "queryType": "Latest"}
        if cursor:
            params["cursor"] = cursor
        r = requests.get(f"{BASE}/twitter/tweet/advanced_search", headers=HEADERS, params=params, timeout=30)
        r.raise_for_status()
        body = r.json()
        for t in body.get("tweets", []):
            yield t
        if not body.get("has_next_page") or not body.get("next_cursor"):
            break
        cursor = body["next_cursor"]


def buzz(model, pages):
    query = f'"{model}" ("claude code" OR "claude code router" OR ccr) -filter:retweets'
    rows = list(search(query, pages))
    likes = [t.get("likeCount") or 0 for t in rows]
    problems = sum(1 for t in rows if PROBLEM.search(t.get("text") or ""))
    langs = {}
    for t in rows:
        langs[t.get("lang") or "und"] = langs.get(t.get("lang") or "und", 0) + 1
    top_lang = max(langs, key=langs.get) if langs else "-"
    return {
        "model": model,
        "posts": len(rows),
        "median_likes": statistics.median(likes) if likes else 0,
        "problem_posts": problems,
        "top_lang": top_lang,
        "newest": rows[0]["createdAt"] if rows else "-",
    }


def main():
    args = [a for a in sys.argv[1:] if not a.startswith("--")]
    pages = int(sys.argv[sys.argv.index("--pages") + 1]) if "--pages" in sys.argv else 2
    models = [a for a in args if not a.isdigit()] or ["kimi", "deepseek", "glm", "qwen"]
    print(f"{'model':<12}{'posts':>7}{'med likes':>11}{'problems':>10}  lang  newest")
    for m in models:
        b = buzz(m, pages)
        print(f"{b['model']:<12}{b['posts']:>7}{b['median_likes']:>11}{b['problem_posts']:>10}  {b['top_lang']:<5} {b['newest']}")


if __name__ == "__main__":
    main()

Researching this?Free starter credits cover end-to-end testing — Google sign-in, no card. Get a key.

10 — Questions

Questions readers ask

Is Claude Code Router an official Anthropic tool?

No. It is a community project by the GitHub user musistudio, MIT-licensed, published on npm as @musistudio/claude-code-router. Anthropic's LLM gateway docs say it does not endorse or audit third-party gateways and does not support routing Claude Code to non-Claude models through any gateway, so problems with a non-Claude model are between you, CCR and that provider.

Does ccr code still work?

ccr code is the v1 and v2 command. The v3 CLI reference lists ccr start, ccr ui, ccr stop, ccr serve, ccr web and ccr <profile>; you create a Claude Code profile under Agent Config and launch it with ccr "<profile name>". If you need the old behavior exactly, pin a 2.x version of the npm package, but new features land only in v3.

Where is the Claude Code Router config file?

In v3 the configuration is config.sqlite in ~/.claude-code-router (macOS and Linux) or %APPDATA%\claude-code-router (Windows), edited through the UI. A legacy ~/.claude-code-router/config.json is imported once if no SQLite config exists; editing it afterwards has no effect. Do not edit the SQLite file while CCR runs; use Settings, Export data for backups.

Can I use Claude Code Router with DeepSeek or OpenRouter?

Yes, both are built-in presets in v3. Add the provider with its API key, let CCR detect the protocol and models, then pick them in a Claude Code profile or a routing rule. Both providers also accept Claude Code directly through ANTHROPIC_BASE_URL (api.deepseek.com/anthropic and openrouter.ai/api), so if you only use one of them you may not need the router.

Does Claude Code Router use my Claude Pro or Max subscription?

Not for requests sent to other providers. Anthropic's gateway docs say that while a gateway credential is active, requests carry it instead of your claude.ai login, subscription usage limits do not apply, and the traffic is billed per token to whoever owns the upstream credential. Through CCR that is the provider account you configured.

Which ports does Claude Code Router use?

The model gateway listens on http://127.0.0.1:3456 by default. The npm CLI's management UI defaults to http://127.0.0.1:3458 and moves to the next free port if 3458 is taken; trust the URL the command prints. Docker serves both through one endpoint on 3458.

Do MCP servers still work when Claude Code runs through CCR?

Yes. MCP tools are called by Claude Code itself, so a server such as TwitterAPI.io's X MCP server at mcp.twitterapi.io/mcp works with any routed model. How well the model chooses and fills tool calls depends on the model, and some Anthropic-compatible endpoints ignore MCP-specific request fields, so test tool-heavy tasks on the model you route to.

Is Claude Code Router safe to expose on a network?

By default it listens on 127.0.0.1. The docs warn that binding to 0.0.0.0 exposes the management UI, and ask for a fixed strong CCR_WEB_AUTH_TOKEN, a firewall or private network and TLS from a trusted reverse proxy. Upstream provider keys are stored in the local data directory, so protect that directory and its backups.

11 — Further reading

Continue

Sources & further reading
More from this series

Writing about something you built with TwitterAPI.io? Our community rewards program pays API credits for honest tutorials, build logs and videos.

Build it

Stop reading. Start building.

Starter credits cover real testing on real data. Google sign-in, no card, no application queue.

Get an API key

Already building with TwitterAPI.io? Publish an honest tutorial or build log about it and earn up to $200 a month in API credits.