Skip to content
Last verified:

macOS 27.0.1 (arm64); CC-Switch 4.0.8, Codex CLI 0.162.1; console import, provider switching, balance queries, gpt-6-astra chat.

CC-Switch ​

CC-Switch manages provider settings and API keys for clients such as Claude Code, Codex, and OpenCode.

Installation ​

  1. Open the latest release page and download the Windows installer (.msi recommended).

    How to choose the Windows installer on the Releases page
  2. After the download finishes, double-click the installer.

  3. Follow the installer wizard to complete installation.

  4. Launch CC-Switch from the Start menu.

Add a Provider ​

After installation, use any of the methods below to connect TokenFlux to CC-Switch.

The key list can push an API key straight into CC-Switch, so there are no fields to fill in by hand.

  1. Follow Create API Key to generate an API key.

  2. Find that key in the list and click "More" on the right, then choose "Import to CCS".

    Choosing Import to CCS from the More menu in the key list
  3. In the "Select client" dialog, choose the client and model, then click "Confirm".

  4. After the browser opens CC-Switch, check the provider name, API endpoint, and API key in the "Confirm provider import" window, then click "Import".

  5. Select the client in the sidebar, find the imported TokenFlux provider, and click "Switch".

  6. Send a message to the selected model and confirm the request in Usage Records.

TIP

If the browser does not launch CC-Switch and reports that CC-Switch is not installed or the protocol handler is not registered, install CC-Switch using the steps above and click again.

Claude Max Environment Variables ​

If you manage Claude Code through CC-Switch, you can add ENABLE_PROMPT_CACHING_1H to the Claude provider's JSON configuration. When you enable the provider, CC-Switch writes this configuration into Claude Code's settings.json.

This variable enables a 1-hour prompt cache, which is useful for Claude Code sessions that repeatedly carry long context. Other Claude groups do not need it.

App-Specific Provider ​

  1. Select Claude Code in the CC-Switch sidebar.
  2. Find the Claude provider card for TokenFlux and click "Edit".
  3. Add the following to env in the "Config JSON":
json
{
  "env": {
    "ENABLE_PROMPT_CACHING_1H": "1"
  }
}

Universal Provider ​

A universal provider's basic form only contains Name, API Key, API URL, and model configuration, without a separate environment variable field. When using a universal provider:

  1. First create and sync the universal provider from the "Universal provider" tab above.
  2. Return to the Claude Code app and edit the synced Claude provider.
  3. Add "ENABLE_PROMPT_CACHING_1H": "1" to the provider's JSON env.
  4. Save and enable the Claude provider.

TokenFlux Documentation