Skip to content

CLI Tools with CC Switch

GuRouter is a drop-in backend for the major coding CLIs. You can register it once with CC Switch, a cross-platform desktop app (Windows, macOS, Linux; built with Tauri 2), and switch providers with one click — or wire each CLI by hand.

CC Switch manages Claude Code, Claude Desktop, Codex, Gemini CLI and others. Its workflow is the same for every tool:

  1. Install CC Switch from ccswitch.io or the GitHub releases for farion1231/cc-switch.
  2. Open the app and choose Add Provider.
  3. Pick your CLI’s tab, then Custom (GuRouter is not one of the built-in presets).
  4. Enter Base URL https://gurouter.com and API key <API_KEY>.
  5. Activate the profile — one click, or from the tray menu.
  6. Restart your terminal/CLI after switching, except Claude Code, which hot-switches and needs no restart.

CC Switch keeps your profiles in ~/.cc-switch/ (a SQLite database). It only stores and rewrites each CLI’s credentials — each request is still billed to the GuRouter account that owns <API_KEY>.

Every CLI below is documented because its route answered an unauthenticated probe against https://gurouter.com with 401 (route exists) rather than 404 (route absent):

CLI Route Probe
Claude Code POST /v1/messages 401
Codex CLI POST /v1/responses 401
Gemini CLI POST /v1beta/models/{model}:generateContent 401

If a request returns 401 Unauthorized, the key is missing or wrong. Billing for every call follows the account that owns the key.

Claude Code speaks the Anthropic Messages API and calls POST /v1/messages on whatever base URL you give it.

CC Switch: add a Custom provider with base URL https://gurouter.com and API key <API_KEY>. Claude Code hot-switches, so no terminal restart is needed.

Manual config — set two environment variables:

Terminal window
export ANTHROPIC_BASE_URL="https://gurouter.com"
export ANTHROPIC_AUTH_TOKEN="<API_KEY>"

Claude Code appends /v1/messages to the base URL automatically, so the base URL has no /v1 suffix. ANTHROPIC_AUTH_TOKEN is sent as Authorization: Bearer <API_KEY>.

Smoke test:

Terminal window
claude -p "Say hello in one sentence."

Billing for these calls follows the GuRouter account that owns <API_KEY>.

  • All examples use the placeholder <API_KEY>; never commit a real key to version control.
  • Requests without a valid key are rejected with 401 Unauthorized.
  • Only the routes listed above were verified against the live gateway.