Thedeepseek-v4-flash-vision-expmodel accepts images alongside text, so you can ask the model to describe pictures, read text from screenshots, analyze charts, and more.
Supported image formats:JPEG, PNG, GIF, and WebP. The format is detected from the actual file content, not from the file name or the declared MIME type.
There are three ways to provide an image to the model. All of them use the standard OpenAI-compatible Chat Completions format, wherecontentis an array of blocks instead of a plain string. The same three methods are also available in theResponses API, where images are carried ininput_imagecontent parts.
Thebase_urlfor the examples below ishttps://api.deepseek.com.
Encode the image and embed it directly in the request as adata:URL. This is the simplest option for local files. The encoded data counts toward the48 MiBrequest body limit (seeLimits).
Pass a publicly accessiblehttp(s)link and the model downloads the image for you. The URL must be at most8192 characters, the image file may be at most32 MiB, and the download must complete within60 seconds. If your link is longer, use a base64 data URL or the Files API instead.
Upload an image once with theFiles API, then reference itsfile_idin your requests. This is the best option when you reuse the same image across multiple requests, or when the image pushes the request body over the 48 MiB inline limit. Unlike inline images, images referenced via Files APIfile_idmay be up to 64 MiB and are not subject to the 32 MiB per-image check.
Use afilecontent block with the returnedfile_id(which has the formfile-api-…):
Alternatively, afileblock can carry the image inline as base64 viafile_datainstead offile_id(the two are mutually exclusive):
Forimage_urlinputs you can optionally set adetailfield to control how the image is processed:
Inline images (base64 orfile_data) count toward the request body size limit of48 MiB. Consider theFiles APIwhen:
Images are converted into tokens based on their dimensions, and these tokens are billed together with your text tokens.