Guides
Images
deepseek-v4-flash can read images. Put them in a user message, next to your text. deepseek-v4-pro does not read images.
Send an image
Give the user message a list of parts instead of a string: a text part with your question and an image_url part with the image. The curl example carries a small red square inline. The Python and Node.js examples read image.png from the current folder.
curl https://acacus.ly/v1/chat/completions \
-H "Authorization: Bearer $ACACUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image? Answer in one short sentence."},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAeUlEQVR4nO3PQQkAMAzAwIqof2UTMxF7HINABFzm7H7dcEEDWtCAFjSgBQ1oQQNa0IAWNKAFDWhBA1rQgBY0oAUNaEEDWtCAFjSgBQ1oQQNa0IAWNKAFDWhBA1rQgBY0oAUNaEEDWtCAFjSgBQ1oQQNa0IAWNKAFj12qxUDxeFqrFAAAAABJRU5ErkJggg=="}}
]
}
],
"thinking": {"type": "disabled"}
}'The reply to the curl example:
{
"id": "e3c42742-e320-4e85-b894-346250b906a0",
"object": "chat.completion",
"created": 1790380421,
"model": "deepseek-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This image is a solid, uniform field of bright red color."
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 200,
"completion_tokens": 13,
"total_tokens": 213,
"prompt_tokens_details": {
"cached_tokens": 0
},
"prompt_cache_hit_tokens": 0,
"prompt_cache_miss_tokens": 200
},
"system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}The image is part of the prompt: prompt_tokens counts it with the text. To send a file with curl, build the body from the file:
# Sends image.png from the current folder. For a JPEG, change image/png to image/jpeg.
{
printf '%s' '{"model": "deepseek-v4-flash", "thinking": {"type": "disabled"}, "messages": [{"role": "user", "content": ['
printf '%s' '{"type": "text", "text": "What is in this image? Answer in one short sentence."}, '
printf '%s' '{"type": "image_url", "image_url": {"url": "data:image/png;base64,'
base64 < image.png | tr -d '\n'
printf '%s' '"}}]}]}'
} | curl https://acacus.ly/v1/chat/completions \
-H "Authorization: Bearer $ACACUS_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @-The message format
"text" or "image_url".text part.data:image/png;base64,...) or as an https link."low" makes DeepSeek scale the image down to 512 × 512 pixels first, which costs fewer tokens for a large image. "high", "original" and "auto" skip that step, the same as sending no detail.- Images go in
usermessages only, not insystem,assistantortoolmessages. - A request can hold up to 32 images, counting every message in
messages. Images from earlier turns of a conversation count again each time you send them. - Only
deepseek-v4-flashreads them.deepseek-v4-prowould answer without seeing the image, so a request that sends it an image is refused.
Data URLs or links
A data URL carries the image inside the request, so it works for any image that fits in the request. Use it for files on your server.
With an https link, DeepSeek downloads the image itself, and some sites refuse it. In our tests, images on upload.wikimedia.org and www.google.com failed with 400 “Failed to download image”, while httpbin.org worked. A link keeps the request small, but check that your image host lets DeepSeek download from it. DeepSeek's documentation sets its own limits for links: at most 8,192 characters, a file of at most 32 MiB, and a download that finishes within 60 seconds.
Formats and size
DeepSeek reads PNG, JPEG, WebP and GIF. All four were tested. DeepSeek works out the format from the image data, so the type in a data URL doesn't have to match: a PNG sent as image/jpeg worked too.
The whole request must be under 2 MB. Base64 makes a file about a third larger, so the image files in one request can add up to about 1.5 MB, less the rest of the request. A larger request gets a 413 page in HTML from the server in front of the API, not a JSON error.
Scale large images down before you send them. DeepSeek resizes every image first: small ones up, and large ones down to about as many pixels as an image of 1,300 × 1,300 pixels. More pixels than that use more of the request size without showing the model more. DeepSeek's own limit is 8,192 pixels per side, or 4,096 pixels when a request has 15 or more images.
What images cost
An image is billed as prompt tokens, at the same price as text. Because of the resizing, one image costs at most 1,024 prompt tokens however large the file is. These are the prompt tokens of one short question with one image, measured on 25 September 2026 (the question alone was 11 tokens):
| Image | prompt_tokens |
|---|---|
| 64 × 64 pixels, PNG, JPEG, WebP or GIF | 195 tokens |
| 512 × 512 pixels, PNG | 195 tokens |
| 1,024 × 1,024 pixels, PNG | 663 tokens |
| 1,024 × 1,024 pixels, PNG with "detail": "low" | 195 tokens |
| 2,048 × 2,048 pixels, PNG | 1,005 tokens |
DeepSeek decides these counts, so check usage.prompt_tokens for your own images. The prices per token are on the Billing and the free tier page.
Free tier
Images work within the free daily allowance, on deepseek-v4-flash. For the free size limit of 80,000 prompt tokens, each image counts as 1,024 tokens. The image data doesn't count toward the free limit of 320,000 bytes for the rest of the request.
Images in the new message also count at 1,024 tokens each against what is left of the day's allowance: at today's settings, one new message can carry 69 images with a short question, or 26 images during DeepSeek's peak hours. Images sent in earlier messages count at the cached price. See the largest new message.
Errors
| Status | code | When |
|---|---|---|
| 400 | MODEL_NO_VISION | The request sends an image to deepseek-v4-pro. |
| 400 | IMAGE_NOT_IN_USER_MESSAGE | An image is in a system, assistant or tool message. |
| 400 | TOO_MANY_IMAGES | More than 32 images. The error has "limit": 32. |
| 400 | DeepSeek's | DeepSeek couldn't download a linked image, or can't read the image. The message says which; it ends with DeepSeek's request_id. |
| 413 | None (an HTML page) | The request is over 2 MB. |
None of these is charged. The error format is on the Errors page.