DeepSeek V4 Pro left preview on August 12, 2026. The GA build, stamped 0813, now serves the deepseek-v4-pro API endpoint with a 1M-token context window, 384K maximum output, and cache-hit input pricing of $0.003625 per million tokens. As Unite.AI reported, the model that spent four months in preview is now DeepSeek’s flagship.
Launch coverage explains what shipped. This guide focuses on implementation: making your first request with the OpenAI SDK, selecting thinking modes, reading reasoning_content, streaming, tool calling, and structuring prompts for cache efficiency. For architecture background, read What is DeepSeek V4.
TL;DR
-
deepseek-v4-prois the production endpoint for the GA0813build as of August 12, 2026. - The API is OpenAI-compatible: use the
openaiSDK withbase_url="https://api.deepseek.com". - The model supports a 1M-token context window, up to 384K output tokens, and three reasoning modes:
none,high, andmax. - Thinking modes expose reasoning in
reasoning_content; do not add that field back into subsequent conversation history. - Input costs are $0.435/M tokens on a cache miss and $0.003625/M on a cache hit. Output costs $0.87/M tokens.
- Test requests, streams, and cache behavior before production. Keep Pro and Flash configurations side by side in Apidog.
What GA build 0813 changes for developers
The V4 Pro preview opened in April 2026. V4 Flash followed in July, and V4 Pro reached general availability as build 0813 on August 12, following DeepSeek’s datestamp convention, similar to v3-0324.
GA changes three practical things:
-
You have a stable target. Preview models can change behavior and invalidate prompt tuning or eval results. Build
0813is the production snapshot until DeepSeek publishes another one. -
Use the production alias. Call
deepseek-v4-prothrough the official API. To pin the snapshot through another provider, OpenRouter listsdeepseek/deepseek-v4-pro-0813. - The full feature set is available. Thinking modes, function calling, structured outputs, prompt caching, and OpenAI, Anthropic, and Responses-style APIs are available on the GA endpoint.
Under the hood, V4 Pro is a mixture-of-experts model with 1.6T total parameters and 49B active parameters per token. Its Compressed Sparse Attention and Heavily Compressed Attention designs reduce single-token inference compute to 27% of V3.2’s and KV cache usage to 10%.
DeepSeek V4 Pro 0813: specs
| Spec | DeepSeek V4 Pro 0813 |
|---|---|
| Release | GA on August 12, 2026, snapshot 0813
|
| Architecture | Mixture-of-experts, 1.6T total parameters, 49B active per token |
| Attention | Compressed Sparse Attention + Heavily Compressed Attention |
| Inference cost vs. V3.2 | 27% single-token compute, 10% KV cache |
| Context window | 1,000,000 tokens |
| Maximum output | 384K tokens |
| Thinking modes |
non-think, think high, think max
|
| Input price | $0.435/M tokens on cache miss; $0.003625/M on cache hit |
| Output price | $0.87/M tokens |
| API formats | OpenAI Chat Completions, Anthropic Messages, DeepSeek Responses |
| Model ID | deepseek-v4-pro |
| Smaller sibling |
deepseek-v4-flash — 284B total / 13B active, $0.14/M input and $0.28/M output |
DeepSeek’s model card reports SWE-bench Verified at 80.6%, Terminal Bench 2.0 at 67.9%, GPQA Diamond at 90.1%, and LiveCodeBench at 93.5% for V4-Pro-Max. These are vendor-reported results, so run task-specific evals before migrating production workloads.
Get an API key and make your first request
1. Create and export an API key
- Create an account at platform.deepseek.com and add credit. The API is prepaid.
- Open API Keys, generate a key, and copy it when shown.
- Store it in an environment variable:
export DEEPSEEK_API_KEY="sk-..."
2. Install the OpenAI SDK
pip install openai
DeepSeek supports the OpenAI Chat Completions protocol. Use either https://api.deepseek.com or https://api.deepseek.com/v1 as the base URL. The /v1 path is for protocol compatibility, not a model version.
3. Send a chat completion
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DEEPSEEK_API_KEY"],
base_url="https://api.deepseek.com",
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[
{
"role": "system",
"content": "You are a concise technical assistant.",
},
{
"role": "user",
"content": "Explain idempotency in REST APIs in two sentences.",
},
],
)
print(response.choices[0].message.content)
print(response.usage)
Log response.usage from the start. A long prompt cache miss and a long prompt cache hit have very different costs.
Smoke-test with cURL
curl https://api.deepseek.com/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DEEPSEEK_API_KEY" \
-d '{
"model": "deepseek-v4-pro",
"messages": [
{
"role": "user",
"content": "List three ways to version a REST API."
}
]
}'
See the official DeepSeek docs for the complete parameter reference, Anthropic-compatible endpoint, and DeepSeek Responses API.
Work with the three thinking modes
V4 Pro exposes reasoning through a reasoning_effort parameter.
| API value | Mode | Use it for |
|---|---|---|
none |
non-think | Extraction, classification, formatting, summaries |
high |
think high | Coding, debugging, multi-step analysis |
max |
think max | Difficult tasks that justify additional latency and output-token cost |
Use reasoning_effort in a standard Chat Completions request:
response = client.chat.completions.create(
model="deepseek-v4-pro",
reasoning_effort="high", # "none" | "high" | "max"
messages=[
{
"role": "user",
"content": (
"Our API returns 502s under load but only behind the CDN. "
"Walk through likely causes in order of probability."
),
},
],
)
message = response.choices[0].message
print("--- Reasoning ---")
print(message.reasoning_content)
print("--- Answer ---")
print(message.content)
Two implementation rules:
-
Do not send
reasoning_contentback in conversation history. Persist and resend only previous messagecontent. -
Budget for reasoning tokens. Reasoning is billed as output at $0.87/M tokens. Use
maxonly when the task needs it.
Stream responses
For large outputs or thinking-enabled requests, use streaming. In reasoning modes, reasoning_content deltas typically arrive before answer content deltas.
stream = client.chat.completions.create(
model="deepseek-v4-pro",
reasoning_effort="high",
stream=True,
messages=[
{
"role": "user",
"content": (
"Design a rate limiter for a public API. "
"Compare token bucket and sliding window."
),
},
],
)
for chunk in stream:
if not chunk.choices:
continue # The final chunk may contain usage only.
delta = chunk.choices[0].delta
if getattr(delta, "reasoning_content", None):
print(delta.reasoning_content, end="", flush=True)
elif delta.content:
print(delta.content, end="", flush=True)
For a user-facing application:
- Render reasoning as a collapsed “Thinking” section.
- Switch to normal answer rendering when
contentdeltas begin. - Record final usage data for cost monitoring.
The stream uses server-sent events. See this guide to streaming API responses with SSE for the protocol details.
Add tool calling and structured outputs
V4 Pro supports OpenAI-style function calling. Define tools, inspect tool_calls, execute them in your application, append tool results to the conversation, and call the model again.
tools = [
{
"type": "function",
"function": {
"name": "get_endpoint_status",
"description": "Check the health of an internal API endpoint",
"parameters": {
"type": "object",
"properties": {
"endpoint": {
"type": "string",
"description": "Path, for example /v1/orders",
}
},
"required": ["endpoint"],
},
},
}
]
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[
{
"role": "user",
"content": "Is /v1/orders healthy right now?",
}
],
tools=tools,
)
print(response.choices[0].message.tool_calls)
For guaranteed parseable JSON, use the standard response_format parameter. Refer to the official DeepSeek docs for the expected tool-result message shapes.
Design prompts for automatic caching
Prompt caching has a major impact on long-context costs. DeepSeek automatically caches repeated prompt prefixes:
- Cache miss: $0.435/M input tokens
- Cache hit: $0.003625/M input tokens
- Discount: 120x
You do not configure cache headers or a cache TTL. Instead, structure prompts so stable text comes first.
Recommended prompt layout
1. System instructions
2. Static policies and tool definitions
3. Documentation or repository context
4. Previous user-visible conversation content
5. Latest user request
6. Volatile metadata: timestamps, request IDs, trace IDs
Avoid putting volatile values in system instructions or early prompt sections. A changed timestamp near the beginning invalidates the cache from that point forward.
Example: 200K-token coding-agent context
Suppose an agent keeps a 200K-token repository context and makes 50 requests:
- Without caching:
50 × 200K × $0.435/M ≈ $4.35 - With caching: one miss at
$0.087plus 49 hits at roughly$0.0007each, or approximately$0.12
That is roughly 35x cheaper for the same session.
A full 1M-token prompt costs $0.435 on a cache miss, but a stable cached prefix costs about a third of a cent per read. Learn more in What is prompt caching.
Test DeepSeek V4 Pro in Apidog
Before integrating V4 Pro into production, verify request shape, streaming behavior, model routing, and usage data. Since the API is OpenAI-compatible, Apidog can work with it without special handling.
- Import a request. Paste the earlier cURL command into Apidog to create an editable request with parsed headers, authentication, and body.
-
Create Pro and Flash environments. Put
base_url, API key, and model name into environment variables. Then switch betweendeepseek-v4-proanddeepseek-v4-flashwithout editing request bodies. -
Inspect streaming behavior. Send a request with
"stream": trueto view the SSE event timeline and confirm thatreasoning_contentarrives before answer content. - Save regression cases. Store representative prompts in a collection. When a new snapshot ships, rerun the same requests and compare behavior before upgrading.
-
Check token usage. Use each response’s
usageblock to measure cache-hit behavior while adjusting prompt structure.
Pricing today and the announced increase
Current list prices:
| Model | Input: cache miss | Input: cache hit | Output |
|---|---|---|---|
deepseek-v4-pro |
$0.435/M | $0.003625/M | $0.87/M |
deepseek-v4-flash |
$0.14/M | — | $0.28/M |
On August 6, 2026, DeepSeek warned that a “significant” API price increase is coming. It did not provide figures or an effective date.
Prepare by:
- Measuring current per-task costs using actual
usagedata. - Keeping stable prompt prefixes to maximize cache hits.
- Routing high-volume, simple tasks to V4 Flash.
- Reserving V4 Pro and higher reasoning efforts for tasks that need long-context analysis, agentic coding, or deeper reasoning.
For a detailed pricing breakdown, see the DeepSeek V4 API pricing guide.
FAQ
Will my existing OpenAI SDK code work unchanged?
Almost. Change base_url to https://api.deepseek.com, provide a DeepSeek API key, and set model="deepseek-v4-pro". Chat Completions, streaming, tools, and structured outputs use OpenAI-compatible shapes.
If your application uses the Anthropic SDK, DeepSeek also provides an Anthropic Messages-compatible endpoint.
When should I use V4 Flash instead of V4 Pro?
Use V4 Flash for high-volume and latency-sensitive work such as classification, extraction, simple chat, and formatting.
Use V4 Pro for agentic coding, long-context analysis, and thinking-mode workloads. Route requests by task requirements rather than using one model for everything.
Can I use V4 Pro 0813 in Cursor?
Yes. Cursor accepts custom OpenAI-compatible endpoints, so you can configure the GA build as a custom model. See How to use DeepSeek V4 Pro with Cursor.
Wrap up
Start with a minimal integration, then validate the pieces that affect production behavior:
- Make a basic Chat Completions request.
- Select
reasoning_effortper task. - Stream long outputs.
- Implement tool-call loops where needed.
- Log
usage. - Keep stable prompt prefixes for cache hits.
- Save reproducible requests in an Apidog collection for regression testing.
The 120x cache-hit discount makes prompt ordering an architecture concern. Measure usage, test with representative workloads, and re-run your saved requests when DeepSeek releases another snapshot or changes pricing.


Top comments (0)