> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bettertoken.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CC Switch advanced setup for BetterToken providers

> Manage BetterToken providers, model mappings, and proxy settings for Claude Code, Claude Desktop, Codex CLI, OpenCode, and OpenClaw in CC Switch.

CC Switch is a cross-platform desktop app for managing providers across Claude Code, Claude Desktop, Codex, OpenCode, and OpenClaw. This page centralizes advanced setup. Start with each tool's direct setup page, then use CC Switch only when you need to switch providers or run a non-native model.

## Install CC Switch

<Tabs>
  <Tab title="macOS">
    Homebrew is the easiest option. You can also download the latest `.dmg` or `.zip` from [GitHub Releases](https://github.com/farion1231/cc-switch/releases).

    ```bash theme={null}
    brew tap farion1231/ccswitch
    brew install --cask cc-switch
    ```
  </Tab>

  <Tab title="Windows">
    Download the latest `CC-Switch-v{version}-Windows.msi` installer or the portable `.zip` build from [GitHub Releases](https://github.com/farion1231/cc-switch/releases).
  </Tab>

  <Tab title="Linux">
    Download the latest `.deb`, `.rpm`, or `.AppImage` build from [GitHub Releases](https://github.com/farion1231/cc-switch/releases).
  </Tab>
</Tabs>

## What to prepare

* BetterToken API Key (<a href={"https://bettertoken.ai/register"}>register here</a>)
* Claude Code uses the Anthropic protocol, so its `Base URL` is `https://www.bettertoken.ai`
* Claude Desktop with a non-Claude provider requires the latest Claude Desktop and CC Switch `v3.16.5` or later
* Codex, OpenCode, and OpenClaw use the OpenAI-compatible protocol, so their `Base URL` is `https://www.bettertoken.ai/v1`
* Prepare one current **GPT provider** model ID for Codex, OpenCode, and OpenClaw. You can copy it from the <a href={"https://bettertoken.ai/pricing"}>BetterToken model plaza</a>, or let CC Switch fetch it from `/v1/models`

<Info>
  On first launch, CC Switch automatically imports the configs it already finds on your machine. You can keep your official provider as a fallback and add BetterToken alongside it.
</Info>

<Note>
  BetterToken uses two access modes: Anthropic and OpenAI-compatible. To avoid mixing `https://www.bettertoken.ai` with `https://www.bettertoken.ai/v1`, it is better to create providers per app instead of trying to force Claude Code and the OpenAI-compatible tools into one universal provider.
</Note>

## Add a BetterToken provider

<Tabs>
  <Tab title="Claude Code" id="claude-code">
    <Steps>
      <Step title="Open Claude Code in CC Switch and add a provider">
        Open CC Switch, switch to **Claude Code**, and click **Add Provider**.

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/qbH0nwqS9mSIdsda/images/cc-switch/claude-code-add-provider.png?fit=max&auto=format&n=qbH0nwqS9mSIdsda&q=85&s=517f215f5f828187647dd214eacfe19b" alt="The Claude Code page in CC Switch, with the add button in the top-right corner used to create a new provider." style={{ borderRadius: '0.5rem' }} width="2000" height="1792" data-path="images/cc-switch/claude-code-add-provider.png" />
        </Frame>
      </Step>

      <Step title="Fill the basic fields">
        * **Provider Name**: `BetterToken-claude` (or another name that makes the provider easy to identify)
        * **Base URL**: `https://www.bettertoken.ai`
        * **API Key**: your BetterToken API Key
        * **API Format**: `OpenAI Responses API`

        The numbered markers in the screenshot match these fields:

        1. **Provider Name**
        2. **API Key**
        3. **Base URL**

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/PriHfVE9SgoOFlO4/images/cc-switch/claude-code-basic-fields.png?fit=max&auto=format&n=PriHfVE9SgoOFlO4&q=85&s=514944678fb16510d03f0f2610bd8b70" alt="The Claude Code provider edit page in CC Switch, showing where to enter Provider Name, API Key, and API Endpoint." style={{ borderRadius: '0.5rem' }} width="2000" height="1300" data-path="images/cc-switch/claude-code-basic-fields.png" />
        </Frame>
      </Step>

      <Step title="Handle model mapping based on your provider">
        * If you use the **Claude provider**, you usually do not need to change the advanced options or model mapping
        * If you use the **GPT provider**, complete the extra setup below:

        1. Open **Advanced Options**
        2. Set **API Format** to **OpenAI Responses API**

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/PriHfVE9SgoOFlO4/images/cc-switch/claude-code-api-format.png?fit=max&auto=format&n=PriHfVE9SgoOFlO4&q=85&s=5605667b764f033854f78dc981592f84" alt="The advanced options section in CC Switch, with API Format set to OpenAI Responses API." style={{ borderRadius: '0.5rem' }} width="2000" height="1300" data-path="images/cc-switch/claude-code-api-format.png" />
        </Frame>

        3. In **Model Mapping**, click **Fetch Model List**
        4. Explicitly choose values from the dropdowns for **Primary Model**, **Thinking Model**, **Haiku Default Model**, **Sonnet Default Model**, and **Opus Default Model**

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/PriHfVE9SgoOFlO4/images/cc-switch/claude-code-model-mapping.png?fit=max&auto=format&n=PriHfVE9SgoOFlO4&q=85&s=d1104cc24dae2825dfed3a6be53dc6b3" alt="The model mapping section in CC Switch, showing Fetch Model List and the mappings for Primary, Thinking, Haiku, Sonnet, and Opus models." style={{ borderRadius: '0.5rem' }} width="2000" height="1300" data-path="images/cc-switch/claude-code-model-mapping.png" />
        </Frame>

        All of these models should use current **GPT provider** model IDs from the <a href={"https://bettertoken.ai/pricing"}>BetterToken model plaza</a>.
      </Step>

      <Step title="Save, switch, and decide whether to enable the proxy">
        After saving, go back to the provider list:

        1. Mark the BetterToken provider as the active one
        2. If you use the **Claude provider**, you do not need to enable the **CC Switch proxy** from the top-left corner
        3. If you use the **GPT provider**, enable the **CC Switch proxy**

        The screenshot below shows BetterToken-claude enabled in the provider list. Enable the **CC Switch proxy** from the top-left corner only when you use the **GPT provider**.

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/PriHfVE9SgoOFlO4/images/cc-switch/claude-code-enable-proxy.png?fit=max&auto=format&n=PriHfVE9SgoOFlO4&q=85&s=13c9adc5d76d5a2d1fae0e52e90a87ca" alt="The CC Switch provider list with BetterToken-claude selected and marked as In Use." style={{ borderRadius: '0.5rem' }} width="2000" height="1300" data-path="images/cc-switch/claude-code-enable-proxy.png" />
        </Frame>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Claude Desktop" id="claude-desktop">
    <Info>
      This tab is for GPT, Kimi, GLM, and other non-Claude providers. For the Claude provider, use the [direct Claude Desktop setup](/en/faq/claude-desktop-bettertoken-api).
    </Info>

    <Steps>
      <Step title="Switch to Claude Desktop and add a provider">
        Open CC Switch, select the **Claude Desktop** icon in the top toolbar, then click **+** in the upper-right corner.

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/zaxT_L3BQP7MnZS4/images/claude-desktop-third-party-models/cc-switch-claude-desktop-add-provider.png?fit=max&auto=format&n=zaxT_L3BQP7MnZS4&q=85&s=8906aaf8ead247cf406a55a51f402bdf" alt="Switch to Claude Desktop in CC Switch and click the plus button to add a provider." style={{ borderRadius: '0.5rem' }} width="2000" height="1300" data-path="images/claude-desktop-third-party-models/cc-switch-claude-desktop-add-provider.png" />
        </Frame>
      </Step>

      <Step title="Enter the basic fields">
        * **Provider Name**: use a recognizable name such as `BetterToken-GPT`
        * **API Key**: your BetterToken API Key
        * **API Endpoint**: `https://www.bettertoken.ai`

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/zaxT_L3BQP7MnZS4/images/claude-desktop-third-party-models/provider-basic-fields.png?fit=max&auto=format&n=zaxT_L3BQP7MnZS4&q=85&s=ba55f76085a213cde6527e86aca54798" alt="Enter the Provider Name, API Key, and API Endpoint for Claude Desktop in CC Switch." style={{ borderRadius: '0.5rem' }} width="2000" height="1300" data-path="images/claude-desktop-third-party-models/provider-basic-fields.png" />
        </Frame>
      </Step>

      <Step title="Set the API Format and model mapping">
        Select **OpenAI Responses API (Requires routing)** for **API Format**, then click **Fetch Models**.

        Map Sonnet, Opus, Fable, and Haiku to the model ID you want to use:

        | Model role | Requested model |
        | ---------- | --------------- |
        | Sonnet     | `YOUR_MODEL_ID` |
        | Opus       | `YOUR_MODEL_ID` |
        | Fable      | `YOUR_MODEL_ID` |
        | Haiku      | `YOUR_MODEL_ID` |

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/zaxT_L3BQP7MnZS4/images/claude-desktop-third-party-models/provider-model-mapping.png?fit=max&auto=format&n=zaxT_L3BQP7MnZS4&q=85&s=d93c1bd4098f1f839cd2ab6a426d1aba" alt="Select OpenAI Responses API and configure the Claude Desktop model mapping in CC Switch." style={{ borderRadius: '0.5rem' }} width="2000" height="1300" data-path="images/claude-desktop-third-party-models/provider-model-mapping.png" />
        </Frame>

        Copy a current model ID from the <a href={"https://bettertoken.ai/pricing"}>model plaza</a> or the API Key **Setup** dialog. Enable **Declare 1M** only when the model plaza marks that model as supporting a 1M context window.
      </Step>

      <Step title="Save, switch, and enable the proxy">
        Save the provider, set it to **In use**, then turn on the proxy switch in the upper-left corner.

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/zaxT_L3BQP7MnZS4/images/claude-desktop-third-party-models/provider-enable-proxy.png?fit=max&auto=format&n=zaxT_L3BQP7MnZS4&q=85&s=99800d159627886f2e999f9eceb061bf" alt="The BetterToken provider for Claude Desktop is active and the CC Switch proxy is enabled." style={{ borderRadius: '0.5rem' }} width="2000" height="1300" data-path="images/claude-desktop-third-party-models/provider-enable-proxy.png" />
        </Frame>
      </Step>

      <Step title="Restart Claude Desktop">
        Quit Claude Desktop completely, then reopen it. **Gateway** in the lower-left corner confirms that the setup is active. Choose a mapped model from the model menu in the message box.

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/zaxT_L3BQP7MnZS4/images/claude-desktop-third-party-models/claude-desktop-gateway-ready.png?fit=max&auto=format&n=zaxT_L3BQP7MnZS4&q=85&s=bf573497e7a842b367f6c9ca95fdc99b" alt="Claude Desktop shows Gateway after restart and offers the models mapped through CC Switch." style={{ borderRadius: '0.5rem' }} width="2400" height="1600" data-path="images/claude-desktop-third-party-models/claude-desktop-gateway-ready.png" />
        </Frame>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Codex" id="codex-cli">
    <Steps>
      <Step title="Open Codex in CC Switch and add a provider">
        Open CC Switch, switch to **Codex**, and click **Add Provider**. If CC Switch asks you to choose a preset first, prefer **OpenAI Compatible** or **Custom**.

        The numbered markers in the screenshot match these actions:

        1. Switch to **Codex**
        2. Click **Add Provider** in the top-right corner

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/qbH0nwqS9mSIdsda/images/cc-switch/codex-cli-add-provider.png?fit=max&auto=format&n=qbH0nwqS9mSIdsda&q=85&s=5f892bf124c432babed54886c6051632" alt="The Codex page in CC Switch, with Codex selected at the top and the add button in the top-right corner used to create a new provider." style={{ borderRadius: '0.5rem' }} width="1800" height="1532" data-path="images/cc-switch/codex-cli-add-provider.png" />
        </Frame>
      </Step>

      <Step title="Fill the basic fields">
        * **Provider Name**: `BetterToken`
        * **Base URL**: `https://www.bettertoken.ai/v1`
        * **API Key**: your BetterToken API Key

        If you switch to a custom config view, make sure the underlying config uses `wire_api = "responses"`.

        The numbered markers in the screenshot match these fields:

        1. **Provider Name**
        2. **API Key**
        3. **Base URL**

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/PriHfVE9SgoOFlO4/images/cc-switch/codex-cli-basic-fields.png?fit=max&auto=format&n=PriHfVE9SgoOFlO4&q=85&s=a6483a11bcf6eaf3663134f407843391" alt="The Codex provider edit page in CC Switch, showing where to enter Provider Name, API Key, and Base URL." style={{ borderRadius: '0.5rem' }} width="2000" height="1300" data-path="images/cc-switch/codex-cli-basic-fields.png" />
        </Frame>
      </Step>

      <Step title="Fetch and map a model">
        Click **Fetch Models** and choose a current Model ID from the <a href={"https://bettertoken.ai/pricing"}>model plaza</a>. Codex does not require the CC Switch proxy.
      </Step>

      <Step title="Save and switch">
        Save the provider and switch Codex to BetterToken. CC Switch writes the corresponding Codex auth and config files for you.

        After saving, return to the list and confirm that the BetterToken entry is marked as **In Use**.

        <Frame>
          <img src="https://mintcdn.com/bettertoken-d796114e/ZMo3cJhJx4ISRrsG/images/cc-switch/codex-cli-activate-provider.png?fit=max&auto=format&n=ZMo3cJhJx4ISRrsG&q=85&s=52dc850977af1443b4b573a27726c4b5" alt="The Codex provider list in CC Switch, with BetterToken selected and marked as in use." style={{ borderRadius: '0.5rem' }} width="1800" height="1686" data-path="images/cc-switch/codex-cli-activate-provider.png" />
        </Frame>
      </Step>
    </Steps>
  </Tab>

  <Tab title="OpenCode" id="opencode">
    <Steps>
      <Step title="Open OpenCode in CC Switch and add a provider">
        Open CC Switch, switch to **OpenCode**, and click **Add Provider**. If CC Switch asks for a preset first, prefer **OpenAI Compatible** or **Custom**.
      </Step>

      <Step title="Fill the basic fields">
        * **Provider Name**: `BetterToken`
        * **Base URL**: `https://www.bettertoken.ai/v1`
        * **API Key**: your BetterToken API Key
        * **API Format**: `OpenAI Compatible`
      </Step>

      <Step title="Choose the default model">
        Use **Fetch Models** when possible. If you need to enter the model manually, use a current **GPT provider** model ID from the <a href={"https://bettertoken.ai/pricing"}>BetterToken model plaza</a>.

        OpenCode reads the saved provider configuration directly and does not require the CC Switch proxy.
      </Step>

      <Step title="Save and switch">
        Save the provider and switch OpenCode to BetterToken.
      </Step>
    </Steps>
  </Tab>

  <Tab title="OpenClaw" id="openclaw">
    <Steps>
      <Step title="Open OpenClaw in CC Switch and add a provider">
        Open CC Switch, switch to **OpenClaw**, and click **Add Provider**. If CC Switch asks for a preset first, prefer **OpenAI Compatible** or **Custom**.
      </Step>

      <Step title="Fill the basic fields">
        * **Provider Name**: `BetterToken`
        * **Base URL**: `https://www.bettertoken.ai/v1`
        * **API Key**: your BetterToken API Key
        * **API Format**: `OpenAI Responses API`

        If you are editing a custom OpenClaw provider config, make sure `api` is set to `openai-responses`.
      </Step>

      <Step title="Choose the default model">
        Use **Fetch Models** when possible. If you need to enter the model manually, use a current **GPT provider** model ID.

        OpenClaw uses the saved provider configuration directly and does not require the CC Switch proxy.
      </Step>

      <Step title="Save and switch">
        Save the provider and switch OpenClaw to BetterToken.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Make saved changes take effect

After saving and switching providers, restart the affected client or gateway before verifying the setup.

* Claude Code: quit the current Claude Code session completely, then start it again.
* Claude Desktop: quit the app completely, reopen it, and confirm that **Gateway** appears in the lower-left corner.
* Codex: restart the current Codex process or open a new terminal session.
* OpenCode: quit the current OpenCode session and start it again.
* OpenClaw: run `openclaw gateway restart`, then use `/new`, `/status`, and `/model` in Discord.

## CC Switch-specific advanced features

CC Switch can preserve the official Codex login when you switch to a third-party provider and combine official and third-party sessions in one history. Restart Codex after enabling these options. See [keep the official Codex login and unified session history](/en/faq/codex/official-login-third-party-api).

## Common issues

* Do not add `/v1` to the Claude Code `Base URL`
* When Claude Code uses the **GPT provider**, set **API Format** to **OpenAI Responses API** under **Advanced Options**
* When Claude Code uses the **Claude provider**, you do not need to enable the **CC Switch proxy**
* When Claude Desktop uses a non-Claude provider, enable the **CC Switch proxy** and restart the app completely
* Codex, OpenCode, and OpenClaw should use `https://www.bettertoken.ai/v1`
* When Codex, OpenCode, or OpenClaw asks for a model, use a **GPT provider** model ID
* If **Fetch Models** fails, check the API key and `Base URL`, then paste the model ID manually
* If switching does not take effect, confirm that BetterToken is the active provider in CC Switch and restart the affected client or gateway as described above

## Related pages

* Claude Code details: [Claude Code](/en/ai-tools/claude-code)
* Direct Claude provider setup for Claude Desktop: [Claude Desktop](/en/faq/claude-desktop-bettertoken-api)
* Codex details: [Codex](/en/ai-tools/codex)
* OpenCode details: [OpenCode](/en/ai-tools/opencode)
* OpenClaw details: [OpenClaw](/en/ai-tools/openclaw)

## Related FAQ

* [Use third-party models and Codex in Claude Desktop](/en/faq/claude-desktop/third-party-models)
* [OpenAI-compatible API vs Anthropic-compatible API](/en/faq/concepts/openai-compatible-vs-anthropic-compatible)
* [MCP vs API Key and Base URL](/en/faq/concepts/mcp-vs-api-key-base-url)
* [What are model\_provider, base\_url, and wire\_api?](/en/faq/codex/model-provider-base-url-wire-api)
* [How to configure an OpenAI-compatible API in Cline](/en/faq/cline/openai-compatible-api)
