{
    "archive_path": "archive/1787686601.299338",
    "base_url": "api-docs.deepseek.com/guides/vision",
    "basename": "",
    "bookmarked_date": "2026-08-25 19:36",
    "canonical": {
        "archive_org_path": "https://web.archive.org/web/api-docs.deepseek.com/guides/vision",
        "dom_path": "output.html",
        "favicon_path": "favicon.ico",
        "git_path": "git/",
        "google_favicon_path": "https://www.google.com/s2/favicons?domain=api-docs.deepseek.com",
        "headers_path": "headers.json",
        "htmltotext_path": "htmltotext.txt",
        "index_path": "index.html",
        "media_path": "media/",
        "mercury_path": "mercury/content.html",
        "pdf_path": "output.pdf",
        "readability_path": "readability/content.html",
        "screenshot_path": "screenshot.png",
        "singlefile_path": "singlefile.html",
        "warc_path": "warc/",
        "wget_path": "api-docs.deepseek.com/guides/vision/index.html"
    },
    "domain": "api-docs.deepseek.com",
    "extension": "",
    "hash": "6KQGAEZ3RVMJW6D46MBZ",
    "history": {
        "archive_org": [],
        "dom": [],
        "favicon": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "60",
                    "--output",
                    "favicon.ico",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://www.google.com/s2/favicons?domain=api-docs.deepseek.com"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-08-25T19:40:27.463921+00:00",
                "index_texts": null,
                "output": "favicon.ico",
                "pwd": "/data/archive/1787686601.299338",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-25T19:40:26.932037+00:00",
                "status": "succeeded"
            }
        ],
        "git": [],
        "headers": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--head",
                    "--max-time",
                    "60",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://api-docs.deepseek.com/guides/vision/"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-08-25T19:40:27.896606+00:00",
                "index_texts": null,
                "output": "headers.json",
                "pwd": "/data/archive/1787686601.299338",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-25T19:40:27.469961+00:00",
                "status": "succeeded"
            }
        ],
        "htmltotext": [],
        "media": [],
        "mercury": [
            {
                "cmd": [
                    "/app/node_modules/@postlight/parser/cli.js",
                    "https://api-docs.deepseek.com/guides/vision/"
                ],
                "cmd_version": "1.0.0",
                "end_ts": "2026-08-25T19:40:42.002890+00:00",
                "index_texts": null,
                "output": "mercury",
                "pwd": "/data/archive/1787686601.299338",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-25T19:40:36.551400+00:00",
                "status": "succeeded"
            }
        ],
        "pdf": [],
        "readability": [
            {
                "cmd": [
                    "/app/node_modules/readability-extractor/readability-extractor",
                    "/tmp/tmp4i66l0z8",
                    "https://api-docs.deepseek.com/guides/vision/"
                ],
                "cmd_version": "0.0.11",
                "end_ts": "2026-08-25T19:40:36.543852+00:00",
                "index_texts": [
                    "Vision\nThe deepseek-v4-flash-vision-exp model accepts images alongside text, so you can ask the model to describe pictures, read text from screenshots, analyze charts, and more.\nSupported 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.\n\nSending Images\u200b\nThere are three ways to provide an image to the model. All of them use the standard OpenAI-compatible Chat Completions format, where content is an array of blocks instead of a plain string. The same three methods are also available in the Responses API, where images are carried in input_image content parts.\nThe base_url for the examples below is https://api.deepseek.com.\n1. Base64-encoded image (inline)\u200b\nEncode the image and embed it directly in the request as a data: URL. This is the simplest option for local files. The encoded data counts toward the 48 MiB request body limit (see Limits).\nimport base64from openai import OpenAIclient = OpenAI(api_key=\"<DeepSeek API Key>\", base_url=\"https://api.deepseek.com\")with open(\"image.jpg\", \"rb\") as f:    b64 = base64.b64encode(f.read()).decode(\"utf-8\")response = client.chat.completions.create(    model=\"deepseek-v4-flash-vision-exp\",    messages=[        {            \"role\": \"user\",            \"content\": [                {\"type\": \"text\", \"text\": \"What is in this image?\"},                {                    \"type\": \"image_url\",                    \"image_url\": {\"url\": f\"data:image/jpeg;base64,{b64}\"},                },            ],        }    ],)print(response.choices[0].message.content)\ncurl 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\": \"What is in this image?\"},          {\"type\": \"image_url\", \"image_url\": {\"url\": \"data:image/jpeg;base64,<BASE64_DATA>\"}}        ]      }    ]  }'\n2. External image URL\u200b\nPass a publicly accessible http(s) link and the model downloads the image for you. The URL must be at most 8192 characters, the image file may be at most 32 MiB, and the download must complete within 60 seconds. If your link is longer, use a base64 data URL or the Files API instead.\nresponse = client.chat.completions.create(    model=\"deepseek-v4-flash-vision-exp\",    messages=[        {            \"role\": \"user\",            \"content\": [                {\"type\": \"text\", \"text\": \"Describe this image.\"},                {                    \"type\": \"image_url\",                    \"image_url\": {\"url\": \"https://example.com/image.jpg\"},                },            ],        }    ],)print(response.choices[0].message.content)\n3. Reference a file uploaded via the Files API\u200b\nUpload an image once with the Files API, then reference its file_id in 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 API file_id may be up to 64 MiB and are not subject to the 32 MiB per-image check.\nUse a file content block with the returned file_id (which has the form file-api-...):\nresponse = client.chat.completions.create(    model=\"deepseek-v4-flash-vision-exp\",    messages=[        {            \"role\": \"user\",            \"content\": [                {\"type\": \"text\", \"text\": \"What is in this image?\"},                {\"type\": \"file\", \"file_id\": \"file-api-xxxxxxxxxxxxxxxx\"},            ],        }    ],)print(response.choices[0].message.content)\nAlternatively, a file block can carry the image inline as base64 via file_data instead of file_id (the two are mutually exclusive):\n{  \"type\": \"file\",  \"file_data\": \"data:image/jpeg;base64,<BASE64_DATA>\",  \"filename\": \"image.jpg\"}\n\nDetail Level\u200b\nFor image_url inputs you can optionally set a detail field to control how the image is processed:\nValueBehaviorlowThe image is downscaled to 512\u00d7512 before inference. Faster and cheaper when fine visual detail is not important.highKeeps the original image. (Provided for compatibility; equivalent to original.)originalKeeps the original image.autoAutomatic selection. Currently equivalent to original.\n{  \"type\": \"image_url\",  \"image_url\": {\"url\": \"https://example.com/image.jpg\", \"detail\": \"low\"}}\n\nWhen to Use the Files API\u200b\nInline images (base64 or file_data) count toward the request body size limit of 48 MiB. Consider the Files API when:\n\nA single request would exceed the body size limit.\nThe image is larger than 32 MiB, which is only possible through the Files API.\nYou reference the same image in multiple requests and want to avoid re-uploading it each time.\n\n\nToken Usage\u200b\nImages are converted into tokens based on their dimensions, and these tokens are billed together with your text tokens.\nBefore inference, every image is automatically resized:\n\nImages with a total pixel count below roughly 384\u00d7384 are scaled up while preserving their aspect ratio.\nLarger images are scaled down while preserving their aspect ratio, so that the total pixel count after resizing is roughly that of an 800\u00d7800 image.\n\nAs a result, there is an upper bound of 384 tokens per image: for example, a 2000\u00d72000 image and a 5000\u00d75000 image consume the same number of tokens after resizing. When a request contains multiple images, each image is counted independently under the same rule \u2014 there is no separate calculation for multi-image requests.\nTo estimate the token cost of an image of a specific size, use the image token calculator on the Token & Token Usage page.\n\nLimits\u200b\nLimitValueSupported formatsJPEG, PNG, GIF, WebPExternal URL length8192 charactersRequest body size48 MiBMax single image size (base64 / external URL)32 MiBMax single image size (Files API file_id)64 MiBMax images per request600Max total image size per request64 MiB without file_id images; up to 200 MiB including file_id imagesMax image dimension8192 px per side; drops to 4096 px per side when a request contains 15 or more images\nFor storage and upload quotas of files uploaded via the Files API, see Files API: Limits.\n\nRestrictions\u200b\n\nImages are supported in user messages only: images in system or assistant messages return a 400 error.\nOnly vision models (deepseek-v4-flash-vision-exp) accept images; other models return a 400 error (\"This model does not support image\").\nUser text containing the reserved image placeholder token is rejected with a 400 error.\n\n\nUsing Images with the Anthropic API\u200b\nIn addition to the OpenAI-compatible endpoint above, you can send images through the Anthropic-compatible /messages endpoint (base_url = https://api.deepseek.com/anthropic). For general setup, see Anthropic API.\nThe difference is the shape of the image content block. Instead of image_url, Anthropic uses an image block with a source object whose type is one of base64, url, or file:\nimport anthropicclient = anthropic.Anthropic()  # ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropicmessage = client.messages.create(    model=\"deepseek-v4-flash-vision-exp\",    max_tokens=1024,    messages=[        {            \"role\": \"user\",            \"content\": [                {\"type\": \"text\", \"text\": \"What is in this image?\"},                {                    \"type\": \"image\",                    \"source\": {                        \"type\": \"base64\",                        \"media_type\": \"image/jpeg\",                        \"data\": \"<BASE64_DATA>\",                    },                },            ],        }    ],)print(message.content)\nThe three source variants mirror the OpenAI methods above:\nsource.typeEquivalent OpenAI methodNotesbase64Base64-encoded imageRequires a media_type field (image/jpeg, image/png, image/gif, or image/webp).urlExternal image URLMax 8192 characters.fileFiles API file_idRequires the header anthropic-beta: files-api-2025-04-14.\n\nUsing Images with the Responses API\u200b\nThe deepseek-v4-flash-vision-exp model also accepts images through the OpenAI-compatible Responses API. The same three input methods (base64 data URL, external http(s) URL, Files API file_id) and the same limits apply; only the content part shape differs \u2014 images are carried in input_image parts, either in user / developer messages or in the output of function_call_output / custom_tool_call_output items:\nresponse = client.responses.create(    model=\"deepseek-v4-flash-vision-exp\",    input=[        {            \"role\": \"user\",            \"content\": [                {\"type\": \"input_text\", \"text\": \"What is in this image?\"},                {\"type\": \"input_image\", \"image_url\": \"https://example.com/image.jpg\", \"detail\": \"low\"},            ],        }    ],)print(response.output_text)\nThe input_image part supports a detail field with the same semantics as above (low / high / original / auto). detail is ignored when the image is provided via file_id, and image_url and file_id are mutually exclusive.\nFor field semantics, restrictions (images in system / assistant messages are rejected with a 400 error), and tool-output images, see the Responses API guide."
                ],
                "output": "readability",
                "pwd": "/data/archive/1787686601.299338",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-25T19:40:34.074883+00:00",
                "status": "succeeded"
            }
        ],
        "screenshot": [],
        "singlefile": [],
        "title": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "60",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://api-docs.deepseek.com/guides/vision/"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-08-25T19:40:34.064458+00:00",
                "index_texts": null,
                "output": "Vision | DeepSeek API Docs",
                "pwd": "/data/archive/1787686601.299338",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-25T19:40:34.025042+00:00",
                "status": "succeeded"
            }
        ],
        "wget": [
            {
                "cmd": [
                    "wget",
                    "--no-verbose",
                    "--adjust-extension",
                    "--convert-links",
                    "--force-directories",
                    "--backup-converted",
                    "--span-hosts",
                    "--no-parent",
                    "-e",
                    "robots=off",
                    "--timeout=60",
                    "--restrict-file-names=windows",
                    "--warc-file=/data/archive/1787686601.299338/warc/1787686827",
                    "--page-requisites",
                    "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) wget/GNU Wget 1.21.3",
                    "--compression=auto",
                    "https://api-docs.deepseek.com/guides/vision/"
                ],
                "cmd_version": "GNU Wget 1.21.3",
                "end_ts": "2026-08-25T19:40:34.019249+00:00",
                "index_texts": null,
                "output": "api-docs.deepseek.com/guides/vision/index.html",
                "pwd": "/data/archive/1787686601.299338",
                "schema": "ArchiveResult",
                "start_ts": "2026-08-25T19:40:27.903904+00:00",
                "status": "succeeded"
            }
        ]
    },
    "icons": null,
    "is_archived": true,
    "is_static": false,
    "latest": {
        "archive_org": null,
        "dom": null,
        "favicon": "favicon.ico",
        "git": null,
        "media": null,
        "pdf": null,
        "screenshot": null,
        "singlefile": null,
        "title": "Vision | DeepSeek API Docs",
        "warc": null,
        "wget": "api-docs.deepseek.com/guides/vision/index.html"
    },
    "link_dir": "/data/archive/1787686601.299338",
    "newest_archive_date": "2026-08-25T19:40:36.551400+00:00",
    "num_failures": 0,
    "num_outputs": 6,
    "oldest_archive_date": "2026-08-25T19:40:26.932037+00:00",
    "path": "/guides/vision/",
    "schema": "Link",
    "scheme": "https",
    "snapshot_id": "f3bf23cd-a399-4ad8-9880-5c6110fcb0aa",
    "sources": [
        "/data/sources/1787686601-import.txt"
    ],
    "tags": null,
    "tags_str": "",
    "timestamp": "1787686601.299338",
    "title": "Vision | DeepSeek API Docs",
    "updated": "2026-08-25T19:40:26.931653+00:00",
    "updated_date": "2026-08-25 19:40",
    "url": "https://api-docs.deepseek.com/guides/vision/"
}