Buried inside DeepSeek’s July 31 V4-Flash release announcement is the most strategically interesting line: the official V4-Flash “natively supports the Responses API format and is fully adapted for Codex.”
Read that again. A Chinese open-weight lab just implemented OpenAI’s newest API format, the one OpenAI built for its own agent products, specifically so that OpenAI’s own coding agent can run on a DeepSeek model. The change log states the motivation plainly: “To meet the demand for Codex, our API now supports the Responses API format.”
This article covers what that means in practice: how compatible the implementation is, what’s silently ignored, how to wire V4-Flash into Codex in two minutes, and where the sharp edges are. If you just need basic API setup first, start with our V4-Flash public beta guide.
Why the Responses API matters here
OpenAI introduced the Responses API as the successor to Chat Completions: a single interface designed for agentic workloads, with first-class reasoning items, built-in tools, and semantic streaming events. We break the format down in How to use the OpenAI Responses API, but the short version is: it’s the format OpenAI’s agent stack, including Codex, speaks natively.
Until now, running a non-OpenAI model behind a Responses API client meant a translation proxy or nothing. DeepSeek skipped the proxy and implemented the format server-side at https://api.deepseek.com. Your existing OpenAI SDK works unchanged:
# pip3 install openai
from openai import OpenAI
client = OpenAI(
api_key="<your DeepSeek API key>",
base_url="https://api.deepseek.com"
)
response = client.responses.create(
model="deepseek-v4-flash",
instructions="You are a helpful assistant.",
input="Hi, how are you?",
)
print(response.output_text)
One scope note before you get excited: the Responses API currently works with deepseek-v4-flash only. DeepSeek says deepseek-v4-pro support arrives in early August 2026.

How complete is the compatibility?
DeepSeek published a full compatibility matrix, which is more than most “OpenAI-compatible” providers bother to do. The important rows:
Supported and working:
inputandinstructions, string or item-list formstreamwith the full semantic event sequencetemperature,top_p,max_output_tokens,top_logprobstoolswithfunctionandweb_searchtypes; web search executes server-sidetool_choiceincluding forcing a specific functionreasoning.effortfor thinking depth
Accepted but inert:
reasoning.summaryis accepted, but no summary is generatedtext.verbosityis accepted with no effectparallel_tool_callsis ignored because parallel tool calling is always on
Not supported, by design:
previous_response_idandconversation: the API is stateless, so you manage conversation history yourself and send it as an input item liststore: every response comes back withstore: falsebackground,metadata,include,service_tier, and prompt caching keys; context caching happens automatically instead
The graceful part: unsupported parameters are silently ignored rather than rejected, so existing Responses API clients connect without modification. The unforgiving part: requests that exceed the 1M-token context window return a 400 error instead of being truncated.
Streaming follows the Responses API event model, response.created through response.completed, with reasoning deltas (response.reasoning_text.delta) arriving as separate events from output text. There’s no data: [DONE] terminator; the stream ends with a response.completed, response.incomplete, or response.failed event. If your SSE handler waits for [DONE], it will hang. Our guide on streaming API responses with server-sent events covers defensive parsing patterns for exactly this kind of dialect difference.
Setting up Codex with DeepSeek-V4-Flash
Codex talks to models through the Responses API, which is the whole reason this release exists. DeepSeek’s integration guide offers two paths, and both configure every Codex client at once (CLI, ChatGPT desktop app, and the VS Code extension), since they share one config.
The one-click script
Make sure Codex CLI or the ChatGPT desktop app is installed and has run at least once, then:
bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.sh)
Windows users run the PowerShell variant:
irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iex
The script asks for your DeepSeek API key on first run, then does four things: backs up your existing ~/.codex/config.toml to ~/.codex/backup-deepseek/, writes a model catalog to ~/.codex/models.json, adds a [model_providers.deepseek] section to your config while preserving MCP servers and project trust settings, and validates the syntax before writing anything. Run it again anytime to switch models or restore your original setup from the menu.
Standard caution applies to piping curl into bash: read the script first if that’s your policy. The backup-and-validate behavior is a good sign, but it’s still a third-party script touching your Codex config.
What the model catalog tells you
The models.json the script writes is worth reading, because it documents how DeepSeek positions the model inside Codex:
- Context window: 1,048,576 tokens
- Reasoning levels:
low,high, andmax, withhighas the default - Parallel tool calls supported
- Requires Codex client version 0.144.0 or newer
The catalog describes V4-Flash as the “latest frontier agentic coding model,” and only deepseek-v4-flash works today. The catalog already includes deepseek-v4-pro for when support lands in early August.
Does it actually hold up inside Codex?
DeepSeek’s pitch is that the 0731 re-post-training was aimed at exactly this workload. Their published agent numbers: Terminal Bench 2.1 at 82.7, Cybergym at 76.7, Toolathlon verified at 70.3, DeepSWE at 54.4, all reported as beating V4-Pro-Preview. Treat these as vendor numbers until independent runs appear; they were produced with DeepSeek’s own harness at max effort, and two of the benchmarks in the announcement are internal test sets.
The economics are harder to argue with. At $0.14 per million input tokens (cache miss) and $0.28 per million output, V4-Flash costs a fraction of the models Codex normally runs, and cache hits drop input cost to $0.0028. A day of heavy agent sessions costs less than the coffee you drink during it. For the full cost table, see the pricing section of our beta guide. If you’re weighing Codex itself against alternatives, our Claude Code vs Codex CLI comparison covers the agent side of the equation.
Verify the endpoint before you trust the agent
An agent is only as debuggable as the API behind it, and a brand-new public beta endpoint deserves a shakedown before you let Codex loose on a real repository. This is a five-minute job in Apidog:
- Add
POST https://api.deepseek.com/responsesas an endpoint and store your key in an environment variable. - Send a minimal
responses.createpayload and confirm the shape of the output items: areasoningitem followed by amessageitem. - Turn on
stream: trueand watch the event sequence live. Apidog displays each SSE event as it arrives, which makes it obvious whether your client should be listening forresponse.output_text.deltaor waiting on something that never comes. - Save a request with a
functiontool attached and confirm thefunction_calloutput format matches what your handler expects.
When the V4-Pro Responses rollout lands in August, rerun the same saved requests against the new model name and diff the behavior. Download Apidog free and keep the whole suite in one project.
FAQ
Which DeepSeek models work with the Responses API? Only deepseek-v4-flash today. deepseek-v4-pro support is scheduled for early August 2026.
Do I need a new SDK? No. The official OpenAI SDK works; point base_url at https://api.deepseek.com and call client.responses.create. Setup details are in our V4-Flash public beta guide.
Does multi-turn state work like OpenAI’s version? No. The DeepSeek implementation is stateless: previous_response_id, conversation, and store are not supported. Send the full history as input items on every call.
Can I use DeepSeek in Codex alongside my OpenAI account? Yes. The setup adds DeepSeek as a model provider; the script’s menu switches between models, and your original config is backed up so you can restore it.
Is this the same as Anthropic API compatibility? Separate feature. DeepSeek also exposes an Anthropic-format endpoint at https://api.deepseek.com/anthropic, which is how Claude Code integration works. The Responses API endpoint exists for OpenAI-format agent tooling like Codex.
What this release really signals
Model quality is converging, so the competition is moving to the integration layer. DeepSeek looked at where developers actually live, inside agents like Codex, and built the exact plumbing needed to be a drop-in backend there, down to publishing which parameters are silently ignored. That transparency is rare, and it makes the compatibility story credible.
The play is obvious and smart: OpenAI ships the agent, DeepSeek serves the tokens at a tenth of the price. Whether the 0731 model genuinely outruns V4-Pro-Preview in your codebase is something only your own evals can answer. Wire it into Apidog, run your test suite against both, and let the results, not the benchmark table, decide.



