Codex DeepSeek Switcher for OpenAI Codex and ChatGPT

A VS Code extension for OpenAI Codex and Codex CLI—including Codex profiles authenticated through ChatGPT—that switches the current local or Remote SSH environment between OpenAI and DeepSeek's native Responses API.
It keeps the normal OpenAI/ChatGPT Codex profile separate from the DeepSeek profile. The provider choice is shared by windows using the same OS account and home directory; it is not a per-window setting. Local Windows and a Linux SSH account with a separate home have separate mode files.
Download the latest VSIX · 中文说明 · Troubleshooting · Machine-readable summary · Report a bug

This is an independent community project. It is not affiliated with or endorsed by OpenAI, ChatGPT, DeepSeek, Microsoft, or Visual Studio Code.
Common questions this project answers
How do I use DeepSeek with OpenAI Codex in VS Code?
Install the VSIX and run Codex Source: Use DeepSeek Direct. The extension creates an isolated Codex home that connects directly to DeepSeek's Responses API.
How do I keep my ChatGPT login for Codex while testing DeepSeek?
The normal OpenAI/ChatGPT-authenticated Codex profile remains under .codex. DeepSeek uses a different profile under .codex-vscode-deepseek; the normal auth.json is not copied into the DeepSeek home. The DeepSeek config is derived from an existing config and can retain unrelated provider/MCP settings, including embedded values.
How do I switch Codex CLI providers independently on Remote SSH hosts?
Install the extension on each Remote SSH extension host. Each remote user home stores its mode and launcher. Hosts or aliases sharing the same home directory (for example over NFS) share these files. Codex Desktop is not reconfigured by this extension.
Is this a Codex proxy or MoonBridge relay?
No. DeepSeek mode uses https://api.deepseek.com/ with wire_api = "responses". It does not require MoonBridge, localhost forwarding, protocol disguise, or a shared relay process.
Why this exists
A one-environment provider setup is simple. Problems appear when Codex Desktop, a local VS Code window, and several Remote SSH windows need different providers at the same time.
Codex Desktop -> OpenAI / ChatGPT-authenticated Codex profile
Local VS Code -> OpenAI or DeepSeek Direct
Remote SSH host A -> OpenAI or DeepSeek Direct
Remote SSH host B -> OpenAI or DeepSeek Direct
DeepSeek mode connects directly to:
base_url = "https://api.deepseek.com/"
wire_api = "responses"
What it does
- Switches the current VS Code Codex environment between GPT (OpenAI) and DeepSeek Direct.
- Preserves the normal OpenAI or ChatGPT-authenticated Codex profile.
- Separates the local Windows mode from a remote Linux account's mode; windows sharing the same home share the provider choice.
- Supports
deepseek-v4-pro and deepseek-v4-flash.
- Detects and avoids older relay wrappers when the real Codex binary is available.
- Reports the active provider, model, endpoint, wire API, and Codex version without printing the API key.
- Preserves legacy command IDs so existing installations continue to work.
Prerequisites
- VS Code
1.80.0 or newer, with the OpenAI Codex extension (openai.chatgpt) installed in the same local/remote extension host. The launchers locate the binary bundled with that extension; an arbitrary codex on PATH alone is insufficient.
- A working Codex setup and an existing
~/.codex/config.toml (%USERPROFILE%\.codex\config.toml on Windows). Initialize Codex first; an empty config file is sufficient when its defaults suit your setup. A pre-existing DeepSeek config can also supply the remote source config.
- Local Windows x64: Windows PowerShell (
powershell.exe) with Add-Type/C# compilation available, plus a writable user directory already on PATH for the launcher shim.
- Remote SSH: a working Linux VS Code Server, Bash, Python 3 and GNU utilities (including
find, sed, install and chmod); install Codex and this extension under SSH: your-host.
- A DeepSeek API key and network access to
https://api.deepseek.com/ for DeepSeek mode. The extension does not configure network proxies or verify billing/model access.
Installation
Marketplace publication is not yet confirmed. Until it is available, install a checked VSIX from GitHub Releases or build one with npm run package:vsix. Once the listing is published, search for Codex DeepSeek Switcher and verify extension ID dzr.codex-local-model-switcher.
Local VS Code
- Download the
.vsix file from the latest release.
- Install it:
code --install-extension .\codex-local-model-switcher-0.2.7.vsix
The example uses the current source-build filename. The existing GitHub v0.2.7 release uses the older filename codex-direct-model-switcher-0.2.7.vsix; use the actual filename you downloaded.
Remote SSH
Install the VSIX on the remote extension host, not only in local VS Code:
code --remote ssh-remote+your-host `
--install-extension .\codex-local-model-switcher-0.2.7.vsix
You can also connect to the host and run Extensions: Install from VSIX..., then confirm that the extension appears under SSH: your-host.
Quick start
Open the command palette and run:
Codex Source: Switch GPT / DeepSeek Direct
Run Codex Source: Use DeepSeek Direct and confirm the selected environment. If the isolated config has no key, setup asks for one through VS Code's masked input; otherwise it reuses the stored key. Choose Reload current window when ready. Reloading is optional until you want new Codex processes to use the selected provider. To return, run Codex Source: Use GPT (OpenAI) and reload again.
| Command |
Purpose |
Codex Source: Switch GPT / DeepSeek Direct |
Toggle the current environment |
Codex Source: Use GPT (OpenAI) |
Restore the normal OpenAI/ChatGPT Codex profile |
Codex Source: Use DeepSeek Direct |
Activate the isolated DeepSeek profile |
Codex Source: Show Current Codex Source Status |
Verify provider, endpoint, model, and Codex version |
Codex Source: Reapply Current Codex Source Setup |
Repair the launcher or profile files |
How isolation works
| Environment |
OpenAI / ChatGPT Codex profile |
DeepSeek profile |
| Local Windows |
%USERPROFILE%\.codex |
%USERPROFILE%\.codex-vscode-deepseek |
| Remote SSH / Linux |
~/.codex |
~/.codex-vscode-deepseek |
The extension sets VS Code Codex's chatgpt.cliExecutable to codex-vscode-profile. The launcher selects the Codex home before starting Codex. These paths are fixed relative to the OS home; custom CODEX_HOME layouts are not preserved by the launcher.
Local mode is stored in %LOCALAPPDATA%\Codex-Direct-Model-Switcher\mode.txt; remote mode is ~/.codex-vscode-mode. Same-home windows and NFS-shared homes share state. Existing Codex processes keep their current environment until restarted. Activation may repair the launcher and setting even before a source switch; Linux setup also sets extensions.supportNodeGlobalNavigator for compatibility.
Verify direct mode
Run Codex Source: Show Current Codex Source Status. DeepSeek mode should report values equivalent to:
mode: deepseek
provider: deepseek
base_url: https://api.deepseek.com/
wire_api: responses
direct: true
The generated profile should contain:
model = "deepseek-v4-pro"
model_provider = "deepseek"
[model_providers.deepseek]
name = "deepseek"
base_url = "https://api.deepseek.com/"
wire_api = "responses"
It should not depend on localhost, 127.0.0.1:38440, or moonbridge.
Supported environments
| Component |
Status |
| Local Windows x64 with the VS Code Codex extension |
Supported implementation |
| Codex profiles authenticated through ChatGPT |
Preserved and isolated from DeepSeek |
| VS Code Remote SSH to Linux |
Supported |
| Codex CLI |
0.144.0 or newer recommended |
| Remote prerequisites |
Linux, Bash, Python 3, GNU utilities and the remote Codex extension |
| Local macOS/Linux, WSL, Dev Containers, Codespaces, browser-only VS Code |
Not supported by this implementation |
| DeepSeek models |
deepseek-v4-pro, deepseek-v4-flash |
Security boundaries
- API keys are not placed on the process command line or printed to the output channel.
- The DeepSeek key is stored in plaintext as
experimental_bearer_token in the isolated config.toml. Masked input is not encryption; VS Code SecretStorage is not used. Linux config files use mode 0600; Windows protection depends on inherited filesystem ACLs.
- Setup may create temporary remote config files and retained config/auth backups. Switching back to OpenAI does not erase the DeepSeek key or backups.
- The extension does not copy the key into the normal OpenAI/ChatGPT Codex profile.
- No local configuration is uploaded to this repository.
- Issue reports should contain redacted status output only.
See Privacy, Security, and Troubleshooting. Never upload full config files: derived configs can retain other provider/MCP credentials.
Search and machine-readable discovery
For tools and crawlers, the repository provides:
llms.txt: concise project identity, aliases, capabilities, installation, and canonical links;
docs/index.html: a static, metadata-rich landing page ready for GitHub Pages;
AGENTS.md: repository instructions for OpenAI Codex and other coding agents;
docs/sitemap.xml: the sitemap for the optional GitHub Pages site.
Useful search phrases include OpenAI Codex DeepSeek switcher, ChatGPT Codex model switcher, use DeepSeek with Codex, VS Code Codex provider switcher, and Codex Remote SSH profile isolation.
Development
npm run verify
On Linux, also run:
npm run test:remote
Use Node.js 24 and npm. Inspect the package contents, then create a local VSIX:
npm run package:list
npm run package:vsix
Output: dist/codex-local-model-switcher-0.2.7.vsix. The included docs/PUBLISHING.md guide covers checked packaging, manual Marketplace upload, versioning and account-holder steps.
Pull requests run syntax checks, unit tests, Remote SSH helper tests, and a packaging smoke test.
Bug reports and focused pull requests are welcome. If this extension solves your multi-provider Codex setup, starring the repository helps other OpenAI Codex and ChatGPT users find it.