DeepSeek V4.1 Flash Chat Completions API
deepseek/deepseek-v4.1-flashDeepSeek V4.1 Flash Chat Completions turns text and images into explanations, code suggestions, and document analysis, with native vision and 1M-token context. It connects details across long inputs and conversation turns while following your instructions for focus and response length.
DeepSeek V4.1 Flash
DeepSeek · chat-completions
Quick start
Send a POST request to /v1/chat/completions with deepseek/deepseek-v4.1-flash. Choose JSON or SSE with stream, and receive generated content and usage.
- Endpoint
- POST /v1/chat/completions
- Model ID
- deepseek/deepseek-v4.1-flash
- Protocol
- Chat Completions
Request fields
| Field | Requirement | Description |
|---|---|---|
| model | Required | deepseek/deepseek-v4.1-flash |
| messages | Required | A non-empty ordered message array; content accepts text or an array of text and image_url blocks. |
| max_tokens | Optional | A positive integer controlling output tokens; model maximum: 384K tokens. Playground: 1–65,536, default 4,096. |
| temperature | Optional | Sampling temperature from 0 to 2; defaults to 1. |
| top_p | Optional | Nucleus sampling probability from 0 to 1; defaults to 1. Adjust temperature or top_p to guide sampling. |
| frequency_penalty | Optional | Ranges from -2 to 2; defaults to 0. Positive values reduce repeated words. |
| presence_penalty | Optional | Ranges from -2 to 2; defaults to 0. Positive values encourage new topics. |
| stop | Optional | A stop string or an array of up to four stop strings. |
| n | Optional | Number of completions, as an integer of at least 1; defaults to 1. |
| stream | Optional | Defaults to false for complete JSON; true returns SSE events. The playground streams replies. |
Response and usage
Successful responses include generated content and usage. Billing settles from actual input, output, and cache tokens.
Streaming
Set stream: true to read SSE. Finalize usage accounting from the terminal usage event.
curl --request POST \
--url "https://api.vidgo.ai/v1/chat/completions" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "deepseek/deepseek-v4.1-flash",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Review this function and explain how to handle empty input: function average(values) { return values.reduce((sum, value) => sum + value, 0) / values.length; }"
}
],
"max_tokens": 4096,
"temperature": 1,
"top_p": 1,
"stream": false
}'Image understanding example
Replace the image URL with an accessible JPEG, PNG, GIF, or WebP image and state the analysis goal in the same message. Image tokens count as input usage.
curl --request POST \
--url "https://api.vidgo.ai/v1/chat/completions" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "deepseek/deepseek-v4.1-flash",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Summarize the main trend in this chart."
},
{
"type": "image_url",
"image_url": {
"url": "https://your-cdn.example/chart.png"
}
}
]
}
],
"max_tokens": 4096,
"stream": false
}'Store API keys on your server and call the model from server-side code.
Continue with
Related Models
DeepSeek V4.1 Flash Chat Completions API Frequently Asked Questions
What is the DeepSeek V4.1 Flash Chat Completions API?
DeepSeek V4.1 Flash Chat Completions is a DeepSeek model for turning text and images into analysis, explanations, and code suggestions. Native vision and 1M-token context connect screenshots, documents, and conversation history. Its Causal Encoder-Decoder architecture uses compressed attention for long-context processing, while instructions and output budgets guide each answer. You can call it programmatically or try it from the playground above.
How does DeepSeek V4.1 Flash analyze images?
Send text and an image together in the same API message. Chat Completions uses text and image_url content blocks; Responses uses input_text and input_image. Supply an accessible JPEG, PNG, GIF, or WebP image, then identify the chart, interface state, or document detail to explain.
How much context can DeepSeek V4.1 Flash use?
DeepSeek V4.1 Flash has a 1M-token context window for source material and conversation history. Give documents stable titles and section markers so questions can refer to specific evidence across long inputs.
How can DeepSeek V4.1 Flash help with coding?
Provide the relevant code, intended behavior, observed result, and a focused task. The model can explain functions, identify edge cases, propose changes, and help organize debugging steps across follow-up messages.
How long can DeepSeek V4.1 Flash responses be?
The model supports up to 384K output tokens. The text playground offers a 1–65,536-token budget and defaults to 4,096. Set max_tokens for Chat Completions or max_output_tokens for Responses to control the requested length.
How is cached input priced for DeepSeek V4.1 Flash?
Cache-hit input costs $0.006, or 1.2 credits, per 1M tokens. Ordinary input costs $0.300, or 60 credits, and output costs $1.20, or 240 credits, per 1M tokens. Cache-hit usage identifies the input eligible for the cached rate.
What changes in DeepSeek V4.1 Flash compared with DeepSeek V4 Flash?
V4.1 Flash introduces native image understanding and a Causal Encoder-Decoder architecture with compressed sparse attention. It combines text and image analysis with 1M-token context, making screenshots and document images part of the same conversation as coding and text tasks.
How should I structure long tasks for DeepSeek V4.1 Flash?
Start with the goal, constraints, source labels, and completion criteria. Ask for the next analysis or proposed step, inspect the supporting evidence, and send the new observations in a follow-up message. Ordered conversation turns retain the decisions needed for the next response.





























