Codex Deepseek Setup
This article introduces how to use CC Switch to enable Codex to use third-party models such as DeepSeek, Qwen, ZLM, and other models.
CC Switch is a free and open-source cross-platform desktop tool that allows you to switch between third-party API providers in AI programming assistants like Codex with one click, enabling you to use AI programming capabilities at a lower cost.
This article is based on CC Switch v3.16.0 (it is recommended to install the latest version), and explains how to configure DeepSeek as the backend API for Codex. Other models can also be configured by referring to this guide.
> In addition to the official API interface, you can also directly integrate DeepSeek, Kimi, GLM, Doubao, MiniMax and other mainstream large models through the [Coding Plan/Token Plan](https://example.com/claude-code/coding-plan.html) package, without purchasing each vendor's API separately.
!(https://example.com/wp-content/uploads/2026/05/418bd00f-3279-4bab-9c73-e7c2d98c96cf.webp)
* * *
### Working Principle
CC Switch starts a proxy service on your local machine, transparently forwarding requests sent by Codex to your specified backend (such as DeepSeek), and then passing the response back to Codex.
The entire forwarding process is completely transparent. For Codex, it still believes it is accessing the OpenAI official interface. In reality, the request has been forwarded by CC Switch to the third-party model service you specified.
!(https://example.com/wp-content/uploads/2026/05/055cf8d5-916f-44fb-ae24-75076126f1f7.webp)
### Prerequisites
Before starting the configuration, please ensure you meet the following requirements:
| Condition | Description |
| --- | --- |
| Codex Installed | Download and install via [https://openai.com/zh-Hans-CN/codex/](https://openai.com/zh-Hans-CN/codex/) |
| DeepSeek API Key | Go to [platform.deepseek.com](https://platform.deepseek.com/) to register and obtain |
| Operating System | Windows 10+, macOS 12+, or mainstream Linux distributions |
* * *
## Step 1: Install CC Switch
The installation package download address is [https://github.com/farion1231/cc-switch/releases/latest](https://github.com/farion1231/cc-switch/releases/latest). Scroll to the bottom of the page to see download links for each platform:
!(https://example.com/wp-content/uploads/2026/05/tutorial_1780134280417.png)
Choose the corresponding installation method based on your operating system.
| Distribution | Recommended Format | Installation Method |
| --- | --- | --- |
| Ubuntu / Debian / Linux Mint / Pop!_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` or `sudo apt install ./CC-Switch-*.deb` |
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` or `sudo dnf install ./CC-Switch-*.rpm` |
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
| Arch Linux / Manjaro | `.AppImage` | Add execute permission and run directly, or use AUR |
| Other distributions / Unsure | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
### macOS (Recommended)
The macOS version has been notarized and can be installed directly via Homebrew:
# Install CC Switch using Homebrew (notarized version)
brew install --cask cc-switch
### Windows
Download the .msi installer from (https://github.com/farion1231/cc-switch/releases/latest) and double-click to run it.
### Linux (Ubuntu/Debian)
# Install CC Switch deb package
sudo dpkg -i CC-Switch-*.deb
After installation, launch CC Switch. The main interface will appear on the desktop or in the system tray.
!(https://example.com/wp-content/uploads/2026/05/runooob_1780134395945.png)
> For more CC Switch content, refer to: [https://example.com/ai-agent/cc-switch.html](https://example.com/ai-agent/cc-switch.html)
* * *
## Step 2: Add DeepSeek Provider
Add DeepSeek as an API provider in CC Switch so that Codex requests can be forwarded to DeepSeek.
Follow these steps:
1. Open CC Switch and select Codex from the top application switcher.
2. Click + Add Provider in the left "Providers" section.
!(https://example.com/wp-content/uploads/2026/05/tutorial_1780134563766.png)
3. Search for DeepSeek in the preset list and select the corresponding preset (v3.16.0 comes with built-in DeepSeek V4 flash and pro versions).
!(https://example.com/wp-content/uploads/2026/05/tutorial_1780134647106.png)
4. After selecting, enter your DeepSeek API Key in the form below. Other fields can use the default values.
!(https://example.com/wp-content/uploads/2026/05/tutorial_1780134745759.png)
5. Remember to enable Local Routing Mapping, then click Save.
!(https://example.com/wp-content/uploads/2026/05/tutorial_1780134853096.png)
### Enable Routing
Switch to DeepSeek, and the system will prompt you to enable routing. You can click the settings button in the top left corner to enter the settings page and enable it:
!(https://example.com/wp-content/uploads/2026/05/tutorial_1780135076546.png)
Click the Routing Settings menu to enable routing:
!(https://example.com/wp-content/uploads/2026/05/tutorial_1780135200979.png)
Then select Codex:
!(https://example.com/wp-content/uploads/2026/05/tutorial_1780135291353.png)
Now when you reopen Codex, you will see the DeepSeek model logo:
!(https://example.com/wp-content/uploads/2026/05/tutorial_1780135600859.png)
* * *
## Choose Model: flash or pro?
DeepSeek V4 offers two versions with different use cases. Choosing the right model can balance cost and capability.
| Model | Features | Use Cases |
| --- | --- | --- |
| flash | Fast speed, low cost | Daily code completion, simple Q&A |
| pro | Strong capability, supports reasoning content | Complex architecture design, multi-step reasoning |
In the CC Switch provider editing interface, you can modify the model being used at any time. The changes take effect immediately without restarting Codex.
* * *
## FAQ
### Codex reports connection error after switching provider
Confirm that CC Switch's Local Routing is running (green icon).
If you just installed it, you may need to restart the terminal to apply the environment variables.
### Want to restore using the official OpenAI endpoint
Turn off Local Routing takeover in CC Switch, or switch to the official OpenAI provider. Codex will automatically use the original configuration.
### Does CC Switch record my API Key?
CC Switch is a local application, and all configurations are stored locally. The API Key is not uploaded to any server.
* * *
## More Resources
| Resource | Address |
| --- | --- |
| CC Switch Official Website | [ccswitch.io](https://ccswitch.io/) |
| GitHub Repository | [github.com/farion1231/cc-switch](https://github.com/farion1231/cc-switch) |
| v3.15.0 Release
YouTip