DeepSeek V4 Flash for Codex: Responses API Setup Guide
DeepSeek released the official DeepSeek-V4-Flash API public beta on July 31, 2026. The model keeps the architecture and size of V4-Flash Preview but receives new post-training focused on agent execution, coding, and tool use.
The key developer change is native support for the OpenAI Responses API and a dedicated Codex integration. DeepSeek's current documentation says deepseek-v4-flash is the only DeepSeek model that can connect directly to Codex. V4 Pro support is expected in a later update.
This gateway exposes deepseek-v4-flash through /v1/responses for Codex and other agent clients built on the Responses protocol.
What changed in DeepSeek-V4-Flash-0731
DeepSeek says DeepSeek-V4-Flash-0731 uses the same architecture and model size as V4-Flash Preview. The July 31 release changes post-training rather than the underlying structure. The V4 Pro API and DeepSeek's app and web models were not upgraded in this release.
| Item | Current information |
|---|---|
| Gateway model ID | deepseek-v4-flash |
| Release date | July 31, 2026 |
| Release status | Official API public beta |
| Main upgrade | Agent execution, coding, and tool use |
| Responses API | Natively supported |
| Codex | Officially adapted |
| Context | 1M in the gateway catalog |
| Gateway multiplier | 2.5x |
| Gateway reference rate | About CNY 1 per 1M tokens |
| Image input | Currently marked unsupported in the gateway catalog |
Model availability and rates can change. Recheck the live pricing page and model guide before production use.
Official agent benchmark results
DeepSeek published the following results for the official V4 Flash release:
| Benchmark | Official result |
|---|---|
| Terminal Bench 2.1 | 82.7 |
| NL2Repo | 54.2 |
| Cybergym | 76.7 |
| DeepSWE | 54.4 |
| Toolathlon verified | 70.3 |
| Agent Last Exam | 25.2 |
| Automation Bench (Public) | 25.1 |
| DSBench-FullStack | 68.7 |
| DSBench-Hard | 59.6 |
These results describe capability direction, not a guaranteed success rate for your repository. DeepSeek states that its public Code Agent evaluations used an unreleased minimal DeepSeek Harness, the max effort level, top_p=0.95, and temperature=1.0. DSBench-FullStack and DSBench-Hard are internal test sets.
For procurement, evaluate the model on pinned repositories, tools, permissions, and acceptance tests. Measure first-pass completion, tool failures, elapsed time, token usage, and engineer rework.
Responses API vs Chat Completions
Chat Completions works well for conversation, writing, translation, summarization, and simple coding questions. Its basic flow is a list of messages followed by generated text.
The Responses API is designed for agents and continued tool execution. A task can contain model output, function calls, terminal actions, tool results, and further reasoning. Codex uses this richer protocol to inspect code, edit files, run tests, and continue after each result.
| Capability | Chat Completions | Responses API |
|---|---|---|
| Chat and text generation | Good fit | Supported |
| Structured tool calls | Available | Native workflow |
| Continued multi-tool execution | Client-managed | Better fit |
| Codex integration | Not the Codex wire protocol | Required |
| Agent event structure | Simpler | Richer |
| Long engineering workflows | Extra orchestration | Core use case |
Use Chat Completions for simple, high-volume generation. Use /v1/responses when the workload needs Codex, MCP, terminal tools, or multi-step engineering execution.
Call DeepSeek V4 Flash through the Responses API
Start with a small request:
curl https://api.llm-token.cn/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"input": "Inspect this repository and propose the smallest fix for the failing tests."
}'
Verify the Base URL, API key, model ID, HTTP status, and response event structure before testing streaming, function calls, MCP, long context, or terminal-heavy tasks.
Do not substitute another DeepSeek model in Codex. DeepSeek currently documents only deepseek-v4-flash as Codex-compatible. Other model IDs may return protocol errors, fail tool calls, interrupt tasks, or produce incompatible event shapes.
Direct API and Codex client boundaries
DeepSeek's direct Responses API is currently stateless. Its documentation says previous_response_id, conversations, storage, and background mode are not supported. The server supports function tools, web search, and the custom apply_patch tool used by Codex, but ignores native mcp, file_search, code_interpreter, and computer_use tools. Image and file inputs are also unsupported.
Codex can still read files and run shell commands because the client orchestrates those tools locally and returns their results to the model. Test model API capabilities and client-side tool capabilities separately rather than treating them as the same layer.
Configure deepseek-v4-flash in Codex
Install or update Codex CLI:
npm install -g @openai/codex@latest
codex --version
Add a Responses provider to ~/.codex/config.toml:
model_provider = "llm-token"
model = "deepseek-v4-flash"
model_reasoning_effort = "high"
[model_providers.llm-token]
name = "LLM Token"
base_url = "https://api.llm-token.cn/v1"
wire_api = "responses"
requires_openai_auth = true
Provide the gateway API key through the secure authentication method supported by your Codex version. Never commit a real key to Git, paste it into example code, or expose it in logs.
Start with a read-only task:
Read the repository structure and list its build command, test command, and three main modules. Do not modify files.
Only grant file-write and shell permissions after the model, tool calls, and context handling work correctly. See the full Codex setup guide for installation details.
Recommended workloads
- Repository-level analysis, bug diagnosis, and scoped fixes
- Iterating on code after test failures
- Terminal commands, code search, and multi-step engineering tasks
- MCP servers, function calls, and external-tool orchestration
- Automated tests, code review, and migration planning
- Cost-sensitive development workloads that still need agent behavior
DeepSeek V4 Flash is more than a low-cost chat route. Its main value is bringing a lower gateway multiplier into Codex and agent workflows. Production agents still need permission boundaries, timeouts, retry limits, token budgets, and human takeover conditions.
Production validation checklist
- Copy the exact model ID,
deepseek-v4-flash, from the model guide. - Use
https://api.llm-token.cn/v1as the Base URL and set the Codex wire protocol toresponses. - Validate status, event structure, selected model, and billing with a short request.
- Use a read-only repository task to test file access, search, and context retention.
- Test shell, patches, function calls, MCP, and multi-round tool execution separately.
- Define explicit boundaries for files, databases, payments, deployments, and servers.
- Pin the repository, starting commit, dependencies, and acceptance commands for model comparisons.
- Record completion rate, P50/P95 duration, failure mix, and cost per accepted task.
Frequently asked questions
Does DeepSeek V4 Flash support Codex?
Yes. DeepSeek confirms that the official V4 Flash release natively supports the Responses API and is adapted for Codex. It currently documents deepseek-v4-flash as the only DeepSeek model supported in Codex.
Which endpoint should Codex use?
Use /v1/responses, not /v1/chat/completions. On this gateway, set the Base URL to https://api.llm-token.cn/v1 and configure wire_api = "responses".
Can DeepSeek V4 Pro run in Codex?
DeepSeek's documentation says V4 Pro is expected to support Codex in early August 2026. Do not treat it as compatible until the official API and gateway route confirm support.
How much does DeepSeek V4 Flash cost?
The current gateway catalog lists a 2.5x multiplier, or approximately CNY 1 per 1M tokens. The live pricing page and account ledger are authoritative.
Is the Responses API always better than Chat Completions?
No. Chat Completions is simpler for conversation and one-shot generation. Responses is most useful for Codex, MCP, tools, and continued engineering workflows.
Where can I purchase or recharge API access?
New customers can start on the buy page. Existing API key holders can use top-up. Begin with small, read-only, reversible tests.
Primary sources
- DeepSeek July 31, 2026 change log: release status, agent benchmarks, evaluation conditions, Responses API, and Codex support
- DeepSeek Codex integration guide: supported model and Codex integration boundary
- DeepSeek Responses API guide: protocol and request guidance
- Gateway model guide: current route ID, multiplier, context, and capability labels