Skip to content

Qwen3 VL 32B Instruct

alibaba/qwen3-vl-32b-instruct — a llm model by Alibaba. Call it through the gateway’s standard OpenAI-compatible door using the catalog slug; the full parameter schema is reproduced in full below.

Catalog slugalibaba/qwen3-vl-32b-instruct
Kindllm
VendorAlibaba
Context window1,000,000 tokens
Native model idqwen3-vl-32b-instruct

Through the Sociaro SDK / OpenAI-compatible door

Section titled “Through the Sociaro SDK / OpenAI-compatible door”
from sociaro_ai import Sociaro
client = Sociaro(api_key="gw_live_...") # base_url defaults to https://api.sociaro.com
resp = client.chat.completions.create(
model="alibaba/qwen3-vl-32b-instruct", # always the catalog slug
messages=[{"role": "user", "content": "Hello"}],
# any parameter from the schema below is passed through unchanged
)
print(resp.choices[0].message.content)

TypeScript: client.chat.completions.create({ model: "alibaba/qwen3-vl-32b-instruct", messages: [...] }) — see the TypeScript SDK.

Through Alibaba DashScope’s native API (advanced)

Section titled “Through Alibaba DashScope’s native API (advanced)”

Optional: send Alibaba DashScope’s native request to the /alibaba prefix, using the native model id qwen3-vl-32b-instruct. The gateway injects the upstream Alibaba DashScope credential and forwards the body unchanged (catalog, pricing and entitlements still apply).

Terminal window
curl https://api.sociaro.com/alibaba/<native-path> \
-H "Authorization: Bearer $SOCIARO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "qwen3-vl-32b-instruct", ... }'

The exact path, request body and response shape are documented in full in the schema below.

The complete, one-to-one API schema for this model, transcribed from the official source. Nothing omitted. Examples in the schema may use a representative model of the family — for this model use the slug alibaba/qwen3-vl-32b-instruct (or the native id qwen3-vl-32b-instruct for the native API) as shown in How to call above.

ONE door, ONE parameter contract. All slugs are invoked through either:

  • OpenAI-compatible: POST /compatible-mode/v1/chat/completions, OR
  • Native DashScope: POST /api/v1/services/aigc/multimodal-generation/generation

The parameter set is identical across the family; only defaults / numeric ranges (pixel limits, thinking defaults) differ per sub-family.

Model group (slugs)VisionOCR tasksenable_thinkingtop_k defpresence_penalty defpx/tokenhi-res cap
qwen3-vl-plus, qwen3-vl-flash (hybrid)yesnotoggleable (def per Supported-models table)201.5 (non-thinking)32×3216,777,216
qwen3-vl-235b-a22b-instruct / -thinking (close-source)yesnoinstruct=toggleable; -thinking = always-on (cannot disable)201.5 (non-thinking)32×3216,777,216
qwen3-vl-* other open-source (8b/30b-a3b/32b × instruct/thinking)yesno-thinking always-on; -instruct toggleable201.5 (non-thinking)32×3216,777,216
qwen3.7-max-visionyesnotoggleable (def per Supported-models table)201.5 (non-thinking)32×3216,777,216
qwen-vl-ocr, qwen-vl-ocr-latest, qwen-vl-ocr-2025-11-20, qwen-vl-ocr-2025-08-28, qwen-vl-ocr-2025-04-13, qwen-vl-ocr-2024-10-28yes (OCR-specialized)yes (ocr_options, enable_rotate)n/a1.5 rec. for OCR extraction32×32 for ocr / latest / 2025-11-20; 28×28 for older snapshots

NOTE on adjacent families that ride the SAME door (NOT part of qwen-vl, but params appear because the contract is shared): Qwen3.7/3.6/3.5 text series, Qwen3.5-Omni / Qwen-Omni (modalities/audio), DeepSeek-V4 (reasoning_effort), MiniMax-M3 (thinking object), GLM, Kimi. Pixel rows for these are kept in the value tables for completeness because the official pixel tables enumerate them together.

Critical per-model differences (read first)

Section titled “Critical per-model differences (read first)”
  1. OCR built-ins (ocr_options, enable_rotate) exist ONLY on qwen-vl-ocr* and ONLY via native DashScope SDK/HTTP. In OpenAI-compatible mode you must hand-write the task prompt into the text part.
  2. Pixel-per-token = 32×32 for the Qwen3-VL series, qwen3.7-max-vision, and the Qwen3-VL-architecture OCR snapshots (qwen-vl-ocr / -latest / -2025-11-20). = 28×28 for the older OCR snapshots (-2025-08-28 / -2025-04-13 / -2024-10-28). This drives the hi-res cap (16,777,216 vs 12,845,056) and token counts.
  3. Thinking: -thinking slugs always reason and ignore enable_thinking=false. Hybrid qwen3-vl-plus/-flash and qwen3.7-max-vision honor enable_thinking. Per-model enable_thinking defaults are listed in the “Supported models” table referenced from the chat-completions page.
  4. OCR max_tokens: defaults to 4096 for qwen-vl-ocr, qwen-vl-ocr-2025-04-13, qwen-vl-ocr-2025-08-28; raisable to 4097–8192 only by contacting the commercial manager.
  5. Audio-from-video is NOT supported by any Qwen-VL model (only Qwen-Omni). modalities/audio output params apply only to Qwen-Omni.

1. Request body — shape (OpenAI-compatible mode)

Section titled “1. Request body — shape (OpenAI-compatible mode)”
{
"model": "qwen3-vl-plus",
"messages": [
{
"role": "user",
"content": [
{ "type": "image_url",
"image_url": { "url": "https://.../img.jpg" },
"min_pixels": 65536,
"max_pixels": 2621440 },
{ "type": "text", "text": "Describe this image." }
]
}
],
"stream": false,
"temperature": 0.7,
"max_tokens": 2048,
"vl_high_resolution_images": false,
"enable_thinking": false,
"thinking_budget": 81920
}

Non-standard OpenAI fields (vl_high_resolution_images, enable_thinking, thinking_budget, top_k, repetition_penalty, enable_search, search_options, tool_stream, preserve_thinking, reasoning_effort, enable_code_interpreter, thinking): in Python SDK pass via extra_body={...}; in Node.js SDK as top-level fields; in curl/HTTP (compatible-mode) as top-level body fields; in native DashScope HTTP inside "parameters".

1b. Request body — shape (native DashScope mode)

Section titled “1b. Request body — shape (native DashScope mode)”
{
"model": "qwen3-vl-plus",
"input": {
"messages": [
{ "role": "user",
"content": [
{ "image": "https://.../img.jpg", "min_pixels": 65536, "max_pixels": 2621440 },
{ "text": "Describe this image." }
] }
]
},
"parameters": {
"vl_high_resolution_images": false,
"incremental_output": false,
"result_format": "message",
"ocr_options": { "task": "advanced_recognition" }
}
}

Native mode: content keys are image / video / text (no image_url/video_url/type); all generation params live in the parameters object.


2. Top-level request parameters (complete table)

Section titled “2. Top-level request parameters (complete table)”
nametyperequireddefaultallowed / rangedescription
modelstringyesmodel slugModel name (qwen3-vl-*, qwen-vl-ocr*, qwen3.7-max-vision).
messagesarrayyesSystem / User / Assistant / Tool message objectsConversation history in chronological order. content structure see §3.
streambooleannofalsetrue / falseStream output in chunks. Recommended true for long outputs (else 300s timeout risk).
stream_optionsobjectno{ "include_usage": bool }Effective only when stream=true. include_usage (bool, def false) adds a final usage chunk.
temperaturefloatnomodel-dependent (console)[0, 2)Sampling temperature. Set ONLY temperature OR top_p.
top_pfloatnomodel-dependent (console)(0, 1.0]Nucleus sampling. Set ONLY top_p OR temperature.
top_kintegernoQwen3-VL series, qwen3.7-max-vision & “all other models”: 20; Qwen3-Omni-Flash: 50integer ≥ 0; null or >100 → top_k disabled (top_p only)Number of candidate tokens. Non-OpenAI → extra_body. DeepSeek/Kimi/MiniMax do NOT support top_k.
repetition_penaltyfloatnomodel-dependent> 0, no strict upper bound; 1.0 = no penaltyPenalty on repeated consecutive sequences. Non-OpenAI → extra_body.
presence_penaltyfloatnoQwen3-VL (non-thinking) / qwen3.7-max-vision: 1.5; thinking modes of qwen3-8b…235b etc.: 0.5; all other: 0.0[-2.0, 2.0]Presence penalty (independent of frequency). Positive → less repetition. 1.5 recommended for OCR text extraction.
response_formatobjectno{"type":"text"}{"type":"text"} / {"type":"json_object"}Response format. With json_object you MUST explicitly request JSON in the prompt, else error.
max_tokensintegerno (Deprecated)model max output (console)integerMax response tokens; on hit finish_reason=length. Does NOT limit CoT. Replacement → max_completion_tokens. (OCR qwen-vl-ocr/-2025-04-13/-2025-08-28: default 4096, raisable to 8192 by contacting commercial manager.)
max_completion_tokensintegernomodel max output (console)integerMax response tokens INCLUDING CoT. Recommended for reasoning models.
vl_high_resolution_imagesbooleannofalsetrue / falseIncreases the max input-image pixel limit to the pixel value of 16384 tokens. true → fixed-resolution strategy, max_pixels is IGNORED (image downscaled to the cap). Cap = 16,777,216 (Qwen3-VL series / qwen3.7-max-vision / OCR snapshots on the Qwen3-VL architecture); = 12,845,056 (older 28×28 OCR snapshots). false → limit follows max_pixels. Non-OpenAI → extra_body. Applies to image inputs.
nintegerno11..4Number of response candidates. Qwen3 (non-thinking) only; with toolsn=1. Increases output tokens.
enable_thinkingbooleannovaries per model (see Supported-models table)true / falseEnables thinking for hybrid models. With true, CoT in reasoning_content. Non-OpenAI → extra_body. No effect on -thinking (always-on) models. DeepSeek-V4 uses reasoning_effort; MiniMax-M3 uses thinking instead.
thinking_budgetintegernomodel max CoT lengthintegerToken cap on reasoning; on exceed → CoT truncated and answer emitted immediately. Applies to Qwen3-VL. Non-OpenAI → extra_body.
reasoning_effortstringnohighhigh / max (low,mediumhigh; xhighmax)Reasoning intensity for DeepSeek-V4 (deepseek-v4-pro / -flash). Non-OpenAI → extra_body. (Listed for door completeness; not a Qwen-VL knob.)
thinkingobjectno{"type":"adaptive"}typeadaptive / disabledThinking mode for MiniMax/MiniMax-M3 (Xiyu direct) — alternative to enable_thinking. Non-OpenAI → extra_body. (Door-shared.)
preserve_thinkingbooleannofalsetrue / falseAdd prior assistant reasoning_content into the input (billed). Non-OpenAI → extra_body. Supported on qwen3.7-max/-2026-05-20+ and later snapshots.
seedintegerno[0, 2^31−1]Seed for reproducibility.
logprobsbooleannofalsetrue / falseReturn log-probabilities. Supported on Qwen-plus snapshots (excluding stable), incl. qwen3-vl-plus / qwen3-vl-flash. reasoning_content has no logprobs.
top_logprobsintegerno00..5Top candidates per step. Effective only when logprobs=true.
stopstring | arraynostring / array of strings OR token_id; do not mix strings and token_id in one arrayStop words/tokens — generation halts.
toolsarraynoarray of {type:"function", function:{name, description, parameters}}Tools for function calling. name ≤ 64 chars, [A-Za-z0-9_-].
tool_choicestring | objectnoautoauto / none / {"type":"function","function":{"name":"..."}}Tool selection policy. Forcing a specific tool is NOT supported in thinking mode.
parallel_tool_callsbooleannofalsetrue / falseEnable parallel tool calling.
tool_streambooleannofalsetrue / falseStream complex tool arguments (only when stream=true; Qwen & GLM series). Non-OpenAI → extra_body.
enable_searchbooleannofalsetrue / falseEnable web search (increases token consumption; may need forced_search). Non-OpenAI → extra_body.
search_optionsobjectnosee §2aWeb search strategy (effective when enable_search=true). Non-OpenAI → extra_body.
enable_code_interpreterbooleannofalsetrue / falseEnable the Code Interpreter feature. Non-OpenAI → extra_body. (Door-shared.)
ocr_optionsobjectno{ "task": <enum>, "task_config": {...} }Native DashScope SDK/HTTP only (absent in OpenAI mode). Built-in OCR tasks. See §4.
modalitiesarrayno["text"]["text"] / ["text","audio"]Output modalities. Qwen-Omni only (NOT Qwen-VL).
audioobjectno{voice (required), format (required, only "wav")}Output audio voice/format. Qwen-Omni only, requires modalities=["text","audio"].
propertytyperequireddefaultalloweddescription
forced_searchbooleannofalsetrue / falseForce web search (only when enable_search=true).
search_strategystringnoturboturbo / max / agent / agent_maxSearch scale. turbo=balanced; max=multi-engine; agent=multi-round (qwen3.5-plus/flash, qwen3-max snapshots, qwen3.5-omni-plus/flash); agent_max=agent+web extraction (thinking mode of qwen3-max / qwen3-max-2026-01-23 only).
enable_search_extensionbooleannofalsetrue / falseDomain-specific search (only when enable_search=true). Non-OpenAI → extra_body.

2b. Native-DashScope parameters (not on the OpenAI-compatible page)

Section titled “2b. Native-DashScope parameters (not on the OpenAI-compatible page)”

These live in the parameters object on the native DashScope generation API (and in the Python/Java/Node native SDKs).

nametypedefaultscopedescription
incremental_outputbooleanfalsenative onlyNative streaming: emit incremental deltas instead of the full cumulative text each chunk. The OpenAI-compatible equivalent is stream + stream_options (deltas are returned natively in compatible mode).
result_formatstringmessagenative onlyShape of the returned data: message (OpenAI-style messages) or text. Must be message when using tools (function calling).
vl_enable_image_hw_outputbooleanfalsenative onlyReturn the height/width of the scaled input image. Casing differs by SDK: vl_enable_image_hw_output in the HTTP parameters object and the Python SDK; vlEnableImageHwOutput in the Java SDK (≥ 2.20.8).
max_framesintegermodel-dependentnative onlyCap on the number of extracted video frames. Not supported on the OpenAI-compatible path — that path uses each model’s default. Default/max are model-dependent (8000 for the top qwen3.x series).

3. messages[].content structure (multimodal input)

Section titled “3. messages[].content structure (multimodal input)”

content is a string (text only) or an array of part objects.

fieldtyperequiredvalues / description
typestringyes (OpenAI mode)text / image_url / input_audio / video / video_url. (Native mode: no type; the part key IS the type.)
textstringwhen type=textInput text.
image_urlobjectwhen type=image_url{ "url": <string, required> }. url = HTTP(S) or Base64 Data URL.
input_audioobjectwhen type=input_audio{ "data": <url/base64, required>, "format": <"mp3"/"wav", required> }. (Omni.)
videoarraywhen type=videoImage list (frames), e.g. ["https://f1.jpg", ...].
video_urlobjectwhen type=video_url{ "url": <required> } + optional fps. Only some Qwen-VL accept a video file.
fpsfloatno (inside video/video_url)[0.1, 10], default 2.0. Frames extracted per second (1 frame each 1/fps s); also informs the model of inter-frame interval. (MiniMax-M3: range [0.2, 5], default 1.)
min_pixelsintegerno (inside image/video part)Lower pixel threshold; below → upscale. Defaults see §3a.
max_pixelsintegerno (inside image/video part)Upper pixel threshold; above → downscale. Defaults see §3a.
total_pixelsintegerno (inside video/image-list part)Caps total pixels across ALL extracted frames (px/frame × frame count); per-frame stays within [min_pixels, max_pixels]. Lower it for long videos to cut tokens. Defaults/max see §3a.
enable_rotatebooleanno (inside image part, OCR)false default. Auto image-rotation correction. Native DashScope SDK/HTTP only, qwen-vl-ocr.
cache_controlobjectno (on a system- or user-message content block){ "type": "ephemeral" } — marks the block for explicit context caching. Gated to a supported-model subset. Available on the native path AND the OpenAI-/Anthropic-compatible paths. Min 1024 tokens per cached block, up to 4 markers per request, 5-minute TTL.

Native content keys: {"image": <url>}, {"video": <url|list>}, {"text": <str>} (instead of image_url/video_url/type).

3a. min_pixels / max_pixels / total_pixels / vl_high_resolution_images per-model values

Section titled “3a. min_pixels / max_pixels / total_pixels / vl_high_resolution_images per-model values”

min_pixels — IMAGE input (default = minimum):

Familydefault = min
Qwen3.7 / Qwen3.6 / Qwen3.5 / Qwen3-VL / qwen3.7-max-vision65536
Qwen3.5-Omni24576

min_pixels — VIDEO file / image-list input:

Familydefaultmin
Qwen3.7/3.6/3.5-Omni/3.5/Qwen3-VL (close-source+open-source), qwen3.7-max-vision655364096

max_pixels — IMAGE input, vl_high_resolution_images=false:

Familydefaultmax
Qwen3.7/3.6/3.5 / Qwen3-VL / qwen3.7-max-vision262144016777216
Qwen3.5-Omni131072016777216

vl_high_resolution_images=truemax_pixels invalid, fixed cap:

Familyfixed cap (px)px/token
Qwen3.7/3.6/3.5-Omni/3.5 / Qwen3-VL / qwen3.7-max-vision / OCR snapshots on the Qwen3-VL arch16777216 (16384×32×32)32×32
older 28×28 OCR snapshots (qwen-vl-ocr-2025-08-28 / -2025-04-13 / -2024-10-28)12845056 (16384×28×28)28×28

total_pixels — VIDEO file / image-list (default = max, per token math at 32×32):

Familydefault = maxtokens
Qwen3.7 / Qwen3.6 / Qwen3.5 series819200000800,000 image tokens
Qwen3.5-Omni184549376180,224 image tokens
close-source Qwen3-VL (qwen3-vl-235b-a22b-thinking / -instruct), qwen3.7-max-vision134217728131,072 image tokens
other open-source Qwen3-VL (8b / 30b-a3b / 32b)6710886465,536 image tokens

Image-token formula: tokens = h_bar*w_bar / token_pixels + 2 (h_bar, w_bar = scaled dims, multiples of 32 or 28).


4. OCR — ocr_options (native DashScope SDK/HTTP only; qwen-vl-ocr*)

Section titled “4. OCR — ocr_options (native DashScope SDK/HTTP only; qwen-vl-ocr*)”
"ocr_options": {
"task": "key_information_extraction",
"task_config": {
"result_schema": {
"Ride Date": "ride date, format YYYY-MM-DD",
"Invoice Code": "invoice code",
"Invoice Number": "invoice number"
}
}
}
task valuePurposeBuilt-in prompt (auto-injected)Output format
advanced_recognitionHi-precision recognition + text-line localization”Locate all text lines and return the coordinates of the rotated rectangle ([cx, cy, width, height, angle]).”Plain text OR JSON in ocr_result.words_info[] with text, location ([x1,y1..x4,y4], 4 vertices TL→TR→BR→BL, origin top-left), rotate_rect ([center_x, center_y, width, height, angle], angle ∈ [-90, 90]). Requires versions later than qwen-vl-ocr-2025-08-28 or latest.
key_information_extractionKIE from receipts/forms/certs”Assume you are an information extraction expert. You are given a JSON schema. Fill the value part of this schema with information from the image…”JSON object in ocr_result.kv_result. With task_config.result_schema (key→hint, up to 3 nested layers) → custom fields; without schema → all detected fields.
table_parsingTable parsing”…converting tables from a synthetic image into HTML. Transcribe each table using <tr> and <td> tags…merged cells accurately represented…”Text in HTML (<tr>/<td>, merged cells).
document_parsingDocument/scan/PDF-as-image parsing”…transcribe the text, tables, and equations…into LaTeX format without modification…”Text in LaTeX.
formula_recognitionFormula recognition”Extract and output the LaTeX representation of the formula from the image, without any additional text or descriptions.”Text in LaTeX.
text_recognitionGeneral text (zh/en)“Please output only the text content from the image without any additional descriptions or formatting.”Plain text.
multi_lanMultilingual text (ar, fr, de, it, ja, ko, pt, ru, es, vi)“Please output only the text content from the image without any additional descriptions or formatting.”Plain text.

task_config properties: result_schema (object) — JSON field template (key → description/hint) for KIE custom-field extraction; supports up to 3 nested layers; omit to extract all fields.

In the OpenAI-compatible SDK these built-in tasks are NOT available as a parameter — hand-write the task’s fixed prompt into text. Default prompt when text is empty: "Please output only the text content from the image without any additional descriptions or formatting."

enable_rotate (boolean, default false) — auto image-rotation correction; passed inside the image content-item (NOT inside ocr_options); native DashScope SDK/HTTP only.

OCR snapshots (verified on the OCR page): qwen-vl-ocr, qwen-vl-ocr-latest, qwen-vl-ocr-2025-11-20 (Qwen3-VL architecture, 32×32 px/token), qwen-vl-ocr-2025-08-28, qwen-vl-ocr-2025-04-13, qwen-vl-ocr-2024-10-28. OCR max_tokens: qwen-vl-ocr / -2025-04-13 / -2025-08-28 default 4096, raisable to 4097–8192 only via commercial manager.


5. Response — shape (chat.completion, non-streaming, OpenAI mode)

Section titled “5. Response — shape (chat.completion, non-streaming, OpenAI mode)”
{
"id": "chatcmpl-6ada9ed2-...",
"object": "chat.completion",
"created": 1735120033,
"model": "qwen3-vl-plus",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "These images show a person and a dog on a beach...",
"reasoning_content": null,
"tool_calls": null,
"refusal": null
},
"finish_reason": "stop",
"logprobs": null
}
],
"usage": {
"prompt_tokens": 1277,
"completion_tokens": 81,
"total_tokens": 1358,
"prompt_tokens_details": { "image_tokens": 2497, "text_tokens": 209, "cached_tokens": 2048 },
"completion_tokens_details": { "text_tokens": 81 }
},
"system_fingerprint": null,
"service_tier": null
}
response fieldtypedescription
idstringUnique request identifier.
objectstringAlways chat.completion.
createdintegerUnix timestamp (s).
modelstringModel used.
choices[]arrayOutput candidates (1..n).
choices[].indexintegerIndex in choices.
choices[].finish_reasonstringstop (natural / stop word) / length (max_tokens hit) / tool_calls (tool invoked).
choices[].logprobsobject|nullcontent[] with token, bytes, logprob, top_logprobs[].
choices[].message.rolestringAlways assistant.
choices[].message.contentstringAnswer text.
choices[].message.reasoning_contentstring|nullChain of thought (thinking mode).
choices[].message.tool_calls[]array{id, type:"function", function:{name, arguments(JSON string)}, index}.
choices[].message.refusal / audio / function_callnull (function_call deprecated).
usage.prompt_tokens / completion_tokens / total_tokensintegerToken accounting.
usage.prompt_tokens_details.image_tokens / text_tokens / cached_tokensintegerInput breakdown (image tokens, cached tokens).
usage.completion_tokens_details.text_tokensintegerOutput breakdown.
system_fingerprint / service_tierstring|nullCurrently null.
{
"output": {
"choices": [
{ "finish_reason": "stop",
"message": { "role": "assistant",
"content": [ { "text": "..." } ] } }
]
},
"usage": { "output_tokens": 81, "input_tokens": 1277, "image_tokens": 2497,
"input_tokens_details": { "text_tokens": 33, "image_tokens": 1377 },
"output_tokens_details": { "text_tokens": 38 }, "total_tokens": 1358 },
"request_id": "ccf845a3-..."
}

OCR advanced_recognition: inside output.choices[0].message.content[0], alongside text, there is ocr_result.words_info[] (see §4). KIE returns ocr_result.kv_result.


6. Minimal example (OpenAI-compatible, single image)

Section titled “6. Minimal example (OpenAI-compatible, single image)”
from openai import OpenAI
import os
client = OpenAI(
api_key=os.getenv("DASHSCOPE_API_KEY"),
base_url="https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
)
completion = client.chat.completions.create(
model="qwen3-vl-plus",
messages=[{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "https://.../img.jpg"}},
{"type": "text", "text": "What is in this image?"},
]}],
)
print(completion.choices[0].message.content)
Terminal window
curl -X POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" -H 'Content-Type: application/json' \
-d '{"model":"qwen3-vl-plus","messages":[{"role":"user","content":[
{"type":"image_url","image_url":{"url":"https://.../img.jpg"}},
{"type":"text","text":"What is in this image?"}]}]}'

7. Full example (hi-res + thinking + video + per-image pixel limits + total_pixels, streaming)

Section titled “7. Full example (hi-res + thinking + video + per-image pixel limits + total_pixels, streaming)”
completion = client.chat.completions.create(
model="qwen3-vl-235b-a22b-thinking",
messages=[{"role": "user", "content": [
{"type": "image_url",
"image_url": {"url": "https://.../doc.jpg"},
"min_pixels": 65536,
"max_pixels": 16384 * 32 * 32},
{"type": "video_url",
"video_url": {"url": "https://.../clip.mp4"},
"fps": 2,
"min_pixels": 65536,
"max_pixels": 2621440,
"total_pixels": 134217728},
{"type": "text", "text": "Solve the problem in the image and summarize the video."},
]}],
stream=True,
temperature=0.7,
top_p=0.8, # NOTE: official guidance — set only temperature OR top_p
seed=1234,
max_completion_tokens=4096,
stream_options={"include_usage": True},
extra_body={
"vl_high_resolution_images": True, # max_pixels ignored
"enable_thinking": True, # -thinking models always reason regardless
"thinking_budget": 81920,
"top_k": 20,
"repetition_penalty": 1.05,
},
)
for chunk in completion:
if not chunk.choices:
print(chunk.usage)
else:
d = chunk.choices[0].delta
if getattr(d, "reasoning_content", None):
print(d.reasoning_content, end="")
elif d.content:
print(d.content, end="")

8. Full example (OCR built-in KIE task with custom schema, native DashScope)

Section titled “8. Full example (OCR built-in KIE task with custom schema, native DashScope)”
import os, dashscope
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
messages = [{"role": "user", "content": [{
"image": "http://.../receipt.jpg",
"min_pixels": 32 * 32 * 3, # 3072
"max_pixels": 32 * 32 * 8192, # 8388608
"enable_rotate": False, # auto-rotation correction (OCR, native only)
}]}]
response = dashscope.MultiModalConversation.call(
api_key=os.getenv('DASHSCOPE_API_KEY'),
model='qwen-vl-ocr-2025-11-20',
messages=messages,
ocr_options={
"task": "key_information_extraction",
"task_config": {"result_schema": {
"Ride Date": "ride date, format YYYY-MM-DD",
"Invoice Code": "invoice code",
"Invoice Number": "invoice number"
}}
},
)
print(response["output"]["choices"][0]["message"].content[0]["text"])
Terminal window
# native HTTP (advanced_recognition with text localization)
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" --header 'Content-Type: application/json' \
--data '{"model":"qwen-vl-ocr-2025-11-20",
"input":{"messages":[{"role":"user","content":[
{"image":"https://.../book.jpg","min_pixels":3072,"max_pixels":8388608,"enable_rotate":false}]}]},
"parameters":{"ocr_options":{"task":"advanced_recognition"}}}'

9. Endpoints / Auth / input limits (vision)

Section titled “9. Endpoints / Auth / input limits (vision)”
  • OpenAI-compatible: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions (Singapore; ap-southeast-1). Beijing: https://dashscope.aliyuncs.com/compatible-mode/v1 (and https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/... for workspace-scoped).
  • Native: .../api/v1/services/aigc/multimodal-generation/generation. Auth: Authorization: Bearer $DASHSCOPE_API_KEY.
  • Image: both sides > 10 px; long/short ratio ≤ 200:1; keep ≤ 8K (7680×4320). Formats < 4K: BMP/JPEG/PNG/TIFF/WEBP/HEIC; 4K–8K: only JPEG/JPG/PNG. Size: public URL ≤ 20 MB (Qwen3.7/3.6/3.5) / ≤ 10 MB (others); local ≤ 10 MB; Base64 ≤ 10 MB (source < 7 MB pre-encode).
  • Image count: Qwen3-VL plus/flash + 235b-a22b instruct/thinking → image-list 4..2000, URL/path up to 2000; other open-source Qwen3-VL (8b / 30b-a3b / 32b) → 4..512, URL/path up to 256; Base64 up to 250.
  • Video: Qwen3-VL up to 2 GB (URL), 2 s..1 h (plus/flash/235b) / up to 20 min (open-source); Base64 < 10 MB; local ≤ 100 MB. Up to 64 videos. Audio-from-video NOT supported (Qwen-Omni only). max_frames (frame cap) — native DashScope SDK only.
  • Timeout: non-streaming aborts at 300 s, returns partial (header x-dashscope-partialresponse: true). For long outputs use stream=true.