DeepSeek V4.1 Flash Chat Completions API

deepseek/deepseek-v4.1-flash
1M tokens · Max output 384K tokens · 60 input / 1.2 cached input / 240 output credits / 1M tokens

DeepSeek 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

Chat with DeepSeek V4.1 Flash

Each model has its own conversation. Switching never sends another model's history, and switching back resumes where you left off. Requests are billed from actual token usage.

Ctrl / ⌘ + Enter to send0 / 32,000

Continue with

DeepSeek V4.1 Flash Chat Completions

DeepSeek V4.1 Flash Chat Completions from DeepSeek analyzes text and images together to explain screenshots, review code, and answer questions across long documents. Its Causal Encoder-Decoder architecture uses compressed sparse attention to connect source material and earlier conversation turns within a 1M-token context. Use it to synthesize named sections, inspect visual evidence, or develop code changes through a focused conversation.

Why Choose DeepSeek V4.1 Flash?

  • Native image understandingAnalyze text and images within one conversation to connect visible chart data, interface elements, and document content with the question being asked.

  • 1M-token contextBring long documents, code excerpts, and earlier discussion into the same context when an answer depends on information spread across sources.

  • Coding and task reasoningTurn a problem description, relevant code, and observed behavior into explanations, review findings, and a sequence of steps for a software task.

  • Extended text outputThe model supports up to 384K output tokens for substantial answers. Set the output budget to match a detailed analysis, report, or code response.

  • Cached input pricingRepeated conversation prefixes can benefit from the cached-input rate of $0.006 per 1M tokens. Usage distinguishes cached input from ordinary input and generated output.

Parameters

ParameterRequirementDescription
modelRequired

Set to deepseek/deepseek-v4.1-flash.

messagesRequired for selected protocol

An ordered, non-empty message array for Chat Completions. Each message contains role and content; content accepts text or text and image_url blocks.

inputRequired for selected protocol

Text or structured message input for Responses. Image messages use input_text and input_image blocks.

instructionsOptional

System instructions for Responses. For Chat Completions, place instructions in a system message.

temperatureOptional

Sampling temperature from 0 to 2. Adjust temperature or top_p to guide variation.

Default1
max_tokensOptional

A positive integer controlling Chat Completions output. Model maximum: 384K tokens; playground: 1–65,536, default 4,096.

max_output_tokensOptional

A positive integer controlling Responses output. Model maximum: 384K tokens; playground: 1–65,536, default 4,096.

top_pOptional

Nucleus sampling probability from 0 to 1.

Default1
frequency_penaltyOptional

Chat Completions frequency penalty from -2 to 2. Positive values reduce repeated words.

Default0
presence_penaltyOptional

Chat Completions presence penalty from -2 to 2. Positive values encourage new topics.

Default0
stopOptional

A stop string or an array of up to four stop strings for Chat Completions.

nOptional

Number of Chat Completions replies to generate, as an integer of at least 1.

Default1
streamOptional

false returns complete JSON; true returns SSE events. The text playground streams replies.

Defaultfalsetrue

How to Use

  1. Define the questionState the target result, relevant constraints, and the answer format. Try a text question in the playground or choose an API protocol.

  2. Prepare source materialLabel documents and code excerpts. For image analysis, send an accessible image URL and the question together using the image example in the API tab.

  3. Set the output budgetThe playground defaults to 4,096 output tokens and accepts integers from 1 to 65,536. Adjust temperature or top_p for the task.

  4. Continue with evidenceRead the streamed answer, compare it with the source, and add a follow-up message that identifies the detail to explore next.

Pricing

Rates apply per 1M tokens. Cached input, ordinary input, and output are metered separately and settled in credits.

UsageRateDetails
Cached input tokens$0.006 · 1.2 credits / 1M tokensInput tokens reported as cache hits in usage.
Input tokens$0.300 · 60 credits / 1M tokensOrdinary text and image input tokens.
Output tokens$1.20 · 240 credits / 1M tokensTokens generated by the model.

Best Use Cases

  • Screenshot and chart analysisExplain interface states, summarize visible chart trends, and connect image evidence with a focused question.

  • Code review and debuggingSupply a function, its intended behavior, and a failing example to get review findings and a proposed fix.

  • Long-document synthesisCompare named sections across reports or manuals, then ask for a synthesis grounded in the supplied material.

  • Multi-turn task planningCarry the goal, constraints, and earlier decisions through follow-up questions while developing the next steps.

Pro Tips

  • Name the document, code file, or image region you want the answer to use, then request the supporting evidence.
  • For image questions, supply a clear screenshot and identify the chart, label, or interface state to inspect.
  • Keep stable instructions and source material at the start of repeated conversations, then append the changing question.

Usage Notes

  • Use deepseek/deepseek-v4.1-flash with Chat Completions or Responses; choose the matching field names shown in the API tab.
  • The model has 1M-token context and up to 384K output tokens. The text playground uses a 1–65,536 output control, defaulting to 4,096.
  • Send JPEG, PNG, GIF, or WebP images through the API content blocks. Image tokens contribute to input usage.

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.