AI Infrastructure

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.

Glowing AI model core connecting a coding-agent workflow to API function, code, search, and routing tools
AgentPedia illustration of DeepSeek V4 Flash connecting coding-agent workflows to Responses API tools. View image source.

DeepSeek released the official DeepSeek-V4-Flash API update on July 31, 2026, then published the DeepSeek-V4-Flash-0731 weights 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.

What DeepSeek launched

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

SurfaceStatus on July 31, 2026What developers should assume
deepseek-v4-flash APIOfficial Flash 0731 update in public betaCalls to this model name use the updated checkpoint
Responses APISupported for deepseek-v4-flashCompatibility is partial and stateless; inspect the limits below
Codex integrationSupported for deepseek-v4-flashUses DeepSeek's Responses endpoint and a custom Codex model catalog
deepseek-v4-pro APIUnchanged from the prior preview stateResponses API and Codex support are not available yet
DeepSeek app and web modelsUnchanged by this releaseDo not infer that app sessions received Flash 0731
Open weightsPublic, ungated deepseek-ai/DeepSeek-V4-Flash-0731 repositoryThe 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 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 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:

deepseek-v4-flash

DeepSeek's API landing page 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 identifies Flash as a mixture-of-experts model with 284 billion total parameters and 13 billion active parameters. The 0731 model card 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.

AreaV4-Flash-PreviewV4-Flash-0731Migration implication
Architecture and size284B total / 13B active, according to the V4 preview releaseSame, according to the July changelog and threadDo not market 0731 as a new model architecture
API model namedeepseek-v4-flashdeepseek-v4-flashExisting explicit Flash calls need no model-string change
Context length1M tokens1M tokensPreserve context tests and truncation guards
Maximum output384K tokens384K tokensKeep application-level output limits; the maximum is not a sensible default
Thinking modesThinking and non-thinkingThinking and non-thinkingHold reasoning mode constant during A/B tests
Responses APINot documented for the previewSupported, with limitsAdd protocol-specific regression tests before switching a client
CodexNo native official path documentedOfficial integration guide availableConfiguration still changes local Codex files and credentials
Agent behaviorPreview baselineNew post-training and higher vendor-reported scoresRe-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.

BenchmarkV4 Flash 0731V4 Flash PreviewV4 Pro PreviewGLM-5.2Opus-4.8
Terminal-Bench 2.182.761.872.181.085.0
NL2Repo54.239.438.548.969.7
CyberGym76.738.752.783.1
DeepSWE54.47.312.846.258.0
Toolathlon-Verified70.349.755.959.976.2
Agents' Last Exam25.215.816.523.825.7
AutomationBench (Public)25.110.812.812.927.2
DSBench-FullStack68.737.041.861.871.6
DSBench-Hard59.625.831.154.571.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.

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 on July 31, 2026. Prices are USD per one million tokens.

ItemDeepSeek V4 Flash 0731Operational note
Cached input$0.0028Cache management is automatic in the Responses API
Uncached input$0.14Long agent contexts can still dominate total cost
Output$0.28Includes ordinary and reasoning output billed by the API
Listed concurrency limit2,500Treat account-level behavior and rate isolation as deployment-specific
Context length1M tokensRequests over the window return 400; Responses truncation is unsupported
Maximum output384K tokensSet a smaller task-specific max_output_tokens
Release statusPublic betaKeep a rollback provider/model while behavior stabilizes

DeepSeek has announced that a peak/off-peak policy will later charge 2× 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:

https://api.deepseek.com

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

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:

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.

CapabilityDeepSeek statusProduction consequence
Text input and outputSupportedNormal text-agent workflows can migrate
StreamingSupportedParse semantic SSE events, including failure and incomplete endings
Function toolsSupportedValidate schemas and replay tool results in a frozen integration test
Server-side web searchSupportedsearch_context_size and user_location are ignored
apply_patch custom toolSupported for Codex compatibilityOther custom tool names return 400
Reasoning effortSupportedReasoning summary is accepted but no summary is generated
Structured text formatSupportedverbosity is accepted but has no effect
previous_response_id and conversationNot supportedThe API is stateless; the client must carry required history
storeNot supported; always falseDo not design around server-retained response state
Background modeNot supportedLong jobs need your own queue, deadline, retry, and status store
Image and file inputNot supportedImage parts are replaced with placeholder text instead of producing a hard failure
MCP, computer use, file search, code interpreterIgnoredDo not infer tool execution from a successful HTTP response
TruncationNot supportedOver-window requests return 400; compact before sending
parallel_tool_callsIgnored; always enabledYour executor must tolerate multiple tool calls safely
max_tool_callsIgnoredEnforce 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 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:

codex --version

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

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

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:

[model_providers.deepseek]
name = "deepseek"
base_url = "https://api.deepseek.com/"
wire_api = "responses"
env_key = "DEEPSEEK_API_KEY"
export DEEPSEEK_API_KEY="replace-with-a-dedicated-revocable-key"
chmod 600 ~/.codex/config.toml ~/.codex/models.json

OpenAI's Codex configuration 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.

WorkloadSuggested corpusAcceptance checksOperational measurements
Repository issue repair20 closed issues with hidden testsTests pass, no unrelated edits, reviewer accepts diffTool calls, retries, elapsed time, tokens, cost
Tool schema fidelity50 function-calling casesCorrect tool, valid arguments, no fabricated executionInvalid-call rate, parallel calls, recovery turns
Long-context code review20 repositories or large diffsFinds planted risks, cites correct files, abstains when evidence is absentInput/cache tokens, latency, context errors
Stateless multi-turn work30 tool loopsRequired history preserved, stale history removed, no state assumptionPayload growth, compactions, failed continuations
Unsupported-feature guardImage, MCP, background, and over-window fixturesClient rejects each before executionFalse-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. For another Responses-oriented coding-agent migration, compare the Codex CLI upgrade and 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.

Get the latest on AI, LLMs & developer tools

New MCP servers, model updates, and guides like this one — delivered weekly.

Official sources and further reading

DeepSeek release and API documentation

Official social posts

Official OpenAI Codex documentation

Related AgentPedia guides

Related Guides