Developers / Docs / Vision
Vision
The Qwen models on ARK Cloud read images as well as text: documents, screenshots, charts, photos. Put images in the user message next to your question.
API reference: Chat completions
Models
Vision models have "ark_type": "multimodal" in /api/v1/models: arklabsai/Qwen3.6-35B-A3B, arklabsai/Qwen3.5-122B-A10B and arklabsai/Qwen3.5-4B. Send images only to these models.
Send an image
Use a content array with text and image_url parts. The URL can be a public https:// address, which ARK downloads, or a data: URL with base64 data.
import base64
with open("invoice.png", "rb") as f:
b64 = base64.b64encode(f.read()).decode()
response = client.chat.completions.create(
model="arklabsai/Qwen3.6-35B-A3B",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What is the total amount on this invoice?"},
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{b64}"}},
],
}],
)
print(response.choices[0].message.content)import { readFileSync } from "node:fs";
const b64 = readFileSync("invoice.png").toString("base64");
const response = await client.chat.completions.create({
model: "arklabsai/Qwen3.6-35B-A3B",
messages: [{
role: "user",
content: [
{ type: "text", text: "What is the total amount on this invoice?" },
{ type: "image_url", image_url: { url: `data:image/png;base64,${b64}` } },
],
}],
});
console.log(response.choices[0].message.content);curl https://api.ark-labs.cloud/api/v1/chat/completions \
-H "Authorization: Bearer $ARK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "arklabsai/Qwen3.6-35B-A3B",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image."},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
]
}]
}'Several images can go in one message; refer to them in order ("the first image", "the second image").
Image size and tokens
- Each image is resized to between 256 and 1,280 image tokens (about 0.26 to 1.3 megapixels), keeping its aspect ratio. Larger images do not cost more than the upper bound.
- Image tokens are part of
prompt_tokens. On ARK Cloud they also carry a small image surcharge; see Pricing. - The original images of one request may add up to 100 megapixels at most; larger requests get
400. detailis accepted and has no effect.
Errors
- An image that cannot be downloaded or decoded returns
400with "The requested image cannot be processed". - Only
textandimage_urlparts are accepted;input_audioandfileparts return400.
With the Anthropic API
Python
message = client.messages.create(
model="arklabsai/Qwen3.5-122B-A10B",
max_tokens=1024,
messages=[{
"role": "user",
"content": [
{"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": b64}},
{"type": "text", "text": "What is the total amount on this invoice?"},
],
}],
)