---
title: "Connect via CC Switch"
description: "Add 1折AI with a custom configuration in CC Switch to switch providers for Claude Code with one click, without manually editing settings.json."
headingIds: {"Installation":"section-1","Adding 1折AI to Claude Code":"section-2","Fetching the Model List":"section-3","Codex":"section-4","FAQ":"section-5"}
---

<aside className="docs-publication" data-pagefind-ignore>

Documentation maintained by [1ZheAI](https://1zheai.com/en/editorial/#publisher). [Sources and corrections](https://1zheai.com/en/editorial/).

Found an error? [Contact support](mailto:support@1zheai.com) with the page address and a description. Do not send API keys or account credentials.

</aside>
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

- macOS: `brew install --cask cc-switch`
- Windows / Linux: download the installer from [GitHub Releases](https://github.com/farion1231/cc-switch/releases)

## Adding 1折AI to Claude Code

<Steps>
<Step title="Open the add page">

Select **Claude Code** in the sidebar, then click **Add Provider** (+) at the top right of the page header.

</Step>
<Step title="Select &quot;Custom configuration&quot;">

1折AI is not currently in CC Switch's preset list, so select **Custom Configuration** at the top of the list.

</Step>
<Step title="Fill in the configuration">

Enter `1折AI` as the name, and set `env` in 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](/en/docs/quickstart-claude-code/) for the syntax.

</Step>
<Step title="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.

</Step>
<Step title="Confirm">

Run `/status` in Claude Code; the base URL should be `https://1zheai.com`. Send another message and check the console [call logs](/en/docs/usage-logs/) to confirm there is a record.

</Step>
</Steps>

<Note>

CC Switch's official example uses `ANTHROPIC_API_KEY`; both variables work. We recommend `ANTHROPIC_AUTH_TOKEN`; see [Claude Code Integration](/en/docs/quickstart-claude-code/) for the reason.

</Note>

## 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.

## Codex

CC Switch can also manage Codex providers. For configuring this site's Base URL, API key, and GPT models, see [Codex CLI Integration](/en/docs/quickstart-codex/).

## FAQ

<AccordionGroup>
<Accordion title="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.

</Accordion>
<Accordion title="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.

</Accordion>
</AccordionGroup>
