Codex Deepseek Configuration -- Via CC Switch Relay
This article explains how to use CC Switch to let Codex use third-party models such as DeepSeek, Qwen, ZLM, and others.
CC Switch is a free, open-source, cross-platform desktop tool that lets you switch third-party API providers with one click in AI coding assistants like Codex, enabling you to use AI coding capabilities at lower cost.
Based on CC Switch v3.16.0 (installing the latest version is recommended), this article explains how to configure DeepSeek as the backend API for Codex; other models can follow the same configuration.
In addition to the official API interface, we can alsoCoding Plan/Token Planpackage to directly access mainstream large models such as DeepSeek, Kimi, GLM, Doubao, MiniMax, without needing to purchase each API separately.

How It Works
CC Switch starts a proxy service on your local machine, transparently forwarding requests from Codex to your specified backend (such as DeepSeek), then relaying the response back to Codex.
The entire forwarding process is completely transparent: to Codex, it still believes it is accessing the official OpenAI interface, when in fact the request has been forwarded by CC Switch to your specified third-party model service.

Prerequisites
Before starting the configuration, make sure you meet the following conditions:
| Conditional | Description |
|---|---|
| Codex is installed | Pass https://openai.com/zh-Hans-CN/codex/ Download and install |
| DeepSeek API Key | Go to platform.deepseek.com Register and obtain |
| Operating system | Windows 10+, macOS 12+, or a mainstream Linux distribution |
Step 1: Install CC Switch
The installer download address is https://github.com/farion1231/cc-switch/releases/latest, scroll to the bottom of the page to see download links for each platform:

Choose the installation method for 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 / not sure | .AppImage |
chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage |
macOS (recommended)
The macOS version is notarized and can be installed directly with Homebrew:
# Install CC Switch (notarized version) using Homebrew
brew install --cask cc-switch
Windows
From the GitHub Releases Download the .msi installer and double-click to run.
Linux(Ubuntu/Debian)
# Install CC Switch deb package
sudo dpkg -i CC-Switch-*.deb
After installation, launch CC Switch; the main interface appears on the desktop or in the system tray.

For more CC Switch content, see:https://www.runoob.com/ai-agent/cc-switch.html
Step 2: Add the DeepSeek provider
Add DeepSeek as an API provider in CC Switch so that Codex's requests can be forwarded to DeepSeek.
The steps are as follows:
-
Open CC Switch and select in the top app-switching bar Codex。
-
click in the left "Providers" area + Add Provider。

-
search in the preset list for DeepSeek, select the corresponding preset (v3.16.0 includes both DeepSeek V4 flash and pro versions).

-
After selecting, fill in your in the form below DeepSeek API Key, and leave the other fields at their default values.

-
Remember to enable local route mapping, then click Save。

Enable Routing
When switching to DeepSeek, the system prompts us to enable routing; we can click the settings button in the top-left to enter the settings page and enable it:

Click the route settings menu and enable routing:

Then select Codex:

Next, reopen Codex and you will see the DeepSeek model logo:

Choosing a model: flash or pro?
DeepSeek V4 offers two versions for different scenarios. Choosing the right model balances cost and capability.
| Model | Feature | Applicable scenarios |
|---|---|---|
| flash | Fast and low-cost | Daily code completion, simple Q&A |
| pro | Powerful, supports reasoning content | Complex architecture design, multi-step reasoning |
In CC Switch's provider editing interface, you can change the model at any time; changes take effect immediately without restarting Codex.
Common questions
Codex reports a connection error after switching providers
Confirm that CC Switch's Local Routing is running (green icon).
If you just installed it, you may need to restart the terminal for environment variables to take effect.
Want to switch back to the official OpenAI endpoint
In CC Switch, disable Local Routing takeover, or switch to the official OpenAI provider, and Codex will automatically use the original configuration.
Does CC Switch record my API Key?
CC Switch is a local application; all configuration is stored on your machine. API Keys are not uploaded to any server.
More resources
| Resource | Address |
|---|---|
| CC Switch official website | ccswitch.io |
| GitHub repository | github.com/farion1231/cc-switch |
| v3.15.0 release notes | Releases |
| DeepSeek platform | platform.deepseek.com |