DeepSeek v4 API
Complete API reference for DeepSeek v4 LLM models powered by DeepSeek.
Model Updates
DeepSeek v4 Flash 0731
- Flaq AI has updated DeepSeek v4 Flash to DeepSeek's official
deepseek-v4-flash-0731release. - Use the
0731model IDs below to access the updated version. - The original model IDs remain available for existing API integrations.
Model Variants
This API supports four DeepSeek v4 model variants:
Quick Comparison
DeepSeek v4 Pro Text to Text
Endpoint
http
Request Parameters
Required
Message Support
Optional
Example Request
javascript
DeepSeek v4 Flash Text to Text
Endpoint
http
Request Parameters
Required
Message Support
Optional
Example Request
javascript
DeepSeek v4 Pro Web Search
Endpoint
http
Request Parameters
Required
Message Support
Optional
Example Request
javascript
DeepSeek v4 Flash Web Search
Endpoint
http
Request Parameters
Required
Message Support
Optional
Example Request
javascript
Response Format
DeepSeek V4 LLM models return OpenAI-compatible completion responses. With stream: true, the response is Server-Sent Events; with stream: false, the response is a single JSON object.
Error Response
json
Best Practices
- Choose the right variant: Use Pro models for higher-quality reasoning and Flash models for lower-latency, lower-cost workloads.
- Use Web Search for current events: Choose Pro or Flash Web Search when the answer depends on up-to-date online information.
- Tune sampling parameters carefully:
top_pandtop_kare supported across all DeepSeek v4 variants and can change output diversity. - Send only supported inputs: Do not send file or image parts to any DeepSeek v4 route.
- Match Accept with stream mode: Use
Accept: text/event-streamfor streaming requests andAccept: application/jsonfor non-streaming requests.