Qwen (Alibaba Model Studio) Commands & Prompt Reference
Request parameters of the OpenAI-compatible Chat Completions API in Alibaba Cloud Model Studio (international edition), checked against the reference updated on 28 September 2026, when the recommended Qwen models were the Qwen3.8 generation (qwen3.8-max, qwen3.8-flash). The endpoint also serves hosted DeepSeek, Kimi, GLM and MiniMax models. Response objects, the DashScope native API and the Qwen Code CLI are left out. With the OpenAI Python SDK, non-OpenAI fields such as enable_thinking go inside extra_body.
All Commands
Endpoints and model IDs (7)
| Command / Syntax | What it does | Notes |
|---|---|---|
| https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 | Singapore SDK base URL | International-region base_url for OpenAI SDKs; the workspace ID comes from the Workspace Details page in the console. |
| POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions | Chat completions HTTP endpoint | US (Virginia), Frankfurt, Tokyo and Hong Kong use the same path with their own region code in the host. |
| https://dashscope-intl.aliyuncs.com | Previous Singapore domain | Older shared domain that still works; Alibaba recommends the workspace domain for speed and stability. |
| qwen3.8-max | Qwen3.8 Max model ID | Thinks at the xhigh level by default; lower it by setting reasoning_effort to medium or low. |
| qwen3.8-flash | Qwen3.8 Flash model ID | Keeps past reasoning by default, so return earlier reasoning_content in its own field, never pasted into content. |
| qwen3.7-plus | Qwen3.7 Plus model ID | Named in the recommended list for both text generation and image and video understanding. |
| qwen3.8-omni-flash | Qwen3.8 Omni Flash model ID | For audio and video analysis through Chat Completions; live voice conversations need the separate realtime model. |
Request basics (6)
| Command / Syntax | What it does | Notes |
|---|---|---|
| model | Model to call | Required; besides the Qwen families it takes the DeepSeek, Kimi, GLM and MiniMax models hosted on Model Studio. |
| messages | Conversation history | Required array of system, user, assistant and tool messages; a system message usually comes first. |
| partial | Partial mode flag | Set on an assistant message and off by default; the partial mode guide lists which models accept it. |
| tool_call_id | Tool result link | Required on tool messages; copy the id from the matching entry of the assistant reply's tool_calls. |
| cache_control | Explicit cache marker | Goes on a user content part to switch on explicit caching; ephemeral is its only accepted type. |
| extra_body={"enable_search": True} | Non-OpenAI field via the SDK | OpenAI Python SDK form; raw HTTP calls put such fields at the top level of the body instead. |
Sampling and length (10)
| Command / Syntax | What it does | Notes |
|---|---|---|
| temperature | Sampling temperature | Accepts 0 up to but not including 2; set it or top_p, not both, and leave the QVQ defaults alone. |
| top_p | Nucleus sampling threshold | Above 0 up to 1.0; Qwen3.8-Omni-Flash defaults to 0.95 with thinking and 0.8 without. |
| top_k | Candidate token pool size | null or over 100 turns it off; most models default to 20, and DeepSeek, Kimi and MiniMax do not support it. |
| repetition_penalty | Repetition penalty | Any value above 0, with 1.0 meaning none; Python SDK calls pass it through extra_body. |
| presence_penalty | Presence penalty | Ranges from -2.0 to 2.0; raise it for brainstorming, lower it for formal text that must keep its terms. |
| seed | Random seed | Reusing a seed with otherwise identical parameters gives the same output as far as possible. |
| n | Number of replies | From 1 to 4 on Qwen3 non-thinking models; keep it at 1 when tools are passed, and expect more output tokens. |
| stop | Stop sequences | A string or an array, but a single array cannot mix text with token IDs. |
| max_completion_tokens | Output length cap | Counts reasoning plus answer and is the advised cap for thinking models; hitting it ends with finish_reason length. |
| max_tokens | Answer length cap (deprecated) | Due to be deprecated; on Qwen models it caps only the answer, while DeepSeek-V4 and glm-5.3 count reasoning too. |
Thinking (6)
| Command / Syntax | What it does | Notes |
|---|---|---|
| enable_thinking | Thinking mode switch | For hybrid models such as Qwen3.7 and Qwen3.5; the reasoning arrives in reasoning_content. |
| thinking_budget | Thinking token limit | Defaults to the model's longest allowed reasoning; kimi-k3 does not accept it, and Python SDK calls use extra_body. |
| reasoning_effort | Reasoning intensity | Levels depend on the model: DeepSeek-V4 and GLM default to high, Qwen3.8 to xhigh, and Qwen3.8 rejects it alongside thinking_budget. |
| preserve_thinking | Keep earlier reasoning | Feeds reasoning from past assistant turns back as input; on by default for qwen3.8-max and qwen3.8-flash. |
| thinking | MiniMax thinking switch | Only for MiniMax-M3; type adaptive lets the model decide, while disabled makes it answer straight away. |
| clear_thinking | Drop earlier reasoning | GLM models only; true sends past turns without their reasoning, which shortens context and lowers cost. |
Output format and streaming (9)
| Command / Syntax | What it does | Notes |
|---|---|---|
| stream | Streaming output | Off by default; streaming is advised for long answers, since non-streaming calls time out after at least 300 seconds. |
| stream_options | Streaming settings | Read only when stream is true; its include_usage field controls token reporting. |
| include_usage | Token usage in the stream | Adds token counts to the final chunk, which is the only chunk that can carry them. |
| response_format | Response format | json_object needs the word JSON in the prompt or the call errors; json_schema needs no such hint. |
| json_schema | Structured output schema | Carries name, schema and an optional strict flag; SDK parse methods can build it from Pydantic or Zod. |
| logprobs | Token log probabilities | Off by default; tokens from the thinking phase never come with log probabilities. |
| top_logprobs | Alternatives per token | Between 0 and 5 candidates per step, and ignored unless logprobs is true. |
| modalities | Output modalities | Qwen-Omni only; ["text","audio"] adds speech, but qwen3.8-omni-flash answers in text only. |
| audio | Output voice and format | Needs modalities set to text plus audio; voice picks the speaker, and wav is the only format. |
Tools and web search (10)
| Command / Syntax | What it does | Notes |
|---|---|---|
| tools | Callable tool definitions | Each entry is a function with a name, a description and JSON Schema parameters; chosen calls return in tool_calls. |
| tool_choice | Tool selection strategy | auto by default and none turns tools off; Qwen models do not support required, and thinking models cannot be forced. |
| parallel_tool_calls | Parallel tool calls | |
| tool_stream | Stream tool arguments | Needs stream=true; sends array or object arguments in pieces instead of all at once, on Qwen and GLM models. |
| enable_code_interpreter | Code interpreter switch | Off by default; it is not an OpenAI field, so SDK calls set it through extra_body. |
| enable_search | Web search switch | Can raise token use; when the model still skips searching, set forced_search inside search_options. |
| search_options | Web search settings | Holds forced_search, search_strategy and enable_search_extension; Python SDK calls send it in extra_body. |
| forced_search | Force a web search | Inside search_options; true makes the search run instead of leaving the choice to the model. |
| search_strategy | Search depth | turbo is the default; max queries more engines, agent searches in several rounds and agent_max adds web scraping. |
| enable_search_extension | Vertical search switch | Inside search_options, off by default, and read only when enable_search is true. |
Image, video and audio input (5)
| Command / Syntax | What it does | Notes |
|---|---|---|
| vl_high_resolution_images | High-resolution image mode | Raises the per-image limit to the pixel count of 16384 tokens and ignores max_pixels; Python SDK calls use extra_body. |
| max_pixels | Image pixel ceiling | Larger images or frames are scaled down to it; current Qwen models ignore it in high-resolution mode. |
| min_pixels | Image pixel floor | Smaller images or frames are enlarged; Qwen3.8 and Qwen3-VL default to 65536 for images. |
| fps | Video frame rate | From 0.1 to 10, default 2; higher values suit fast motion, lower ones long or static videos. |
| use_multichannel | Spatial audio parsing | qwen3.8-omni-flash only; with two- or four-channel input the model reads spatial cues instead of mixing to mono. |
Recipes
Our combinations of Model Studio request fields for Qwen3.8 work, from repeatable sampling to high-resolution images; every name in their code lines is listed in the tables.
Make runs as repeatable as possible
seed → temperature
A fixed seed with every other parameter unchanged returns the same result only as far as possible, so treat it as best effort. A lower temperature narrows what variation remains; leave top_p at its default meanwhile, since the reference advises setting just one of the two.
Cap the thinking on Qwen3.8
qwen3.8-max → reasoning_effort
Qwen3.8 models think at the xhigh level unless told otherwise. Set reasoning_effort to medium or low, or give a thinking_budget instead, never both: a request that sets the two fails. Each level stands for a fixed budget (low 4096, medium 16384, xhigh 262144 tokens).
Keep multi-turn reasoning intact
preserve_thinking → messages
On qwen3.8-max and qwen3.8-flash earlier reasoning is fed back by default. Return each past assistant turn with its reasoning_content in that field rather than folded into content, which the reference warns can degrade answers; resent reasoning is counted and billed as input.
Force grounded answers
enable_search → search_options → forced_search
enable_search alone lets the model decide whether to search; forced_search inside search_options makes it search. search_strategy sets the depth (turbo by default, max for more sources). With the Python SDK, search_options goes in extra_body.
Read dense images
vl_high_resolution_images
Off by default. Switched on, the per-image limit rises to the pixel count of 16384 tokens and max_pixels is ignored; switched off, max_pixels decides how far a large image is scaled down.
Frequently Asked Questions
Can I call non-Qwen models through this endpoint?
Yes. The model field also accepts the DeepSeek, Kimi, GLM and MiniMax models hosted on Model Studio, and some parameters behave differently for them: top_k is not supported on DeepSeek, Kimi and MiniMax, thinking applies only to MiniMax-M3 and clear_thinking only to GLM. Model names and billing are listed in the Model Studio console.
Where do non-OpenAI parameters go when I use the OpenAI Python SDK?
Into extra_body, for example extra_body={"enable_search": True}. The same holds for enable_thinking, thinking_budget, top_k, repetition_penalty, search_options and the other fields the reference marks as non-standard. When calling the HTTP endpoint directly, put them at the top level of the JSON body next to model and messages.
How do enable_thinking, thinking_budget and reasoning_effort differ?
enable_thinking switches thinking on or off on hybrid models, and the reasoning comes back in reasoning_content. thinking_budget caps the reasoning tokens, while reasoning_effort picks a level whose values depend on the model (low, medium or xhigh on Qwen3.8; high or max on DeepSeek-V4 and GLM). On Qwen3.8 set the budget or the level, not both.
Sources and checks
- Alibaba Cloud Model Studio — OpenAI compatible - Chat (API reference, international edition, last updated 2026-09-28) Endpoints, request body parameters and their model support
- Alibaba Cloud Model Studio — Recommended models (last updated 2026-09-28) Current Qwen model IDs
Every row on this page was matched to a line in the documentation above on . A command or parameter that could not be found there is not listed.
AI tools change their commands, parameters and model names between releases: the vendor's current documentation and the version you run have the last word. Found a wrong or missing entry? Tell us and it gets checked against the source. How we verify describes the process and its limits.
Related prompt references
DeepSeek (46) · GLM (Z.ai) (58) · Kimi (Moonshot AI) (40) · All AI prompt references