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.

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)

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.
  • detail is accepted and has no effect.

Errors

  • An image that cannot be downloaded or decoded returns 400 with "The requested image cannot be processed".
  • Only text and image_url parts are accepted; input_audio and file parts return 400.

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?"},
        ],
    }],
)