Updated 2026-11-20
How to Send a Screenshot to DeepSeek V4.1 Flash
Send the screenshot and its question together in one user message to deepseek-flash. For a local PNG, encode the image as a base64 data URL. Flash can use the pixels to read a visible error or identify a clipped label.
Prepare the screenshot and your API key
Save the image as screenshot.png in your working folder. Capture the dialog or panel along with the text around it. Crop unrelated details and remove credentials or personal information. For a small UI label, keep the image at its original resolution so the letters stay legible.
The example uses Bash, Python 3 and an official DeepSeek API key with API credit. Python's standard library reads the local PNG and sends it directly to DeepSeek. You can keep the screenshot off public image hosts.
read -r -s -p "Official DeepSeek API key: " DEEPSEEK_API_KEY
export DEEPSEEK_API_KEY
printf '\n'Send the local PNG and ask about visible evidence
Build one user message with a text part and an image_url part. The image part contains an object with a url field. For a PNG that field starts with data:image/png;base64, followed by the encoded bytes. Edit the question to match what you need to find in your own screenshot.
python3 - <<'PY'
import base64
import json
import os
from pathlib import Path
from urllib.request import Request, urlopen
encoded = base64.b64encode(Path("screenshot.png").read_bytes()).decode("ascii")
payload = {
"model": "deepseek-flash",
"thinking": {"type": "disabled"},
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": (
"Quote the visible error message and name the button closest to it. "
"If either is absent or unreadable, say which one."
)},
{"type": "image_url", "image_url": {"url": "data:image/png;base64," + encoded}},
],
}],
}
request = Request(
"https://api.deepseek.com/chat/completions",
data=json.dumps(payload).encode("utf-8"),
headers={"Authorization": "Bearer " + os.environ["DEEPSEEK_API_KEY"],
"Content-Type": "application/json"},
)
with urlopen(request, timeout=120) as response:
result = json.load(response)
print(result["choices"][0]["message"]["content"])
PYUse an existing public image URL
For a screenshot already hosted publicly, use its direct HTTPS address as the value of image_url.url. Remove the line that reads screenshot.png and replace the image part as shown. Use a URL you control that returns image bytes without logging in. A link to a webpage containing an image points at a different resource.
{
"type": "image_url",
"image_url": {
"url": "<direct HTTPS URL of your screenshot>"
}
}Check the answer against the screen
Open the original beside the answer and compare the quoted message, button text and location. If a label is unreadable, make a closer crop that retains the nearby controls. If you need the cause of an error, supply the relevant logs or source code separately; the screenshot only shows what the interface displayed.
For an HTTP 400, check that the message role is user, the image MIME type matches the file, and both content parts are inside the same array. For a large image, check the documented limits before retrying. DeepSeek lists 32 MiB per inline or external image and 48 MiB for the entire request body, including base64 encoding.
FAQ
Can Flash read a JPEG screenshot?
Yes. Read the JPEG's bytes and use data:image/jpeg;base64, as the prefix. DeepSeek also documents PNG, GIF and WebP support.
What if the screenshot is one page inside a PDF?
For a single screenshot, the image_url message part above is sufficient. To ask about an entire PDF and cite its printed pages, upload the document with rich_layout_recognition and put the returned file ID in a file message part.