DeepSeek V4 Flash API
/v1/chat/completions This model uses an OpenAI-compatible Chat Completions endpoint. The same HiAPI API key can call enabled models in your account group; image, video, and audio models use /v1/tasks and a different request shape.
Model overview
| Model name | deepseek-v4-flash |
|---|---|
| Type | Text generation · Chat Completions |
| Context window | 1,000,000 tokens |
| Maximum output | 384,000 tokens |
| Modes | Thinking (default) and non-thinking |
| Features | Streaming, JSON mode, tool calls |
| Pricing | See HiAPI Pricing |
DeepSeek V4 Flash is the efficiency-focused model in the DeepSeek V4 family. According to DeepSeek, it has 284B total parameters with 13B activated per token, a 1M-token context window, and both thinking and non-thinking modes. HiAPI exposes it through an OpenAI-compatible Chat Completions endpoint.
Production guidance
- Use the same HiAPI API key across enabled models.
- Text models use /v1/chat/completions. Image, video, and audio models use the asynchronous /v1/tasks request shape.
- Keep API keys on your server and never expose them in browser code.
- When the launch campaign is active, eligible topped-up users can opt in by sending X-HiAPI-Promotion: deepseek-v4-flash-launch.
- A promotion request uses free quota only and never falls back to balance billing automatically.
- After the daily quota is exhausted, the API returns HTTP 429 with code promotion_quota_exhausted. Remove the promotion header only when your application intends to continue with paid usage.
Best suited for
Fast chat, summarization, extraction, and content workflows.
messagesstreamThinking mode for multi-step analysis and code generation.
thinkingreasoning_effortTool calls and long context for multi-step automation.
toolsmessagesJSON mode for machine-readable responses.
response_formatRequest parameters
model string required Use deepseek-v4-flash.
messages array required Conversation messages in order. Each item contains a role and content.
role enum required Message role.
content string required Message text.
stream boolean optional Return Server-Sent Events when true.
max_tokens integer optional Maximum generated tokens. Input plus output must fit the context window.
thinking object optional Enable or disable thinking mode. Thinking is enabled by default.
type enum required Thinking-mode switch.
reasoning_effort enum optional Thinking effort. Use max explicitly for maximum effort; on DeepSeek V4 Flash, xhigh is accepted but maps to high.
response_format object optional Set type=json_object for JSON mode and explicitly ask for JSON in the prompt.
tools array optional OpenAI-compatible function tool definitions.
API examples
Request examples
Keep thinking enabled and set reasoning_effort=max.
{
"model": "deepseek-v4-flash",
"messages": [
{
"role": "system",
"content": "You are a concise technical assistant."
},
{
"role": "user",
"content": "Explain sparse attention in three sentences."
}
],
"thinking": {
"type": "enabled"
},
"reasoning_effort": "max",
"stream": false
}Set stream=true and read SSE chunks until [DONE].
{
"model": "deepseek-v4-flash",
"messages": [
{
"role": "system",
"content": "You are a concise technical assistant."
},
{
"role": "user",
"content": "Explain sparse attention in three sentences."
}
],
"thinking": {
"type": "enabled"
},
"reasoning_effort": "high",
"stream": true
}Disable thinking and request a JSON object.
{
"model": "deepseek-v4-flash",
"messages": [
{
"role": "user",
"content": "Return JSON with keys summary and risks."
}
],
"thinking": {
"type": "disabled"
},
"response_format": {
"type": "json_object"
}
}Response schema
Non-streaming responses follow the Chat Completions schema. Thinking mode also returns reasoning_content; usage is the billing detail source.
{
"id": "chatcmpl_example",
"object": "chat.completion",
"model": "deepseek-v4-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Sparse attention computes only selected token relationships."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 18,
"total_tokens": 42,
"prompt_tokens_details": {
"cached_tokens": 0
}
}
} - Read the answer from choices[0].message.content.
- In thinking mode, reasoning is returned in choices[0].message.reasoning_content.
- Read prompt, completion, cache, and total Token counts from usage.
- For streaming, process each SSE data chunk until the terminal [DONE] event.
FAQ
What is DeepSeek V4 Flash?
DeepSeek V4 Flash is the speed- and cost-efficient open-weight MoE model in the DeepSeek V4 family. According to DeepSeek, it has 284B total parameters, activates 13B parameters per token, supports a 1M-token context window, and provides non-thinking, Think High, and Think Max modes.
How do I change the thinking mode and reasoning effort?
Thinking is enabled by default. Set thinking.type to enabled or disabled, and use reasoning_effort=high or max while thinking is enabled. Use max explicitly for maximum effort; on DeepSeek V4 Flash, xhigh is accepted but maps to high.
Which endpoint and model ID should I use?
Send POST requests to /v1/chat/completions and set model to deepseek-v4-flash.
Can the same HiAPI API key call media models?
Yes. The key is shared, but media generation uses POST /v1/tasks and a different request shape.
How are tokens billed?
Input, output, and cached-input tokens are billed separately. Use the live HiAPI pricing page as the source of truth. View live pricing.
How do I migrate an OpenAI SDK client?
Keep the Chat Completions request shape, replace the base URL with https://api.hiapi.ai/v1, use a HiAPI API key, and set the model to deepseek-v4-flash.