Qwen (Alibaba Model Studio) Commands & Prompt Reference

53 commands & parameters · 7 categories · Sources: Alibaba Cloud Model Studio — OpenAI compatible - Chat (API reference, international edition, last updated 2026-09-28) and 1 more · Checked

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 / SyntaxWhat it doesNotes
https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1Singapore SDK base URLInternational-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/completionsChat completions HTTP endpointUS (Virginia), Frankfurt, Tokyo and Hong Kong use the same path with their own region code in the host.
https://dashscope-intl.aliyuncs.comPrevious Singapore domainOlder shared domain that still works; Alibaba recommends the workspace domain for speed and stability.
qwen3.8-maxQwen3.8 Max model IDThinks at the xhigh level by default; lower it by setting reasoning_effort to medium or low.
qwen3.8-flashQwen3.8 Flash model IDKeeps past reasoning by default, so return earlier reasoning_content in its own field, never pasted into content.
qwen3.7-plusQwen3.7 Plus model IDNamed in the recommended list for both text generation and image and video understanding.
qwen3.8-omni-flashQwen3.8 Omni Flash model IDFor audio and video analysis through Chat Completions; live voice conversations need the separate realtime model.

Request basics (6)

Command / SyntaxWhat it doesNotes
modelModel to callRequired; besides the Qwen families it takes the DeepSeek, Kimi, GLM and MiniMax models hosted on Model Studio.
messagesConversation historyRequired array of system, user, assistant and tool messages; a system message usually comes first.
partialPartial mode flagSet on an assistant message and off by default; the partial mode guide lists which models accept it.
tool_call_idTool result linkRequired on tool messages; copy the id from the matching entry of the assistant reply's tool_calls.
cache_controlExplicit cache markerGoes 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 SDKOpenAI Python SDK form; raw HTTP calls put such fields at the top level of the body instead.

Sampling and length (10)

Command / SyntaxWhat it doesNotes
temperatureSampling temperatureAccepts 0 up to but not including 2; set it or top_p, not both, and leave the QVQ defaults alone.
top_pNucleus sampling thresholdAbove 0 up to 1.0; Qwen3.8-Omni-Flash defaults to 0.95 with thinking and 0.8 without.
top_kCandidate token pool sizenull or over 100 turns it off; most models default to 20, and DeepSeek, Kimi and MiniMax do not support it.
repetition_penaltyRepetition penaltyAny value above 0, with 1.0 meaning none; Python SDK calls pass it through extra_body.
presence_penaltyPresence penaltyRanges from -2.0 to 2.0; raise it for brainstorming, lower it for formal text that must keep its terms.
seedRandom seedReusing a seed with otherwise identical parameters gives the same output as far as possible.
nNumber of repliesFrom 1 to 4 on Qwen3 non-thinking models; keep it at 1 when tools are passed, and expect more output tokens.
stopStop sequencesA string or an array, but a single array cannot mix text with token IDs.
max_completion_tokensOutput length capCounts reasoning plus answer and is the advised cap for thinking models; hitting it ends with finish_reason length.
max_tokensAnswer 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 / SyntaxWhat it doesNotes
enable_thinkingThinking mode switchFor hybrid models such as Qwen3.7 and Qwen3.5; the reasoning arrives in reasoning_content.
thinking_budgetThinking token limitDefaults to the model's longest allowed reasoning; kimi-k3 does not accept it, and Python SDK calls use extra_body.
reasoning_effortReasoning intensityLevels depend on the model: DeepSeek-V4 and GLM default to high, Qwen3.8 to xhigh, and Qwen3.8 rejects it alongside thinking_budget.
preserve_thinkingKeep earlier reasoningFeeds reasoning from past assistant turns back as input; on by default for qwen3.8-max and qwen3.8-flash.
thinkingMiniMax thinking switchOnly for MiniMax-M3; type adaptive lets the model decide, while disabled makes it answer straight away.
clear_thinkingDrop earlier reasoningGLM models only; true sends past turns without their reasoning, which shortens context and lowers cost.

Output format and streaming (9)

Command / SyntaxWhat it doesNotes
streamStreaming outputOff by default; streaming is advised for long answers, since non-streaming calls time out after at least 300 seconds.
stream_optionsStreaming settingsRead only when stream is true; its include_usage field controls token reporting.
include_usageToken usage in the streamAdds token counts to the final chunk, which is the only chunk that can carry them.
response_formatResponse formatjson_object needs the word JSON in the prompt or the call errors; json_schema needs no such hint.
json_schemaStructured output schemaCarries name, schema and an optional strict flag; SDK parse methods can build it from Pydantic or Zod.
logprobsToken log probabilitiesOff by default; tokens from the thinking phase never come with log probabilities.
top_logprobsAlternatives per tokenBetween 0 and 5 candidates per step, and ignored unless logprobs is true.
modalitiesOutput modalitiesQwen-Omni only; ["text","audio"] adds speech, but qwen3.8-omni-flash answers in text only.
audioOutput voice and formatNeeds modalities set to text plus audio; voice picks the speaker, and wav is the only format.

Tools and web search (10)

Command / SyntaxWhat it doesNotes
toolsCallable tool definitionsEach entry is a function with a name, a description and JSON Schema parameters; chosen calls return in tool_calls.
tool_choiceTool selection strategyauto by default and none turns tools off; Qwen models do not support required, and thinking models cannot be forced.
parallel_tool_callsParallel tool calls
tool_streamStream tool argumentsNeeds stream=true; sends array or object arguments in pieces instead of all at once, on Qwen and GLM models.
enable_code_interpreterCode interpreter switchOff by default; it is not an OpenAI field, so SDK calls set it through extra_body.
enable_searchWeb search switchCan raise token use; when the model still skips searching, set forced_search inside search_options.
search_optionsWeb search settingsHolds forced_search, search_strategy and enable_search_extension; Python SDK calls send it in extra_body.
forced_searchForce a web searchInside search_options; true makes the search run instead of leaving the choice to the model.
search_strategySearch depthturbo is the default; max queries more engines, agent searches in several rounds and agent_max adds web scraping.
enable_search_extensionVertical search switchInside search_options, off by default, and read only when enable_search is true.

Image, video and audio input (5)

Command / SyntaxWhat it doesNotes
vl_high_resolution_imagesHigh-resolution image modeRaises the per-image limit to the pixel count of 16384 tokens and ignores max_pixels; Python SDK calls use extra_body.
max_pixelsImage pixel ceilingLarger images or frames are scaled down to it; current Qwen models ignore it in high-resolution mode.
min_pixelsImage pixel floorSmaller images or frames are enlarged; Qwen3.8 and Qwen3-VL default to 65536 for images.
fpsVideo frame rateFrom 0.1 to 10, default 2; higher values suit fast motion, lower ones long or static videos.
use_multichannelSpatial audio parsingqwen3.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

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