Connect via CC Switch
Add 1折AI with a custom configuration in CC Switch to switch providers for Claude Code with one click, without manually editing settings.json.
CC Switch](https://github.com/farion1231/cc-switch) is a desktop tool that helps you manage provider configurations for command-line tools like Claude Code and Codex. After adding it once, switching between your official account, 1折AI, and other providers takes just one click.
Installation
Section titled “Installation”- macOS:
brew install --cask cc-switch - Windows / Linux: download the installer from GitHub Releases
Adding 1折AI to Claude Code
Section titled “Adding 1折AI to Claude Code”Open the add page
Select Claude Code in the sidebar, then click Add Provider (+) at the top right of the page header.
Select "Custom configuration"
1折AI is not currently in CC Switch’s preset list, so select Custom Configuration at the top of the list.
Fill in the configuration
Enter
1折AIas the name, and setenvin the configuration editor to:json {"env": {"ANTHROPIC_BASE_URL": "https://1zheai.com","ANTHROPIC_AUTH_TOKEN": "sk-你的Key"}}To also pin a model, add variables such as
ANTHROPIC_MODEL; see the model mapping section of Claude Code Integration for the syntax.Save and enable
Click Add in the footer, then enable 1折AI in the provider list. CC Switch writes the configuration into Claude Code’s
~/.claude/settings.json, and Claude Code will use the new provider without a restart.Confirm
Run
/statusin Claude Code; the base URL should behttps://1zheai.com. Send another message and check the console call logs to confirm there is a record.
CC Switch’s official example uses ANTHROPIC_API_KEY; both variables work. We recommend ANTHROPIC_AUTH_TOKEN; see Claude Code Integration for the reason.
Fetching the Model List
Section titled “Fetching the Model List”When editing a provider, the Fetch Model List button next to the model input calls /v1/models with your API key (API key), lists the available models, and lets you select one to fill in.
CC Switch can also manage Codex providers. For configuring this site’s Base URL, API key, and GPT models, see Codex CLI Integration.
After switching, Claude Code still uses the old provider?
First confirm in CC Switch that 1折AI is enabled; then check whether the terminal has exported ANTHROPIC_BASE_URL or ANTHROPIC_AUTH_TOKEN. Claude Code follows settings.json, but manually exported old variables can easily cause misjudgment; it is recommended to clear them all and let CC Switch manage everything.
Fetching the model list returns 401?
The API key was entered incorrectly or has been deleted. Copy the API key again, and be careful not to include spaces.
