# DeepSeek V4 Flash 0731: Codex and Responses API Guide

> Use DeepSeek V4 Flash 0731 with Codex and Responses API. Compare official benchmarks, pricing, open weights, compatibility limits, and migration checks.

- **Published**: 2026-07-31
- **Category**: AI Infrastructure
- **URL**: https://agentpedia.codes/blog/deepseek-v4-flash-0731-codex-responses-api-guide

---

> **Important callout**

**Bottom line:** DeepSeek-V4-Flash-0731 is a public-beta API update and MIT-licensed open-weight release aimed at coding agents. It keeps the preview model's core architecture and size, adds native Responses API support, and has an official Codex configuration path. Use the exact API model name `deepseek-v4-flash`, but treat the launch benchmarks as vendor-reported system results: DeepSeek tested the new model with an unreleased harness for public code-agent tasks, and two benchmark rows are internal.

DeepSeek released the official [DeepSeek-V4-Flash API update](https://api-docs.deepseek.com/updates/) on **July 31, 2026**, then published the [DeepSeek-V4-Flash-0731 weights](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731) later that day. The practical change is not a new application model or a larger core architecture. It is a re-post-trained Flash checkpoint served through the existing API name and released for self-hosting, with stronger agent behavior and a new compatibility layer for clients built around the Responses API.

This guide uses official DeepSeek sources reviewed on July 31, 2026: the launch thread, API changelog, Responses compatibility table, Codex integration guide, current pricing page, April V4 preview release, and 0731 model card. No paid DeepSeek request was made for this article, no self-hosted inference was attempted, and the unreleased DeepSeek Harness could not be independently reproduced.

> DeepSeek-V4-Flash Official API is now live in public beta. DeepSeek says it upgraded agent capabilities, added native Responses API support, and adapted the model for Codex.
>
> -- [@deepseek_ai, July 31, 2026](https://x.com/deepseek_ai/status/2083084415157022911)

## What DeepSeek launched

The July update changes one API product and leaves several similarly named surfaces alone.

| Surface | Status on July 31, 2026 | What developers should assume |
| --- | --- | --- |
| `deepseek-v4-flash` API | Official Flash 0731 update in public beta | Calls to this model name use the updated checkpoint |
| Responses API | Supported for `deepseek-v4-flash` | Compatibility is partial and stateless; inspect the limits below |
| Codex integration | Supported for `deepseek-v4-flash` | Uses DeepSeek's Responses endpoint and a custom Codex model catalog |
| `deepseek-v4-pro` API | Unchanged from the prior preview state | Responses API and Codex support are not available yet |
| DeepSeek app and web models | Unchanged by this release | Do not infer that app sessions received Flash 0731 |
| Open weights | Public, ungated `deepseek-ai/DeepSeek-V4-Flash-0731` repository | The model card lists an MIT license and a DSpark speculative-decoding module; self-hosting requires separate hardware and runtime validation |

DeepSeek's [official follow-up in the launch thread](https://x.com/deepseek_ai/status/2083084419515220191) says the upgrade applies **only** to the V4 Flash API. It also says the official V4 Pro release will follow, without giving a date. The [Responses documentation](https://api-docs.deepseek.com/guides/responses_api/) separately says V4 Pro support is expected in early August 2026. Treat that as a target, not a guaranteed release date.

The stable request name is:

```text
deepseek-v4-flash
```

DeepSeek's [API landing page](https://api-docs.deepseek.com/) says this name now resolves to model version **DeepSeek-V4-Flash-0731**. The versioned suffix is useful in evaluation records, while the API request continues to use the unversioned model name.

## What changed--and what stayed the same

DeepSeek describes 0731 as a **re-post-training update**. The company says it preserves the same core architecture and size as V4-Flash-Preview. The April [DeepSeek V4 preview release](https://api-docs.deepseek.com/news/news260424/) identifies Flash as a mixture-of-experts model with **284 billion total parameters and 13 billion active parameters**. The [0731 model card](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731) adds an operational detail: the released package uses the V4-Flash-DSpark structure and includes a speculative-decoding module. That does not change the documented 284B/13B core-model figures, but it matters for local serving.

| Area | V4-Flash-Preview | V4-Flash-0731 | Migration implication |
| --- | --- | --- | --- |
| Architecture and size | 284B total / 13B active, according to the V4 preview release | Same, according to the July changelog and thread | Do not market 0731 as a new model architecture |
| API model name | `deepseek-v4-flash` | `deepseek-v4-flash` | Existing explicit Flash calls need no model-string change |
| Context length | 1M tokens | 1M tokens | Preserve context tests and truncation guards |
| Maximum output | 384K tokens | 384K tokens | Keep application-level output limits; the maximum is not a sensible default |
| Thinking modes | Thinking and non-thinking | Thinking and non-thinking | Hold reasoning mode constant during A/B tests |
| Responses API | Not documented for the preview | Supported, with limits | Add protocol-specific regression tests before switching a client |
| Codex | No native official path documented | Official integration guide available | Configuration still changes local Codex files and credentials |
| Agent behavior | Preview baseline | New post-training and higher vendor-reported scores | Re-run repository tasks; architecture parity does not imply behavior parity |

The old aliases deserve attention. DeepSeek's April release documented that `deepseek-chat` and `deepseek-reasoner` would be retired after **July 24, 2026 at 15:59 UTC**. That deadline has passed. New and migrated applications should use `deepseek-v4-flash` or `deepseek-v4-pro` explicitly rather than treating a legacy alias as a durable compatibility layer.

## Read the agent benchmarks correctly

DeepSeek published nine agent evaluations in the launch chart. The table below transcribes the official values so the evidence remains crawlable and does not depend on the X image.

| Benchmark | V4 Flash 0731 | V4 Flash Preview | V4 Pro Preview | GLM-5.2 | Opus-4.8 |
| --- | ---: | ---: | ---: | ---: | ---: |
| Terminal-Bench 2.1 | 82.7 | 61.8 | 72.1 | 81.0 | 85.0 |
| NL2Repo | 54.2 | 39.4 | 38.5 | 48.9 | 69.7 |
| CyberGym | 76.7 | 38.7 | 52.7 | -- | 83.1 |
| DeepSWE | 54.4 | 7.3 | 12.8 | 46.2 | 58.0 |
| Toolathlon-Verified | 70.3 | 49.7 | 55.9 | 59.9 | 76.2 |
| Agents' Last Exam | 25.2 | 15.8 | 16.5 | 23.8 | 25.7 |
| AutomationBench (Public) | 25.1 | 10.8 | 12.8 | 12.9 | 27.2 |
| DSBench-FullStack | 68.7 | 37.0 | 41.8 | 61.8 | 71.6 |
| DSBench-Hard | 59.6 | 25.8 | 31.1 | 54.5 | 71.7 |

Relative to Flash Preview, the vendor-reported increases range from **9.4 points on Agents' Last Exam to 47.1 points on DeepSWE**. Those are large deltas, but the chart does not establish a controlled model-only comparison.

> **Warning callout**

**The harness is part of the result.** DeepSeek says V4 Flash 0731 used its upcoming DeepSeek Harness in minimal mode for public code-agent tasks, with `max` reasoning effort, `top_p=0.95`, and `temperature=1.0`. The harness has not been released, and the chart does not document identical scaffolding for every comparison column. Do not turn these values into an independent leaderboard.

Two rows need an additional qualifier: DeepSeek identifies **DSBench-FullStack** and **DSBench-Hard** as internal benchmark sets. The company describes them as full-stack development and hard coding-agent challenges, but outside readers cannot inspect the complete task set, contamination controls, grader, or failure distribution from the launch material.

The results are still useful for one decision: agent workflows are the intended improvement target. A team already using Flash Preview has a strong reason to test 0731 on the same repositories, tool schemas, budgets, and acceptance tests. The chart does not remove the need for that test.

## Pricing and availability

The following values come from DeepSeek's live [Models & Pricing page](https://api-docs.deepseek.com/quick_start/pricing/) on July 31, 2026. Prices are USD per one million tokens.

| Item | DeepSeek V4 Flash 0731 | Operational note |
| --- | ---: | --- |
| Cached input | $0.0028 | Cache management is automatic in the Responses API |
| Uncached input | $0.14 | Long agent contexts can still dominate total cost |
| Output | $0.28 | Includes ordinary and reasoning output billed by the API |
| Listed concurrency limit | 2,500 | Treat account-level behavior and rate isolation as deployment-specific |
| Context length | 1M tokens | Requests over the window return `400`; Responses truncation is unsupported |
| Maximum output | 384K tokens | Set a smaller task-specific `max_output_tokens` |
| Release status | Public beta | Keep a rollback provider/model while behavior stabilizes |

DeepSeek has announced that a peak/off-peak policy will later charge **2x regular prices** during 09:00-12:00 and 14:00-18:00 Beijing time. The pricing page does not give an effective date. Budget code should therefore store the price retrieval date and refresh the live page rather than assuming today's rate is permanent.

## Call DeepSeek through the Responses API

DeepSeek uses the same base URL for Chat Completions and Responses:

```text
https://api.deepseek.com
```

The smallest Python request, adapted from DeepSeek's official example, is:

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DEEPSEEK_API_KEY"],
    base_url="https://api.deepseek.com",
)

response = client.responses.create(
    model="deepseek-v4-flash",
    instructions="Review the patch. Report correctness risks before style issues.",
    input="""
Repository context: Python API service
Task: Review this small, non-secret diff.

[paste the diff here]
""",
    reasoning={"effort": "high"},
    max_output_tokens=4000,
)

print(response.output_text)
```

Install the current OpenAI Python SDK in an isolated environment and keep the key outside source control:

```bash
python -m venv .venv
. .venv/bin/activate
python -m pip install -U openai
export DEEPSEEK_API_KEY="replace-with-a-project-key"
```

This sample was reviewed against the official Responses documentation but was **not executed against a billed endpoint** for this article.

Streaming uses semantic Server-Sent Events. DeepSeek documents `response.output_text.delta` for text chunks and terminal events such as `response.completed`, `response.incomplete`, and `response.failed`. The stream does not use the older `[DONE]` data sentinel. A client ported from Chat Completions must terminate on the Responses event sequence instead.

## Know the compatibility limits

"Responses API compatible" does not mean every OpenAI Responses feature behaves the same way. DeepSeek's compatibility table is explicit, and several unsupported parameters are silently ignored.

| Capability | DeepSeek status | Production consequence |
| --- | --- | --- |
| Text input and output | Supported | Normal text-agent workflows can migrate |
| Streaming | Supported | Parse semantic SSE events, including failure and incomplete endings |
| Function tools | Supported | Validate schemas and replay tool results in a frozen integration test |
| Server-side web search | Supported | `search_context_size` and `user_location` are ignored |
| `apply_patch` custom tool | Supported for Codex compatibility | Other custom tool names return `400` |
| Reasoning effort | Supported | Reasoning summary is accepted but no summary is generated |
| Structured text format | Supported | `verbosity` is accepted but has no effect |
| `previous_response_id` and `conversation` | Not supported | The API is stateless; the client must carry required history |
| `store` | Not supported; always false | Do not design around server-retained response state |
| Background mode | Not supported | Long jobs need your own queue, deadline, retry, and status store |
| Image and file input | Not supported | Image parts are replaced with placeholder text instead of producing a hard failure |
| MCP, computer use, file search, code interpreter | Ignored | Do not infer tool execution from a successful HTTP response |
| Truncation | Not supported | Over-window requests return `400`; compact before sending |
| `parallel_tool_calls` | Ignored; always enabled | Your executor must tolerate multiple tool calls safely |
| `max_tool_calls` | Ignored | Enforce tool and cost budgets in your own orchestration layer |

Silent ignoring is the most important integration hazard. A request can succeed while a safety, storage, tool, or context parameter did nothing. Before migration, capture the outbound request, assert the returned tool types, and fail closed when a required capability is absent.

Image input is especially easy to misread. DeepSeek says an `input_image` part does not cause an error; it is replaced with placeholder text. A coding agent that expects to inspect screenshots could therefore produce a plausible answer without seeing the image. Reject unsupported modalities in the client before the request leaves your system.

## Configure DeepSeek in Codex

DeepSeek's [Codex integration guide](https://api-docs.deepseek.com/quick_start/agent_integrations/codex/) supports Codex CLI, the ChatGPT desktop app, and the Codex extension for VS Code through their shared `~/.codex` configuration. That file is global to those clients: changing the default model or provider for one changes what the others read. As of the July 31 documentation, only `deepseek-v4-flash` is supported; V4 Pro is expected later.

The DeepSeek model catalog sets Codex client version **0.144.0** as the minimum for Flash. Check before changing anything:

```bash
codex --version
```

Stop and upgrade if the installed client is older than `0.144.0`; the catalog cannot upgrade the client for you.

> **Warning callout**

**The setup script changes global Codex state.** It writes `~/.codex/models.json`, rewrites necessary fields in `~/.codex/config.toml`, removes conflicting fields, adds the DeepSeek provider, and stores the submitted API key directly as `experimental_bearer_token`. It also makes a backup under `~/.codex/backup-deepseek/`, but that backup may contain pre-existing credentials. Inspect the script and make your own protected backup before running it.

For macOS or Linux, download and inspect the script first:

```bash
cp -a ~/.codex ~/.codex.pre-deepseek

curl -fsSL \
  https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.sh \
  -o /tmp/codex-deepseek-setup-en.sh

less /tmp/codex-deepseek-setup-en.sh
bash /tmp/codex-deepseek-setup-en.sh
```

DeepSeek requires Codex or the desktop app to have been launched once so `~/.codex` exists. Do not run the script if overwriting the default provider for all three clients is outside your intended scope.

After setup, remove the plaintext `experimental_bearer_token` entry and use Codex's documented environment-variable provider setting instead:

```toml
[model_providers.deepseek]
name = "deepseek"
base_url = "https://api.deepseek.com/"
wire_api = "responses"
env_key = "DEEPSEEK_API_KEY"
```

```bash
export DEEPSEEK_API_KEY="replace-with-a-dedicated-revocable-key"
chmod 600 ~/.codex/config.toml ~/.codex/models.json
```

OpenAI's [Codex configuration reference](https://developers.openai.com/codex/config-reference) discourages direct bearer-token storage and recommends `env_key`. Desktop apps and IDEs do not always inherit variables from an interactive shell; provide the variable through a trusted OS or editor environment rather than putting the key back in the file. Protect or delete credential-bearing backups when they are no longer needed.

Then verify the result:

1. Open `~/.codex/config.toml` and confirm the provider base URL is `https://api.deepseek.com/`, `wire_api` is `responses`, and no plaintext API key remains.
2. Confirm the default model is `deepseek-v4-flash`.
3. Start Codex in a disposable repository and verify the startup banner names `deepseek-v4-flash`.
4. Run a read-only task first, then a small patch with tests and a clean rollback.
5. Restore your protected `~/.codex` backup if model selection, authentication, MCP configuration, or project trust differs from the pre-change state.

`wire_api = "responses"` selects Codex's transport. It does not prove support for every Responses feature or every model in the custom catalog. DeepSeek currently documents Codex protocol support only for Flash; a listed Pro entry is not proof that Pro works.

## Migration checklist

Use this checklist when moving an existing DeepSeek or Responses-based agent:

- Replace retired `deepseek-chat` or `deepseek-reasoner` aliases with an explicit supported model name.
- Record both request name `deepseek-v4-flash` and observed version `DeepSeek-V4-Flash-0731` in evaluation metadata where available.
- Keep reasoning mode, effort, sampling, tool definitions, iteration budget, and task corpus fixed during comparisons.
- Do not compare a bare model call against the vendor's harness-assisted benchmark as if the configurations match.
- Treat the API as stateless; carry only the history needed for the next turn and compact before the 1M window.
- Reject image and file input locally instead of accepting placeholder substitution.
- Allow-list supported tools. Fail when an MCP, computer-use, code-interpreter, or file-search requirement would be ignored.
- Enforce maximum tool calls, wall-clock time, token budget, and spend in your own controller.
- Parse `response.failed` and `response.incomplete`; do not wait for a Chat Completions `[DONE]` marker.
- Validate structured output and function arguments before executing any side effect.
- Store the pricing-page retrieval date and account for announced future peak pricing.
- Keep the previous provider or model path available until repository-level tests, cost, latency, and failure handling pass.

## Run a smoke test that produces a decision

Benchmark the integration, not just the answer text.

| Workload | Suggested corpus | Acceptance checks | Operational measurements |
| --- | --- | --- | --- |
| Repository issue repair | 20 closed issues with hidden tests | Tests pass, no unrelated edits, reviewer accepts diff | Tool calls, retries, elapsed time, tokens, cost |
| Tool schema fidelity | 50 function-calling cases | Correct tool, valid arguments, no fabricated execution | Invalid-call rate, parallel calls, recovery turns |
| Long-context code review | 20 repositories or large diffs | Finds planted risks, cites correct files, abstains when evidence is absent | Input/cache tokens, latency, context errors |
| Stateless multi-turn work | 30 tool loops | Required history preserved, stale history removed, no state assumption | Payload growth, compactions, failed continuations |
| Unsupported-feature guard | Image, MCP, background, and over-window fixtures | Client rejects each before execution | False-success rate must be zero |

Pre-register a threshold. A practical first gate might require no regression in hidden-test pass rate, zero unsupported-tool false successes, no increase in unrelated diff lines, and lower cost per accepted task. Average benchmark scores cannot compensate for one unsafe tool execution or a client that silently discards required input.

Roll out in stages: offline evaluation, shadow traffic, a small internal cohort, capped production traffic, and full adoption only after the failure distribution remains acceptable. Public beta is a reason to preserve a rollback path even if the first results are strong.

## Use it now or wait?

**Evaluate V4 Flash 0731 now** if you already use DeepSeek's API for coding agents, need a low-priced text model, or want to connect Codex to a non-OpenAI Responses provider. The unchanged model name, 1M context, official Codex path, and documented function/web-search support make a controlled trial straightforward.

**Wait before broad migration** if your workflow requires image or file understanding, server-stored conversations, background tasks, MCP, computer use, or exact parity with the full OpenAI Responses surface. A successful HTTP response can hide an ignored feature, so compatibility gaps belong in client validation--not in operational folklore.

**Do not adopt from the benchmark chart alone.** DeepSeek's numbers indicate the update deserves testing, especially on code-agent tasks. The unreleased harness, internal benchmark rows, and incomplete cross-column methodology mean your frozen task corpus remains the adoption gate.

For the previous model generation and older architecture context, see the [DeepSeek V3.2 guide](/blog/deepseek-v3-2-guide). For another Responses-oriented coding-agent migration, compare the [Codex CLI upgrade and migration guide](/blog/codex-cli-0-145-upgrade-migration-guide).

## FAQ

### What is DeepSeek V4 Flash 0731?

DeepSeek-V4-Flash-0731 is the July 31, 2026 post-trained update behind the deepseek-v4-flash API model name and an MIT-licensed open-weight release. DeepSeek says it keeps the preview model's core architecture and size while improving agent behavior; the released package also includes a DSpark speculative-decoding module. The API release is in public beta.

### Are DeepSeek V4 Flash 0731 weights available for download?

Yes. DeepSeek published a public, ungated Hugging Face repository for deepseek-ai/DeepSeek-V4-Flash-0731 on July 31, 2026. Its model card lists an MIT license, dedicated encoding tools, and vLLM guidance. Local deployment still requires independent hardware, runtime, and output validation.

### What model name should I send to the DeepSeek API?

Use deepseek-v4-flash. DeepSeek's API documentation says that model name now routes to DeepSeek-V4-Flash-0731. The older deepseek-chat and deepseek-reasoner names reached their documented retirement date on July 24, 2026.

### Does DeepSeek V4 Flash support the Responses API?

Yes, but only a documented subset. Function tools, server-side web search, streaming, reasoning effort, and structured text formats are supported. Stored conversations, previous_response_id, background mode, image and file input, MCP, computer use, and several other features are not supported or are ignored.

### Can DeepSeek V4 Pro use the Responses API or Codex integration?

Not as of July 31, 2026. DeepSeek documents Responses API and Codex support only for deepseek-v4-flash and says V4 Pro support is expected in early August 2026.

### How much does DeepSeek V4 Flash cost?

As of July 31, 2026, DeepSeek lists $0.0028 per million cached input tokens, $0.14 per million uncached input tokens, and $0.28 per million output tokens. DeepSeek has also announced future peak pricing at twice the regular rate but has not published the effective date.

### Do the V4 Flash benchmark results prove it is better than every compared model?

No. The scores are vendor-reported, only the new Flash column is explicitly tied to DeepSeek's unreleased harness for public code-agent tasks, and two rows are internal DeepSeek benchmarks. Treat them as a reason to run a controlled evaluation, not an independent model ranking.


---

[Join the Agentpedia newsletter](https://agentpedia.codes/blog)

## Official sources and further reading

### DeepSeek release and API documentation

- [DeepSeek V4 Flash July 31 changelog](https://api-docs.deepseek.com/updates/) -- public-beta status, post-training scope, official benchmark values, harness notes, and unaffected products
- [DeepSeek Responses API guide](https://api-docs.deepseek.com/guides/responses_api/) -- supported models, request fields, streaming events, tools, unsupported parameters, and response shape
- [DeepSeek Codex integration guide](https://api-docs.deepseek.com/quick_start/agent_integrations/codex/) -- setup scripts, model catalog, shared Codex configuration, minimum client version, validation, and restore path
- [DeepSeek Models & Pricing](https://api-docs.deepseek.com/quick_start/pricing/) -- current model version, context/output limits, features, concurrency, token prices, and future peak-pricing notice
- [DeepSeek API quick start](https://api-docs.deepseek.com/) -- current base URLs and model-name routing
- [DeepSeek V4 Preview release](https://api-docs.deepseek.com/news/news260424/) -- April model sizes, architecture context, interfaces, 1M context, and legacy alias retirement
- [DeepSeek V4 technical report](https://arxiv.org/abs/2606.19348) and [official V4 Pro model card](https://huggingface.co/deepseek-ai/DeepSeek-V4-Pro) -- primary V4 architecture, training, model-size, context, and artifact documentation
- [DeepSeek V4 Flash 0731 model card and weights](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731) -- official downloadable release, benchmark notes, DSpark serving structure, encoding guidance, and MIT license
- [DeepSeek V4 open-weight collection](https://huggingface.co/collections/deepseek-ai/deepseek-v4) -- official V4 model collection, including the 0731 release

### Official social posts

- [DeepSeek V4 Flash 0731 announcement](https://x.com/deepseek_ai/status/2083084415157022911) -- public-beta announcement, Responses/Codex positioning, and official benchmark chart
- [DeepSeek launch-thread scope note](https://x.com/deepseek_ai/status/2083084419515220191) -- unchanged architecture/size and confirmation that V4 Pro plus app/web models were not upgraded

### Official OpenAI Codex documentation

- [Codex configuration reference](https://developers.openai.com/codex/config-reference) -- custom-provider environment variables and the recommendation to avoid direct bearer-token storage

### Related AgentPedia guides

- [DeepSeek V3.2 developer guide](/blog/deepseek-v3-2-guide)
- [Codex CLI upgrade and migration guide](/blog/codex-cli-0-145-upgrade-migration-guide)
- [Gemini 3.6 Flash API and benchmark guide](/blog/gemini-3-6-flash-developer-guide)

[Browse related Agentpedia articles](https://agentpedia.codes/blog)


---

- [All articles](https://agentpedia.codes/blog)