Connect Claude Code and Codex with CC Switch
CC Switch is an open-source desktop app for managing providers for tools such as Claude Code, Codex, and Gemini CLI. These instructions follow v4.0.40 in Direct mode.
In the AlphaTech console, open General → API Keys → Create API Key, enter a name, and select Save changes. Use the copy icon beside your new key to copy the full sk- value. New accounts start at ¥0. Open Personal → Wallet and top up from ¥1 before making a model request. The interactive quickstart illustrates the console steps.
1. Install CC Switch
Section titled “1. Install CC Switch”Choose a package for your platform and architecture from the official v4.0.40 release.
- macOS 12+. Open the universal DMG and move CC Switch to Applications, or install using Homebrew.
- Windows 10+. Use the MSI installer or extract and launch the portable ZIP for your architecture.
- Linux. Choose DEB for Debian/Ubuntu, RPM for a supported distribution such as a recent Fedora, or AppImage. These packages require glibc 2.35+ and WebKitGTK 4.1. Arch Linux users can install
cc-switch-binfrom the AUR.
brew install --cask cc-switchInstall the CLI you plan to use from Claude Code or Codex.
2. Add a custom provider
Section titled “2. Add a custom provider”- Open CC Switch, select Claude Code or Codex in the sidebar, and open Direct.
- Select Add Provider (+) and then Custom Configuration at the top of All.
- Enter
AlphaTechas the provider name. Paste your fullsk-value into API Key. Configure each tool separately, following the labels in your version of CC Switch.
3. Enter the endpoint and model
Section titled “3. Enter the endpoint and model”Claude Code
Section titled “Claude Code”- API Endpoint is
https://alphatech.net.cn. Claude Code appends/v1/messages. - Select the native Anthropic Messages format and the
ANTHROPIC_AUTH_TOKENauthentication field. - Under the advanced options, set the fallback model to
claude-sonnet-5. This setsANTHROPIC_MODELin~/.claude/settings.json. The endpoint is stored asANTHROPIC_BASE_URL.
- API Request URL is
https://alphatech.net.cn/v1. Codex appends/responses. - Set the upstream format to Responses (Native), corresponding to
wire_api = "responses". - Set the default model to
gpt-6-luna. If the form shows a model list, put that model first.
CC Switch stores the provider’s API key as OPENAI_API_KEY internally and writes it into the provider’s experimental_bearer_token in ~/.codex/config.toml when you enable it.
4. Save and enable
Section titled “4. Save and enable”Click Add at the bottom of the form. Back in the provider list, click Enable on the AlphaTech card. Quit and relaunch any running Codex CLI or desktop app.
5. Verify in a terminal
Section titled “5. Verify in a terminal”Claude Code
claude --versionclaudeCodex
codex --versioncodexSend a short prompt in the CLI and look for the response. You can confirm the request in Usage Logs in the AlphaTech console.
Troubleshooting
Section titled “Troubleshooting”- 401 or invalid key. Copy the full key again from the console and check that its status is Enabled.
- 404 or HTML response. Check the Base URL of the tool you selected. Claude Code uses the root URL, and Codex uses the one with
/v1. Check the model ID on the pricing page. - Balance or quota exhausted. For a balance of ¥0, top up in Wallet from ¥1. For an exhausted key cap, review its quota under API Keys.
See the official CC Switch installation instructions and the provider manual.