Images and PDFs
Send images and PDF documents to models that accept them.
Images and PDFs go in the content array of a message, next to text parts, in the OpenAI shape.
| Model | Images | PDFs |
|---|---|---|
GLM-5.3 | Not supported | Yes |
GLM-5.3-Flash | Yes | Yes |
DeepSeek-V4-Pro | Not supported | Yes |
DeepSeek-V4-Flash-0731 | Not supported | Yes |
DeepSeek-V4.1-Flash | Yes | Yes |
Muse-Spark-Open | Yes | Yes |
GET /v1/models lists what each model accepts in input_modalities, for example ["text", "image", "pdf"].
Send an image
Send an image_url part with either a base64 data URL or an https link. Qloud downloads linked images itself, so the link must be publicly reachable. detail is passed through.
curl https://api.qloud.sh/v1/chat/completions \
-H "Authorization: Bearer $QLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "DeepSeek-V4.1-Flash",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What is in this picture?"},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
]
}]
}'Send a PDF
Send a file part with the PDF as a base64 data URL in file.file_data. File ids and URLs are not supported.
curl https://api.qloud.sh/v1/chat/completions \
-H "Authorization: Bearer $QLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "GLM-5.3",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Summarize this report."},
{"type": "file", "file": {"filename": "report.pdf", "file_data": "data:application/pdf;base64,'"$(base64 < report.pdf | tr -d '\n')"'"}}
]
}]
}'A scanned PDF can give little or no text. Send its pages as images.
Types and limits
| Images | PDFs | |
|---|---|---|
| Formats | PNG, JPEG, WebP, GIF | |
| Sent as | Base64 data URL or https link | Base64 data URL in file.file_data |
| Size | 8 MB each | 15 MB each |
| Per request | 50 images | 10 PDFs, 100 pages in total |
Max 20 MB per request. Linked images must be on a public https host. Audio and video are not supported.
Billing
Images and PDFs bill as input tokens. If a chat sends the same file again on each turn, each turn is billed.
Errors
See Errors.