The demo in this guide uses CC Switch V3.19.2. If the configuration in your version differs from this guide, check which version you are using.
Connecting to HaiToken does not require phone-number verification or other additional verification methods. You only need a HaiToken API key to complete the setup in this guide.
Prerequisites
- The Codex desktop app and CC Switch installed
- A HaiToken API key
- At least one available GPT model provided by HaiToken
Setup steps
Step 1: Open the Codex provider page
Open CC Switch, select the Codex icon in the top application bar, and click + in the top-right corner.Step 2: Create a custom provider
Select Custom configuration on the Add new provider page, then complete these fields:Step 3: Fetch and configure models
Expand Advanced options and click Fetch model list. After CC Switch reports that it found models, click Add model and select the GPT model you want to use in Codex. To use more than one model, click Add model again and add each model separately. After making your selections, confirm the default model and model mappings, then click Add in the bottom-right corner to save the provider.CC Switch uses the GPT models added here to generate the Codex model catalog. Codex displays the model name or its mapped name, which does not have to match the provider name.
Step 4: Select the model in Codex
If Codex is already open, restart the Codex desktop app so it loads the new provider and model catalog. Start a new conversation, open the model selector at the bottom of the input area, and select the model you configured. Thegpt-5.4-h label in the screenshot is an example. The options you see depend on the default model and model mappings configured in CC Switch.
The session history will be switched if you switch between different providers. You can enable the Unified Codex session history option in CC Switch to preserve the session history.
Verify the connection
- Select the HaiToken model in the Codex desktop app.
- Send a test message.
- If Codex returns a response, the connection is working.
Troubleshooting
Next steps
- See Get an API key
- See OpenAI format API
- See List models