Verified scope: This guide was checked against the official DeepSeek and OpenAI documentation on 1 August 2026. I have not independently benchmarked DeepSeek V4 Flash or run the installer on your computer. Commands and configuration details below come from the linked primary sources; benchmark figures are identified as vendor-reported.
DeepSeek V4 Flash can now power Codex directly. That is the useful part of the 31 July update—not another benchmark chart, but a genuinely practical way to put a different model behind the coding tools many of us already use.
The setup is fairly short, but there are two details worth getting right. First, Codex support currently works with deepseek-v4-flash, not V4 Pro. Second, DeepSeek’s official Windows shortcut downloads a PowerShell script and executes it immediately. I would rather take an extra minute to inspect that script before running it. Convenience is lovely; blind trust is less lovely.
The short version
- Install and open Codex at least once.
- Create a DeepSeek API key and add a small balance.
- Download and inspect DeepSeek’s official Windows setup script.
- Run the script and select
deepseek-v4-flash. - Restart Codex and confirm that the CLI banner shows the DeepSeek model, or that the desktop app shows Custom.
- Start with a read-only repository task before allowing edits.
What changed on 31 July 2026?
DeepSeek released the updated DeepSeek-V4-Flash API in public beta and added native support for the Responses API used by Codex. DeepSeek says the 0731 release keeps the same architecture and size as the earlier V4 Flash model but received new post-training aimed at agent and coding work.
The company published strong coding-agent benchmark results, including 82.7 on Terminal Bench 2.1. Treat those as vendor-reported results, not a promise that every repository will suddenly become beautifully behaved. Real codebases have a talent for humbling benchmark tables.
As of this guide’s verification date, only deepseek-v4-flash supports the Responses API required for this integration. DeepSeek says V4 Pro support is expected in early August, but do not configure Pro until the official compatibility page confirms it is available.
What you need
- A Windows 10 or Windows 11 computer.
- Codex CLI, the ChatGPT desktop app, or the Codex extension for VS Code.
- PowerShell.
- A DeepSeek Platform account, API key and available API balance.
- A project folder you are allowed to analyse.
- A few minutes to inspect the downloaded script before running it.
Codex CLI, the desktop app and the IDE extension share the same user configuration file. One successful setup can therefore make the custom provider available across all three clients.
Step 1: Install or update Codex
If you already use Codex, check the installed version:
codex --versionDeepSeek’s supplied model catalogue declares Codex client version 0.144.0 as the minimum. Update Codex if your installation is older. If you use the Windows desktop app, OpenAI’s current Windows guide provides the official installer and setup instructions.
Launch Codex once before continuing. The DeepSeek installer expects your user configuration directory at %USERPROFILE%\.codex to already exist.
Step 2: Create a DeepSeek API key
- Sign in to the DeepSeek Platform.
- Create a new API key.
- Copy it immediately and store it in a password manager.
- Check that the account has enough balance for a small test.
Do not paste the key into screenshots, Git repositories, support tickets or a shared config.toml. The official manual configuration stores the key in your local Codex configuration file, so protect that file as you would any other credential.
How much does it cost?
At the time of checking, DeepSeek lists V4 Flash at US$0.14 per million uncached input tokens, US$0.0028 per million cached input tokens and US$0.28 per million output tokens. Prices can change, and DeepSeek has already flagged a future peak/off-peak policy, so check the live pricing page before a long coding session.
Agent work can consume more tokens than a normal chat because Codex reads files, calls tools and may revisit context. Start with a modest balance and watch usage instead of treating a low headline token price as an unlimited buffet.
Step 3: Back up your Codex configuration
DeepSeek’s installer creates its own backup, but making a simple copy first gives you an extra escape hatch:
$codexFolder = Join-Path $env:USERPROFILE ".codex"
$backupFolder = Join-Path $env:USERPROFILE "codex-backup-before-deepseek"
Copy-Item -LiteralPath $codexFolder -Destination $backupFolder -RecurseIf the destination already exists, choose a new folder name rather than overwriting an earlier backup.
Step 4: Download and inspect the official setup script
DeepSeek publishes this one-line PowerShell command:
irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iexThat pipes downloaded code straight into PowerShell. A safer reviewable approach is to save the same official script to a temporary file, inspect it, and then run it:
$deepSeekSetupUrl = "https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1"
$deepSeekSetupFile = Join-Path $env:TEMP "codex-deepseek-setup-en.ps1"
Invoke-WebRequest -Uri $deepSeekSetupUrl -OutFile $deepSeekSetupFile
Get-FileHash -Algorithm SHA256 $deepSeekSetupFile
Get-Content -LiteralPath $deepSeekSetupFile
# Run this only after you are satisfied with what the script changes.
& $deepSeekSetupFileThe hash gives you a record of the exact file you reviewed. DeepSeek does not publish a comparison hash on the guide, so the hash is for your own change tracking rather than third-party verification.
Step 5: Select DeepSeek V4 Flash
- Run the reviewed setup script.
- Enter your DeepSeek API key when prompted.
- Select
deepseek-v4-flash. - Choose a reasoning level. High is a sensible starting point; use Max only when the task justifies extra time and token use.
- Let the script validate and write the configuration.
According to DeepSeek, the script backs up config.toml, writes a custom models.json, adds the DeepSeek provider, preserves existing MCP servers and trust settings, and aborts without writing if its validation fails.
Step 6: Confirm that it worked
Close and reopen the Codex client. Then check the relevant surface:
- Codex CLI: enter a project folder, run
codexand check that the startup banner saysmodel: deepseek-v4-flash. - ChatGPT desktop app: the model picker displays Custom. DeepSeek’s documentation says this label represents the locally configured DeepSeek model.
- VS Code extension: start a new Codex session after the shared configuration has been updated.
For the first test, use a read-only prompt:
Inspect this repository without changing any files. Explain the project structure, identify the main entry point, and list the commands you would run to verify it.That confirms file reading, reasoning and tool planning without making the first experiment an unsupervised renovation of your codebase.
Manual configuration option
If you do not want to run the setup script, DeepSeek also documents a manual route. Download the current models.json content from the official integration page rather than copying an old version from a blog. Then add the provider settings to %USERPROFILE%\.codex\config.toml:
model = "deepseek-v4-flash"
model_provider = "deepseek"
preferred_auth_method = "apikey"
forced_login_method = "api"
model_reasoning_effort = "high"
model_catalog_json = "~/.codex/models.json"
[model_providers.deepseek]
name = "deepseek"
base_url = "https://api.deepseek.com/"
wire_api = "responses"
experimental_bearer_token = "YOUR_DEEPSEEK_API_KEY"The manual method is more transparent, but it is also easier to make a TOML or JSON typo. It stores the API key directly in the file, so never commit your user configuration or paste the file into a public issue.
How to switch back
Run the official setup script again and select its restore option. DeepSeek says option 3 restores the configuration saved under ~/.codex/backup-deepseek/. If that fails, close Codex and restore the separate backup folder you created before installation.
Troubleshooting
Codex cannot find deepseek-v4-flash
Check codex --version. The supplied model catalogue declares 0.144.0 as its minimum client version. Then confirm that %USERPROFILE%\.codex\models.json exists and that model_catalog_json points to it.
The desktop app only says “Custom”
That is expected. DeepSeek says the desktop app displays locally configured models as Custom. Use the CLI banner if you want a clearer confirmation of the exact model name.
DeepSeek V4 Pro does not work
Use deepseek-v4-flash. On 1 August 2026, the official compatibility and pricing pages still showed Responses API support only for Flash.
401 authentication error
DeepSeek defines 401 as a wrong API key. Create a new key, rerun the setup and make sure no spaces or quotation marks were copied with it.
402 insufficient balance
The API account has no usable balance. Add funds through the DeepSeek Platform, then retry the same small task.
429, 500 or 503 errors
A 429 response means requests are arriving too quickly. A 500 or 503 generally points to a temporary server problem or overload. Pause, retry once with a small task, and avoid building an aggressive retry loop.
PowerShell blocks the script
Do not disable security settings globally just to make a downloaded script run. Inspect the file, consult Microsoft’s PowerShell execution-policy guidance, or use the manual configuration route.
Privacy and security reality check
This is not a local-model setup. Codex sends model requests to api.deepseek.com. Do not use it with confidential client code, credentials, production data or regulated information unless your organisation has reviewed the provider, terms and data-handling requirements.
Keep Codex’s normal approval and sandbox controls enabled while testing a new provider. A cheaper model call is not a reason to give an agent unrestricted access to your entire computer.
Is DeepSeek V4 Flash worth using with Codex?
It is worth testing if you want another agentic coding model, care about API cost, or enjoy comparing how different models approach the same repository. I would not replace a proven workflow after one impressive demo. Give Flash a contained task, compare the diff and test results, then decide whether it earns a place in your toolkit.
If you prefer a fully local route, start with my guide to running Code Llama with Ollama on Windows. For tool-enabled local agents, see the llama.cpp MCP setup guide. You can also compare the broader landscape in the best coding LLMs for 2026.
Frequently asked questions
Does DeepSeek V4 Flash run locally inside Codex?
No. This integration uses DeepSeek’s hosted API. The separate open weights are available under an MIT licence, but V4 Flash is a large mixture-of-experts model and self-hosting is a different, hardware-intensive project.
Do I need to configure the CLI, app and VS Code separately?
No. DeepSeek and OpenAI both document the shared user-level Codex configuration. Configure it once and restart the clients you use.
Which reasoning level should I choose?
Start with High. Low is useful for fast, narrow jobs. Max is better reserved for difficult tasks where extra latency and token use are justified.
Can I keep my MCP servers and trusted projects?
DeepSeek says its installer preserves existing MCP server and project-trust settings while rewriting only conflicting provider fields. Keep the backup until you have verified that your particular configuration survived intact.