Qwen (Alibaba Model Studio) Commands & Prompt Reference

29 commands & parameters · 2 categories · Source: Alibaba Cloud Model Studio - OpenAI compatible Chat

Alibaba Cloud Model Studio exposes Qwen through an OpenAI-compatible chat completions endpoint, so the familiar sampling fields all work - but the interesting parameters are the ones that are not standard. enable_thinking and thinking_budget control the reasoning phase on mixed-thinking models, enable_search turns on web search, and search_options carries the search strategy (via the Python SDK it goes inside extra_body rather than at the top level).

The endpoint is also a gateway rather than a single-vendor API: the model field accepts DeepSeek, Kimi, GLM, and MiniMax model names alongside the Qwen families (LLM, VL, Coder, Omni, Math). Several parameters are family-gated as a result - modalities and audio apply only to Qwen-Omni, vl_high_resolution_images only to vision models, and n only to Qwen3 in non-thinking mode.

All Commands

Chat API Parameters (16)

Command / SyntaxWhat it doesNotes
modelModel to callSupported families: Qwen LLM (commercial and open source), Qwen-VL, Qwen-Coder, Qwen-Omni, Qwen-Math, plus DeepSeek, Kimi, GLM and MiniMax. Required.
messagesConversation context passed to the model, in conversational orderRequired. System message, if present, must come first.
temperatureSampling temperature controlling output diversityValue range [0, 2). Set either temperature or top_p, not both.
top_pNucleus sampling probability thresholdValue range (0, 1.0]. Set either temperature or top_p, not both.
top_kNumber of candidate tokens sampled during generationLarger is more random. null or a value above 100 disables the top_k strategy.
repetition_penaltyPenalty for consecutive repeated sequences1.0 means no penalty; raise it to reduce repetition. No strict upper bound.
presence_penaltyControls content repetition across the generated textValue range [-2.0, 2.0]. Positive reduces repetition, negative increases it.
max_completion_tokensMaximum output length, including chain-of-thought and answerGeneration stops early with finish_reason length if exceeded.
enable_thinkingSwitch thinking mode on for mixed-thinking modelsApplies to Qwen3 family, Qwen3-Omni-Flash and Qwen3-VL models.
thinking_budgetMaximum tokens allowed for the thinking processApplies to Qwen3 family, GLM and Kimi models; kimi-k3 does not support it.
reasoning_effortInference intensity levelValid values vary by model; DeepSeek-V4 and GLM default to high, with max available.
seedRandom seed for reproducible resultsSame seed and unchanged parameters return the same result as far as possible.
toolsArray of tool objects the model may call in function callingIf set and the model decides to call a tool, tool info is returned in the response.
stream_optionsConfiguration for streaming outputTakes effect only when stream is true; include_usage adds token usage to the last chunk.
audioVoice and format of the output audioQwen-Omni models only, and requires modalities set to ["text","audio"].
search_optionsWeb search strategyNot a standard OpenAI parameter; via the Python SDK place it in extra_body.

Output, Tool & Feature Parameters (13)

Command / SyntaxWhat it doesNotes
streamReply in streaming output modeDefault false. When true the model outputs content as it is generated, in data chunks.
stopStop words or token IDs that halt generation immediatelyA string or array; you cannot mix strings and token IDs in one array.
nNumber of responses to generateDefault 1, range 1-4. Only supported by Qwen3 models in non-thinking mode.
max_tokensMaximum output tokens (to be deprecated)Use max_completion_tokens for new integrations; the meaning varies by model.
response_formatFormat of the responseDefault {"type": "text"}. Use {"type": "json_object"} for structured JSON output.
tool_choiceTool selection strategyDefault auto. Set it to force a specific tool or to disable all tools.
parallel_tool_callsEnable parallel tool callingDefault false.
modalitiesModality of the output dataDefault ["text"]. Qwen-Omni models only; ["text","audio"] adds audio output.
enable_searchEnable web searchDefault false. If search does not trigger, set forced_search inside search_options.
logprobsReturn log probabilities of the output tokensDefault false.
top_logprobsNumber of most likely candidate tokens returned per stepRange [0, 5]. Takes effect only when logprobs is true.
vl_high_resolution_imagesRaise the input image pixel limit to the 16384-token equivalentDefault false. Qwen-VL high-resolution image processing.
enable_code_interpreterEnable the code interpreter featureDefault false.

Recipes

Our own notes on combining the parameters and commands above. Every token used here appears in the reference tables on this page.

Make runs as repeatable as possible

seed + temperature

A fixed seed with unchanged parameters returns the same result as far as possible, per the documentation's own wording. Lowering temperature narrows the remaining variance.

Budget the thinking, not just the answer

enable_thinking + thinking_budget

enable_thinking turns reasoning on and thinking_budget caps how much of it the model may spend. The budget applies to the Qwen3 family and hosted GLM and Kimi models - but not kimi-k3.

Force grounded answers

enable_search + search_options

enable_search defaults to false; search_options sets the strategy, and forced_search inside it makes retrieval happen when the model would otherwise skip it. Not a standard OpenAI parameter - the Python SDK takes it via extra_body.

Read dense screenshots and documents

vl_high_resolution_images

Off by default. Raising the pixel limit lets Qwen-VL keep small text legible in high-resolution inputs, at the cost of a larger token bill for each image.

Frequently Asked Questions

Can I call non-Qwen models through this endpoint?

Yes. The model field accepts DeepSeek, Kimi, GLM, and MiniMax model names as well as the Qwen families. Billing and available parameters vary by model.

How do I control the thinking phase?

enable_thinking switches thinking mode on for mixed-thinking models, and thinking_budget caps the tokens spent on it. reasoning_effort sets intensity where the model supports it.

Why is search_options rejected at the top level in Python?

It is not a standard OpenAI parameter. With the Python SDK, place it inside extra_body: extra_body={"search_options": ...}.

Every entry on this page is a literal, typeable token taken from the official documentation linked above. Command sets in AI tools change quickly - the in-product command menu is always authoritative for your installed version.

Related prompt references

DeepSeek (22) · GLM (Z.ai) (23) · Kimi (Moonshot AI) (22) · All AI prompt references