Code RouterCode Router
User GuideAPI ReferenceAI ApplicationsHelp & SupportBusiness Cooperation

CC Switch - All-in-One AI CLI Management Tool

Use CC Switch to manage Claude Code, Codex & Gemini CLI provider configs and point them at Code Router. Set your Base URL and API key, then start coding.

🔀 CC Switch is an open-source, cross-platform tool for managing AI coding CLIs. It supports one-click provider switching for Claude Code, Codex and Gemini CLI, unified MCP server management, system prompts management, and Skills extension management — letting you switch between multiple AI coding assistants without manually editing config files.

This page shows how to configure CC Switch so your CLI tools talk to Code Router, the unified OpenAI-compatible AI gateway.

What you need from Code Router

To point any CLI at Code Router you only need two things from your Code Router console:

  • Base URLhttps://ai.sammier.com (the OpenAI-compatible endpoint is https://ai.sammier.com/v1; Anthropic-compatible clients use the same base URL).
  • API key — your personal Code Router key, in the form sk-....

Where the key comes from

Create or copy your key on the token management page of the Code Router console. One key works across all model groups your token is allowed to use.

Configure CC Switch for Code Router

Add a provider in CC Switch. Open CC Switch and create a new provider entry for your target CLI (Claude Code, Codex, or Gemini).

Set the Base URL. Enter https://ai.sammier.com (use https://ai.sammier.com/v1 if the field expects the OpenAI-compatible /v1 path).

Set the API key. Paste your Code Router key (sk-...).

Pick your models. Choose the model(s) you want for each tier the CLI exposes. Code Router accepts the model names published in your console's model list. Field reference:

  • Application — switch app type at the top (Claude / Codex / Gemini) and select your target.
  • Name — a label for this config (e.g. My Code Router) so you can identify and switch to it later.
  • Main Model (required) — the model used by default.
  • Haiku / Sonnet / Opus / Custom tiers — optional per-tier model overrides; leave a tier unset to fall back to the main model.

Save and switch. Activate the provider in CC Switch, then start your CLI as usual — requests now route through Code Router.

Verify it works

Run a simple prompt in your CLI. If you get an authentication error, double-check the Base URL has no trailing slash mismatch and that the key is your Code Router sk-... key. If a model is rejected, confirm the model name matches one listed in your Code Router console.

Manual setup (without CC Switch)

CC Switch just writes the same settings you could set by hand. For most OpenAI-compatible or Anthropic-compatible CLIs, the equivalent environment variables are:

export OPENAI_BASE_URL="https://ai.sammier.com/v1"
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_BASE_URL="https://ai.sammier.com"
export ANTHROPIC_API_KEY="sk-..."

Exact variable names vary by CLI; consult your CLI's documentation for the precise keys it reads, but the values (Base URL + Code Router key) are the same.

Key Features

🔌 Provider Management

  • One-click switching — switch between Claude Code, Codex, and Gemini configs instantly, no manual env vars or config-file editing.
  • Multi-endpoint support — configure multiple endpoints per provider with API key management and latency speed tests.
  • Tiered model config — granular model selection across Haiku / Sonnet / Opus / Custom tiers.

🛠️ MCP Server Management

  • Unified cross-app management — manage MCP servers for Claude / Codex / Gemini from a single panel.
  • Multiple transport types — supports stdio, HTTP, and SSE (Server-Sent Events).
  • Import / export — share MCP configs between apps.

💬 Prompts Management

  • Multi-preset system prompts — keep multiple presets and switch quickly.
  • Cross-app support — Claude (CLAUDE.md), Codex (AGENTS.md), Gemini (GEMINI.md).
  • Markdown editor with live preview.

🌐 Multi-platform Support

  • Desktop app — installers for Windows, macOS, and Linux.
  • Web version — browser-accessible interface for headless / SSH environments.
  • CLI version — interactive menu-driven and command-line modes.

Installing CC Switch

CC Switch is a separate open-source project. The commands below come from its own release channels; see the CC Switch repository for the authoritative, up-to-date instructions.

macOS (Homebrew)

brew tap farion1231/ccswitch
brew install --cask cc-switch

Windows

Download the .msi installer or portable .zip from Releases.

Linux

Download the .deb package or .AppImage from Releases. Arch Linux users can install the AUR package:

paru -S cc-switch-bin

Web Version (Headless / SSH Servers)

Download the latest web build from Releases, extract it, and run the bundled binary. It then serves a local browser interface — see the CC Switch repository for the current default port.

How is this guide?

Last updated on