CC-Switch access

Configure the local address, independent key and available models in CC-Switch.

CC-Switch is used to manage vendor configurations for different tools. It saves or switches the configuration, and the actual model request is still issued by the target tool; after enabling the supplier, you also need to go to the target tool to complete session verification.

Step one: Installation and preparation

Download the installation package suitable for your operating system from CC-Switch Official Releases. First confirm that the target tool has been installed, then back up its existing configuration and retain the original supplier that can be switched back.

Create an independent key in API Key and press Quick Start to verify that the model is available. Different tools use different protocols, check before preparation:

Target tool Protocol Base address of this site Configuration details
Claude Code Anthropic Messages https://dunduntoken.com Claude Code
Codex OpenAI Responses https://dunduntoken.com/v1 Codex
OpenCode Corresponding version of OpenAI compatible adapter https://dunduntoken.com/v1 OpenCode
Gemini CLI Gemini API Key https://dunduntoken.com Gemini CLI

The base address is filled in the table, and the target client appends the protocol path by itself.

Step 2: Add the supplier of the target tool

  1. Select the target application in CC-Switch, such as Codex or Claude Code.
  2. Click Add Supplier, select custom configuration, and fill in the name DunDun.
  3. Fill in the site key created for this tool.
  4. Fill in the address according to the table above, select or manually add the model ID available for the current key.
  5. Check the preview or target configuration content before saving to confirm that other vendor and user settings have not been overwritten.

The interface entrance changes with the version. If the current version does not have a target tool or protocol entrance, first check the official support range and configure it according to the corresponding manual access tutorial. Do not fill in the key into the irrelevant official login entrance.

Step 3: Check model mapping

Codex requires Responses and coding tool calls; Claude Code requires Messages and tool calls. If the interface provides model selection or manual addition, fill in the exact model ID of this site.

Claude Code’s Haiku, Sonnet, and Opus are client-side gears. Map to models available on this site according to actual needs. Model aliases on other platforms cannot be defaulted to be valid on this site. The following is an example of the structure of a Claude Code environment configuration:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://dunduntoken.com",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_DUNDUN_API_KEY",
    "ANTHROPIC_MODEL": "CLAUDE_MODEL_ID"
  }
}

Replace the placeholder with your own key and actual model ID. When ANTHROPIC_API_KEY is still present in the old environment, conflicts with the gateway token should be checked; see Claude Code Tutorial for details.

Step 4: Enable and verify

  1. Enable DunDun in the supplier list.
  2. Let the target application re-read the configuration; if there are old sessions or background processes, exit completely and then restart.
  3. Create a new session and send “reply only OK”.
  4. Go to Call Record on this site to check the time, model, status and usage.
  5. Request to read the test project file and confirm the tool call.

CC-Switch shows that the switch is successful only means that the configuration operation is completed, but does not mean that the target process has read the new key. The environments of terminals, editors, desktop programs, and containers may be different and should be verified separately.

Local proxy and routing mode

If the version used provides local proxy, takeover or routing mode, after enabling it, the request may first go to the CC-Switch local listening address and then be forwarded to this site. Configure only when this connection method is required, and check that its upstream provider is DunDun.

When using local forwarding, keep the CC-Switch service running; tools still pointing to the local proxy may not connect after turning off the service. Before deactivating, press the interface to restore direct connection or original configuration, and then restart the target tool. The operation names of different versions are subject to Official Project Description.

Switch back to original supplier

Re-enable the original configuration in the supplier list of the corresponding tool and create a new session verification. If you are still connected to this site, check whether the terminal environment variables, project-level configuration or local proxy have overwritten the switching results. When restoring a backup, only the files related to the tool will be restored, and other user settings will be retained.

FAQ

Phenomenon Inspection method
Still using the old service after switching Restart the target tool and check the environment and project configuration coverage
401 Verify the actual key used by the target process and the source of the old credentials
404 Check addresses, protocols and models, do not mix Messages and Responses
Local connection refused Check whether the proxy service is running and whether the target tool is still pointing to the local port
Text succeeded but task failed Check model tool capabilities and target tool parameters

Return to integration directory · Model selection · Error troubleshooting