Setting up CC Switch¶
CC Switch stores separate connection entries for Claude Code and Codex. Create one Nexus entry for each. Switching the active entry does not create a second Nexus key or a second balance.
The shared order is on Client setup.
Values¶
| Entry | Endpoint URL | Protocol | Key variable |
|---|---|---|---|
| Claude Code | https://api.nexus-hub.tech |
Anthropic Messages | ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY |
| Codex | https://api.nexus-hub.tech/v1 |
OpenAI Responses | NEXUS_API_KEY |
Install CC Switch as its own desktop app. Install the CLI you want to drive before you add the entry.
Steps¶
- Click
+in the main window. - Choose
App-specific Provider, then Claude Code or Codex. - Enter the API key and the endpoint URL from the table. Do not import a link that already contains the key.
- Save and activate the entry. Restart the CLI if it does not pick up the change.
- Choose a model id from
GET /v1/modelsfor this key.
Claude Code entry¶
Use endpoint URL https://api.nexus-hub.tech, with no /v1. Put the key in
the CC Switch key field. In custom JSON, set one variable, not both:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.nexus-hub.tech",
"ANTHROPIC_AUTH_TOKEN": "YOUR_NEXUS_API_KEY"
}
}
ANTHROPIC_AUTH_TOKEN is sent as Authorization: Bearer. ANTHROPIC_API_KEY
is sent as x-api-key. Nexus accepts either. Do not commit this JSON.
Codex entry¶
Use endpoint URL https://api.nexus-hub.tech/v1. Fetch Models calls
OpenAI-compatible /v1/models. A manual Codex file must stay on Responses:
model = "MODEL_FROM_V1_MODELS"
model_provider = "nexus"
[model_providers.nexus]
name = "Nexus"
base_url = "https://api.nexus-hub.tech/v1"
env_key = "NEXUS_API_KEY"
wire_api = "responses"
If CC Switch keeps the key only in its own storage, use the
direct Codex setup when you want the key in NEXUS_API_KEY.
Check¶
Activate the entry, restart the CLI, and send a short prompt. A normal reply means that entry works.
If it does not work¶
401orinvalid_key: one key in the active entry, with no extra spaces and no second key variable.model_not_foundormodel_not_allowed: pick an id fromGET /v1/models.unsupported_model: the Codex entry is not on Responses, or the Claude entry uses an id Messages does not allow.404: Claude Code has no/v1on the base. Codex has/v1.- The switch did not apply: restart the CLI and confirm the active entry.
Send support the route, error code, time, and x-request-id. Do not export a profile that contains the key, and do not send the key or a full prompt.
Official sources: CC Switch user manual and releases.