DeepSeek Harness Multimodality
DeepSeek has launched the experimental multimodal vision understanding model DeepSeek-V4-Flash-Vision-Exp, and simultaneously opened the multimodal API service and a free Files API.
Install the latest version before use:
npm install -g @deepseek-ai/dsh@latest
After updating to the latest version, you can see the model DeepSeek-V4-Flash-Vision-Exp available:

Switch to the vision model, then we can directly push images or ppt files into the document and let it look at the content (** Test image download):

What is multimodality
To understand multimodality, first understand the word "modality": a modality refers to different forms of information expression; text is one modality, and images, audio, and video are each different modalities.
| Modality | Common forms | Corresponding AI capability |
|---|---|---|
| Text | Articles, code, conversations | Large language model (LLM) |
| Image | Photos, screenshots, design drafts, charts | Vision understanding model |
| Audio | Speech, music | Speech recognition and generation model |
| Video | Short videos, screen recordings, surveillance footage | Video understanding model |
Past large language models handled only the text modality; everything you sent them had to become text first.
Multimodal models can receive images and text together, converting them uniformly into token sequences for joint processing.
The key: images are not "directly seen" by the model; instead, a vision encoder first cuts them into patches and converts them into vectors, then concatenates them with text tokens into the same sequence.
Images also consume tokens; one image takes up to 384 tokens, which is the source of the multimodal billing rules described later.
For agents, multimodality brings a qualitative change, not just icing on the cake.
| Comparison Item | Text-only model | Multimodal model |
|---|---|---|
| Input form | Text only | Mixed text and images |
| Debugging code errors | requires the user to manually transcribe the error into text | directly send a screenshot of the error |
| Reproducing a design draft | cannot reference the visual draft | write the page directly against the design draft |
| Analyzing data charts | cannot read the chart in the image | give conclusions directly from the image |
V4-Flash-Vision-Exp: multimodal vision model launched
DeepSeek-V4-Flash-Vision-Exp is an experimental multimodal vision understanding model, now available on the DeepSeek API platform.
Users can access the model by setting model='deepseek-v4-flash-vision-exp'.
Its capability positioning can be summed up in one sentence: no shrinkage in text capability, a big leap in vision capability.
In terms of text-only capabilities (agents, reasoning, world knowledge, etc.), it is on par with the official DeepSeek-V4-Flash release.
On agent benchmarks requiring visual understanding, it achieves a large leap over DeepSeek-V4-Flash, with multimodal agent capability approaching Opus-4.8.
| Capability dimension | DeepSeek-V4-Flash | DeepSeek-V4-Flash-Vision-Exp |
|---|---|---|
| Text-only agent tasks | Official release baseline | On par with the official release |
| Reasoning and world knowledge | Official release baseline | On par with the official release |
| Visual understanding agent tasks | Not supported; multimodal elements ignored in evaluation | Large leap, approaching Opus-4.8 |
| Model positioning | Official release | Experimental version |
Evaluation note: For Code Agent text tasks in public benchmark suites, DeepSeek series models are tested using DeepSeek Harness Minimal mode as the framework, with the max level, temperature=1.0, topp=0.95.
In the ApexBench and Agents' Last Exam evaluations, the text model DeepSeek-V4-Flash ignores the multimodal elements in them.
Multimodal API quick start
The multimodal API supports three call formats: Chat Completions, Messages, and Responses, making it easy to integrate with various agent tools.
The three formats have identical capabilities; choose whichever interface style you are familiar with.
| Call format | Interface style | Who it suits |
|---|---|---|
| Chat Completions | OpenAI classic chat interface | developers with existing OpenAI SDK code |
| Messages | Anthropic Messages interface, with base_url https://api.deepseek.com/anthropic | developers with existing Anthropic-style code or toolchains |
| Responses | OpenAI's new Responses interface | developers using the new SDK who prefer a concise input structure |
All three formats support mixed text-and-image input, with three ways to pass images: inline base64, external URL, and Files API.
| Passing method | Request body size | Whether an image host is needed | Applicable scenarios |
|---|---|---|---|
| inline base64 | Large | Not required | local images, one-off small images |
| external URL | Small | Needed | images deployed on a publicly accessible server |
| Files API | Small | Not required | reusing the same image multiple times, high-frequency batch tasks |
Method 1: inline base64
After encoding a local image into a base64 string, write it directly into the request body as a data URL.
Example
File path: vision_base64_demo.py
Dependency: pip install openai
import
base64
from
openai
import
OpenAI
The DeepSeek endpoint is compatible with the OpenAI SDK; just change base_url to switch
client
=
OpenAI
(
api_key
=
"sk-your-key"
,
Required: replace with your own DeepSeek API key
base_url
=
"https://api.deepseek.com"
Required: DeepSeek official endpoint
)
read the local image and encode it into a base64 string
with
open
(
"runoob-logo.png"
,
"rb"
)
as
f:
b64
=
base64
.
b64encode
(
f.
read
(
)
)
.
decode
(
"utf-8"
)
response
=
client.
chat
.
completions
.
create
(
model
=
"deepseek-v4-flash-vision-exp"
,
Required: multimodal vision understanding model
messages
=
[
{
"role"
:
"user"
,
"content"
:
[
text and images are interleaved in array order, and the model understands them in that order
{
"type"
:
"text"
,
"text"
:
"What is the text in the image?"
}
,
{
"type"
:
"image_url"
,
inline base64: data:image-format;base64,encoded-content
"image_url"
:
{
"url"
: f
"data:image/png;base64,{b64}"
}
}
]
}
]
,
stream
=
False
Optional: whether to stream output, default False
)
(
response.
choices
[
0
]
.
message
.
content
)
Run output:
图片中的文字是 "RUNOOB"。
Method 2: external URL
The image is deployed on a publicly accessible server, and only a URL string is passed in the request, so the request body is small.
Example
External URL method: ${DEEPSEEK_API_KEY} is an environment variable exported in advance
curl https:
//
api.deepseek.com
/
chat
/
completions \
-H
"Content-Type: application/json"
\
-H
"Authorization: Bearer ${DEEPSEEK_API_KEY}"
\
-d
'{
"model": "deepseek-v4-flash-vision-exp",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Summarize the trend in this chart in one paragraph"},
{"type": "image_url", "image_url": {"url": "https://static.runoob.com/images/chart-demo.png"}}
]
}
]
}'
The URL must be a public address accessible to the platform; internal network addresses and local loopback addresses cannot be fetched.
Both inline base64 and URL methods allow an optional detail field in image_url to control image parsing precision.
| detail values | Behavior | Applicable scenarios |
|---|---|---|
| low | scaled to 512×512 before parsing, low token consumption | only need a rough look: determine image type, find the main subject |
| high | equivalent to original | need to see details clearly |
| original | parse at original image precision | read text, view small icons, analyze charts |
| auto | currently equivalent to original | default value, behavior when detail is not passed |
Setting detail to low when running batch screenshot tasks is the most direct way to control multimodal costs.
Messages and Responses formats
Those with existing Anthropic or new OpenAI-style code can switch to DeepSeek multimodal almost seamlessly.
The Messages format uses image content blocks, with images passed via the source field.
Example
Messages format: consistent with the Anthropic Messages API style
The endpoint uses DeepSeek's Anthropic-compatible path /anthropic, and headers are also consistent with Anthropic
curl https:
//
api.deepseek.com
/
anthropic
/
v1
/
messages \
-H
"Content-Type: application/json"
\
-H
"x-api-key: ${DEEPSEEK_API_KEY}"
\
-d
'{
"model": "deepseek-v4-flash-vision-exp",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": [
{
"type": "image",
"source": {
"type": "url",
"url": "https://static.runoob.com/images/code-screenshot.png"
}
},
{"type": "text", "text": "This code will throw an error when run; which line is the problem on?"}
]
}
]
}'
The Responses format uses an input array, with input_text for text and input_image for images.
Example
File path: vision_responses_demo.py
the client is created the same way as in the base64 example above
response
=
client.
responses
.
create
(
model
=
"deepseek-v4-flash-vision-exp"
,
Required: multimodal vision understanding model
input
=
[
{
"role"
:
"user"
,
"content"
:
[
input_text for text, input_image for images
{
"type"
:
"input_text"
,
"text"
:
"Format the table in the screenshot into Markdown"
}
,
{
"type"
:
"input_image"
,
"image_url"
:
"https://static.runoob.com/images/table.png"
}
]
}
]
)
For the Responses format, just take output_text
(
response.
output_text
)
Files API: upload first, reference later
The Files API is now available, and it is free of charge.
Users can first upload images to the platform, then reference them via file_id in requests.
This has two direct benefits: requests no longer carry large base64 blocks, saving bandwidth; the same image need not be re-uploaded across multiple requests.
Step 1: upload the image and obtain the file_id.
Example
Upload image: purpose currently only supports user_data
the upload itself is free and incurs no charges
curl https:
//
api.deepseek.com
/
files \
-H
"Authorization: Bearer ${DEEPSEEK_API_KEY}"
\
-F
"purpose=user_data"
\
-F
"file=@runoob-chart.png"
After a successful upload, the platform returns the file's metadata.
Example
{
"id": "file-api-qw3x8v2m6n",
"object": "file",
"filename": "runoob-chart.png",
"purpose": "user_data",
"bytes": 154320,
"created_at": 1787300000,
"expires_at": 1789900000
}
| Field | Description |
|---|---|
| id | file identifier, starting with file-api-, used by later requests to reference the image |
| filename | the original filename at upload |
| purpose | file purpose, currently only user_data is supported |
| bytes | file size, in bytes |
| created_at | upload time, Unix timestamp |
| expires_at | expiration time, optional, returned only if a validity period was set at upload |
At upload you can also use the expires_after parameter to specify a validity period, ranging from 1 hour to 30 days; if omitted, it is permanently valid.
Step 2: reference this image with file_id in a multimodal request.
{
"model": "deepseek-v4-flash-vision-exp",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "这个图表的整体趋势是什么?"},
{"type": "file", "file_id": "file-api-qw3x8v2m6n"}
]
}
]
}
When to use the Files API?
When the same image is reused across multiple requests (such as batch agent tasks over the same set of screenshots), uploading once and referencing everywhere saves more bandwidth and is faster than passing base64 every time.
The file block also supports file_data with inline base64 (mutually exclusive with file_id, can be paired with the filename field), suitable for occasionally bypassing the upload step.
When referencing file_id via the Anthropic-compatible Messages endpoint, you need to include the extra header anthropic-beta: files-api-2025-04-14.
Billing notes and caveats
Multimodal requests are billed by tokens; images are converted into tokens before billing.
| Billing item | Rule |
|---|---|
| Image billing | images converted to tokens and billed by token |
| Per-image limit | up to 384 tokens |
| Price | consistent with the DeepSeek-V4-Flash model |
| Files API | Free |
Image tokens occupy the context window; for multi-image tasks, watch the total consumption: 10 images can take up to 3840 tokens.
Images are automatically resized before entering the model: images smaller than about 384×384 are enlarged, and larger images are downsized to roughly the equivalent of 800×800 total pixels.
Therefore token consumption depends only on the resized dimensions; 2000×2000 and 5000×5000 images consume the same; in multi-image requests each image is calculated independently by the same rule.
base64 makes the request body noticeably larger; for large images or high-frequency calls, consider using an external URL or the Files API.
Multimodal requests also have some hard limits; exceeding them returns a 400 error directly.
| Limit item | Rule |
|---|---|
| Image format | JPEG, PNG, GIF, WebP, determined by actual file content, not extension |
| external URL length | no more than 8192 characters, and the image must be downloadable within 60 seconds |
| Request body size | no more than 48 MiB |
| single image size | 32 MiB max for base64 and URL methods, 64 MiB max for Files API |
| number of images per request | up to 600 |
| max image side length | 8192 pixels; reduced to 4096 pixels when a request contains 15 or more images |
| image position | only allowed in user messages; images in system or assistant messages cause an error |
V4-Flash-Vision-Exp is an experimental model; capabilities and service specs may change with version iterations, so for critical production pipelines, consider also evaluating the official release model.
For more complete usage instructions, refer to the official API docs:API Guide - Image Understanding、API Guide - Files API。
Summary
With its positioning of "no text shrinkage, big vision leap", V4-Flash-Vision-Exp brings multimodal capability into DeepSeek's agent ecosystem.
For developers, the learning cost is low: just change one model name, and the agent in DeepSeek Harness can understand screenshots, design drafts, and charts.
It is recommended to first try the three official examples to get a feel, then bring in your own business images and run your first "work from images" agent task.