DeepSeek-V4-Flash API Is Live: How to Use the Official API (Public Beta Guide)

DeepSeek-V4-Flash-0731 is live in public beta. Get an API key, make your first call, control thinking mode, and see cache-hit pricing in this hands-on guide.

Ashley Innocent

Ashley Innocent

31 July 2026

DeepSeek-V4-Flash API Is Live: How to Use the Official API (Public Beta Guide)

Apidog for Enterprise

On-Premises Deploy

SSO & RBAC

SOC 2 Compliant

Explore Apidog Enterprise

DeepSeek shipped the official DeepSeek-V4-Flash API this morning. The announcement landed on July 31, 2026, and the release notes make three things clear: the model’s agent capabilities got a serious upgrade, it now speaks OpenAI’s Responses API format natively, and it works with Codex from day one.

If you’ve been calling deepseek-v4-flash since April, you were on the preview. This release graduates the model to its official version, DeepSeek-V4-Flash-0731, and you get the upgrade without changing a single line of code. The model name stays the same.

This guide walks through everything: getting a key, making your first call, switching thinking mode on and off, and what the public beta pricing looks like. If you’re new to the DeepSeek lineup, start with What Is DeepSeek V4? for the family overview, then come back here.

💡
Once you have a key, you’ll want a fast way to poke at the endpoints before wiring them into code. Apidog lets you send requests to the DeepSeek API, inspect streaming responses event by event, and save every working call as a reusable test. More on that setup below.
button

What actually shipped on July 31

According to the official change log, the release covers the API only. The DeepSeek app and web models are unchanged, and the V4-Pro API is unchanged. Here’s the summary:

One note of honesty: the headline benchmark claim (“far exceeding V4-Pro-Preview”) comes from DeepSeek’s own evaluation, and two of the listed benchmarks (DSBench-FullStack and DSBench-Hard) are internal test sets. Independent numbers will take a few days to appear.

Step 1: Get your API key

Head to the DeepSeek Platform, sign in, and create a key from the API Keys page. Keys start with sk-. Store it as an environment variable rather than hardcoding it:

export DEEPSEEK_API_KEY="sk-your-key-here"

The DeepSeek API is compatible with both the OpenAI and Anthropic API formats, so you don’t need a DeepSeek-specific SDK. Two base URLs matter:

Format Base URL
OpenAI-compatible https://api.deepseek.com
Anthropic-compatible https://api.deepseek.com/anthropic

Step 2: Make your first call

The fastest sanity check is curl:

curl https://api.deepseek.com/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Summarize what changed in DeepSeek-V4-Flash-0731."}
    ],
    "stream": false
  }'

The same call through the OpenAI Python SDK:

# pip3 install openai
import os
from openai import OpenAI

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

response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Write a Python function that validates an email address."}
    ],
    stream=False
)

print(response.choices[0].message.content)

And Node.js:

// npm install openai
import OpenAI from "openai";

const openai = new OpenAI({
  baseURL: "https://api.deepseek.com",
  apiKey: process.env.DEEPSEEK_API_KEY,
});

const completion = await openai.chat.completions.create({
  model: "deepseek-v4-flash",
  messages: [{ role: "user", content: "Hello!" }],
});

console.log(completion.choices[0].message.content);

Because the model name deepseek-v4-flash now points at the 0731 release, any existing integration you built against the preview picks up the new model automatically. Nothing to migrate.

Step 3: Control thinking mode and reasoning effort

V4-Flash supports both a non-thinking mode and a thinking mode, and thinking is the default. You control it with the thinking parameter, and you can tune depth with reasoning_effort:

response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Plan a database migration from MySQL to Postgres."}],
    reasoning_effort="high",
    extra_body={"thinking": {"type": "enabled"}}
)

Two behaviors worth knowing before you tune parameters:

For latency-sensitive endpoints like autocomplete, disable thinking. For agent loops and hard debugging tasks, keep it on and raise the effort level.

Step 4: Stream the response

Set stream: true and the API returns server-sent events. If you haven’t debugged SSE payloads before, our guide on streaming LLM responses with server-sent events covers the format in detail.

stream = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Explain connection pooling."}],
    stream=True
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Pricing during the public beta

Per the official Models & Pricing page, V4-Flash stays aggressively cheap:

Item deepseek-v4-flash deepseek-v4-pro
Input, cache hit (per 1M tokens) $0.0028 $0.003625
Input, cache miss (per 1M tokens) $0.14 $0.435
Output (per 1M tokens) $0.28 $0.87
Context length 1M tokens 1M tokens
Max output 384K 384K
Concurrency limit 2,500 500

Three pricing notes:

For the fuller cost picture across the V4 family, including the history of the V4-Pro permanent price cut, see our DeepSeek V4 API pricing breakdown.

Test and debug the API in Apidog

Raw curl works for a smoke test, but the moment you’re comparing thinking versus non-thinking output, or watching how the model streams tool calls, you want visibility. Here’s a workflow that takes about five minutes in Apidog:

  1. Create a project and add the endpoint. Add POST https://api.deepseek.com/chat/completions (or import an OpenAI-compatible spec so all endpoints arrive at once).
  2. Store the key as an environment variable. Put DEEPSEEK_API_KEY in an Apidog environment and reference it in the Authorization header as Bearer {{DEEPSEEK_API_KEY}}. Switching between a test key and a production key becomes a dropdown click.
  3. Send and inspect. For streaming calls, Apidog renders the SSE events as they arrive, so you can watch reasoning content and answer content come through as separate deltas instead of eyeballing a wall of raw data: lines.
  4. Save variants as test cases. Keep one saved request with thinking enabled and one without, then rerun both after every model update. When DeepSeek ships the next silent upgrade to deepseek-v4-flash, you’ll know in one click whether your prompts still behave.

Download Apidog for free, the whole flow above works on the free plan.

FAQ

Do I need to change my code to get the new model? No. The model name deepseek-v4-flash now serves DeepSeek-V4-Flash-0731. Existing integrations upgrade automatically.

Is this the same model as the DeepSeek app? No. The July 31 update covers the API only. The app and web models are unchanged.

What happened to deepseek-chat and deepseek-reasoner? Those legacy model names were scheduled for discontinuation on July 24, 2026. Use deepseek-v4-flash or deepseek-v4-pro. Our guide on how to use the DeepSeek V4 API covers the migration.

Can I use it for free? DeepSeek’s API is pay-as-you-go with no permanent free tier, but the cache-hit pricing makes experimentation nearly free in practice. See how to use the DeepSeek V4 API for free for the current options.

Does V4-Flash work with Codex and the Responses API? Yes, both, and it’s the only DeepSeek model that does so far. V4-Pro support is expected in early August 2026. Full setup in our Responses API and Codex guide.

The bottom line

DeepSeek-V4-Flash-0731 is a quiet kind of release: same model name, same prices, same architecture, and a set of agent benchmark scores that now beat the bigger V4-Pro-Preview, at least on DeepSeek’s own tests. The Responses API support and Codex adaptation signal where this model is aimed: high-concurrency agent workloads at prices that undercut every Western lab.

Grab a key, point your OpenAI SDK at https://api.deepseek.com, and put the model through your own test suite before trusting the benchmark table. Apidog makes that verification loop fast: save your prompts as test cases once, rerun them on every model update, and you’ll never be surprised by a silent upgrade again.

button

Explore more

DeepSeek-V4-Flash Now Supports the Responses API and Codex: What Developers Need to Know

DeepSeek-V4-Flash Now Supports the Responses API and Codex: What Developers Need to Know

DeepSeek-V4-Flash now speaks OpenAI's Responses API and runs inside Codex. See the full compatibility matrix, 2-minute setup, and the sharp edges to avoid.

31 July 2026

How to Run Kimi K3 Locally (and When You Shouldn't)

How to Run Kimi K3 Locally (and When You Shouldn't)

Kimi K3's open weights are live: 594 GB MXFP4, 2.8T params. What it takes to self-host with vLLM or llama.cpp, the M1 Max reality check, and how to test your local endpoint.

29 July 2026

Claude Opus 5 vs Sonnet 5: Which Tier Do You Actually Need?

Claude Opus 5 vs Sonnet 5: Which Tier Do You Actually Need?

Claude Opus 5 vs Sonnet 5 compared on real cost per task: $5/$25 against Sonnet's $2/$10 intro rate that rises to $3/$15 on Sep 1, 2026, plus specs, benchmarks, and a decision table by workload.

25 July 2026

Practice API Design-first in Apidog

Discover an easier way to build and use APIs

DeepSeek-V4-Flash API Is Live: How to Use the Official API (Public Beta Guide)