Coding CLI · configuration guide + live pricing · sign up for trial credit
CC Switch is an open-source provider switcher (desktop app, 10 coding tools including Claude Code and Codex) that stores each provider setup as a card and flips between them in one click — handy when you mix official and relay access. 321AI is not in its built-in preset list; add it as a custom configuration and the switching works exactly the same.
CC Switch in one line: One-click provider switching for Claude Code / Codex — add 321AI via custom config. Recommended models and their market floor prices are in the table below; the full catalog is at https://321ai.cc/en/models/.
| Setting | Value | Notes |
|---|---|---|
Add entry | pick the app in the sidebar → + (Add Provider) | search finds no 321AI preset → choose Custom Configuration |
ANTHROPIC_BASE_URL | https://321ai.cc | Claude Code; prefix mode, no /v1 |
ANTHROPIC_AUTH_TOKEN | API key from the console | or ANTHROPIC_API_KEY — either one |
base_url | https://321ai.cc/v1 | Codex; model_providers section of config.toml, include /v1 |
experimental_bearer_token | API key from the console | how Codex stores third-party keys (not auth.json) |
model_provider / model | your name for the provider / a model name on sale | required in Codex config.toml |
1. Download and install CC Switch from its GitHub releases (Windows / macOS / Linux)
2. Pick Claude Code (or Codex) in the sidebar, click the + in the page header; the preset list has no 321AI, so choose Custom Configuration
3. Claude Code: fill env with ANTHROPIC_BASE_URL=https://321ai.cc (no /v1) + ANTHROPIC_AUTH_TOKEN=<console key>; Codex: fill config.toml with base_url=https://321ai.cc/v1 + key + model name
4. Click the provider card to switch (v4 changes only the address / key / model fields), then restart claude / codex in your terminal
| What | Where | Notes |
|---|---|---|
| Live market floor pricing | https://321ai.cc/en/models/ | input per 1M tokens, per-supplier quotes on the marketplace |
Prices are the multi-supplier market floor and move in realtime; see all model prices →
Built-in presets only cover some vendors — relay services are added to the list only through CC Switch's sponsorship program. Adding it via Custom Configuration works identically.
Restart the terminal so the CLI re-reads its config, or check the current base_url inside claude with /status. CC Switch v4 switching changes only the key fields and keeps the rest.
CC Switch treats the Claude base_url as a prefix and appends paths itself (no /v1); Codex follows the official config.toml format with a complete endpoint URL (with /v1).
Unlimited — one card per setup, click to switch; good for mixing official and relay accounts or splitting budgets per project.