Use /model with Claude Code Router

Claude Code Router lets Claude Code work with models that don't speak Anthropic's format. Add /model to it as a provider to use GPT, Gemini or Grok in Claude Code.

Checked November 24, 2026

Claude Code speaks Anthropic's Messages format, which only Claude models answer. Claude Code Router is an open-source program that sits in between and translates, so Claude Code can use other models too. We ran every step on this page with its version 3.1.6 and Claude Code 2.1, on 24 Nov 2026.

For Claude models you don't need the router: point Claude Code straight at /model.

Before you start

Set it up

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

ccr ui starts the router in the background and opens its page in your browser. The first time, the page is a setup wizard with six steps:

  1. Choose provider. Open Select preset provider and pick Other / custom API endpoint. Name the provider slashmodel and enter the API endpoint below.
  2. Add credentials. Paste your key under API key.
  3. Pick models. The router loads the list of models. Click the GPT models you want, such as GPT-6.1 Sol. If the router has added a Claude model by itself, remove it with the cross beside it: Claude models don't go on this provider.
  4. Verify connection. Open Advanced settings, switch off Auto detect protocols and leave only OpenAI Responses ticked. Then click Check Connection and Start check. The router sends each model a request of one token, and each should come back as Connection verified.
  5. Connect agent. Leave the agent on Claude Code and give the profile a short name, such as sm. Set Effect scope to Only opened from CCR and Entry mode to CLI only. Then pick the Default model from its list, even when a model already shows there.
  6. Let's start ends the wizard.

API endpoint

https://api.slashmodel.com/v1

Then start Claude Code through the router, with the profile's name:

bash
ccr sm

What you put after -- goes to Claude Code. A model is written as the provider's name, a slash and the model's id, so this starts a session on another model you added:

bash
ccr sm -- --model slashmodel/gpt-6.2-sol

Claude Code's own names, such as sonnet and haiku, get the profile's default model.

Why these settings

  • OpenAI Responses only. Left to detect by itself, the router also finds Anthropic's format at this address and sends Claude Code's requests that way, where only Claude models answer. Claude Code then says "There's an issue with the selected model".
  • The Responses format caches the prompt for GPT models. That counts here, because Claude Code sends a long prompt again with every request. In our run of a task of five requests, each request after the first read over 95% of its prompt from the cache. See the Responses API.
  • Only opened from CCR leaves the plain claude command as it was. With System default, which the wizard preselects, the router puts its own address into Claude Code's settings file, ~/.claude/settings.json, and claude goes through the router too.

Gemini, Grok and other models

Models that aren't GPT models don't have the Responses format. They use OpenAI Chat, so they need a provider of their own. Under Providers, click Add and go through the same steps with another name, such as slashmodel-chat, the same endpoint and key, and OpenAI Chat as the only protocol. Then name that provider with the model:

bash
ccr sm -- --model slashmodel-chat/gemini-4-argon

Claude models work on that provider too, if you want every model in one place.

Good to know

  • The router has to be running. After you restart your computer, run ccr start before ccr sm. ccr stop stops it.
  • If you use the Codex CLI: the router also makes a profile named Codex with the scope System default, and rewrites Codex's own config file, ~/.codex/config.toml, so that codex goes through the router. To get your file back as it was, open Agent Profiles and click Restore original settings on that profile.
  • For Claude models alone, skip the router. Straight to /model, Claude Code keeps Anthropic's own format, prompt caching included.
  • Every request shows under Usage with its tokens and its cost.

One key for every model here.

Top up from $10, change one URL, and pay only for the tokens you use.