CC Switch

Manage routerra.ai profiles for Claude Code and Codex in CC Switch.

Install and prepare

  1. Download the installer for your OS from CC Switch Releases, install it, and open CC Switch. Install the target CLI separately; CC Switch manages its configuration. These instructions follow v3.20.1+ key handling.
  2. Create a key in routerra.ai API Keys, and copy an allowed model ID from Models.

Add and enable the app profile

  1. Select the target app in the sidebar, choose Direct → Add Provider → Custom Configuration, and name it routerra.ai. For Claude Code, use the JSON below; set the model with /model YOUR_CLAUDE_MODEL_ID in the CLI. For Codex, set API Key, endpoint https://routerra.ai/v1, and a Responses-capable model; choose Responses as upstream format. The TOML below shows the resulting provider fields.
  2. Click Add, then Enable on its card, and restart the target CLI. Codex v3.20.1+ switching writes the provider token into ~/.codex/config.toml as experimental_bearer_token, not auth.json. Do not use the legacy requires_openai_auth = true recipe for this flow.
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://routerra.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_MODEL": "YOUR_CLAUDE_MODEL_ID"
  }
}

Generated Codex configuration

Inspect these fields in ~/.codex/config.toml after enabling the Codex profile.

model = "YOUR_MODEL_ID"
model_provider = "routerra"

[model_providers.routerra]
name = "routerra.ai"
base_url = "https://routerra.ai/v1"
wire_api = "responses"
experimental_bearer_token = "YOUR_API_KEY"

Check the connection

A saved provider is not necessarily enabled: check its card and the generated CLI file. If switching has no effect, close the CLI, remove conflicting shell environment variables, and reopen it. Codex showing an official account does not identify the request route; inspect routerra.ai usage. To preserve existing official login during direct switches, enable Settings → General → Codex App Enhancements → Keep official login for direct switches. Model-discovery 404/405 permits manual ID entry.