Understand Qwen parameter differences and usage across compatible protocols.
For Qwen models, adjust your chosen protocol's parameters using this page. See Chat Completions, Responses and Messages for full request and response structures.
Thinking is enabled by default; effective levels: low/medium/xhigh; default: xhigh. minimal maps to low, high/max to xhigh, and none disables thinking
thinking_budget
Cannot be set together with reasoning_effort; doing so returns an error. When effort alone is set, low/medium/xhigh correspond to thinking budgets 4096/16384/262144, respectively
max_tokens, max_completion_tokens
max_tokens limits only the final answer and is marked for upcoming deprecation. For new integrations, use max_completion_tokens to budget thinking and the answer together
temperature
Range: [0,2); thinking-mode defaults: 1.0 for text, 0.6 for visual input; values below 0.6 become 0.6. Non-thinking default: 0.7
top_p, top_k
top_p range: (0,1]; thinking / non-thinking defaults: 0.95/0.8. Extension top_k is a nonnegative integer, default 20; null or values above 100 disable Top-K
repetition_penalty
Qwen extension; must exceed 0; default: 1.0; distinct from OpenAI's two penalty fields
preserve_thinking
Enabled by default; replay assistant thinking unchanged in its original reasoning_content field, not in content. Missing thinking does not itself cause an error
tool_choice
Supports auto/none; thinking mode disallows required or a named function. Non-thinking mode allows a named function, but required still does not guarantee a tool call
tool_stream
Default: false; controls incremental complex tool arguments only with stream=true. Max models support text scenarios only; Flash supports all modalities
response_format
Supports json_object/json_schema; the former requires a JSON keyword in the prompt; the latter defines structure through response_format.json_schema. Thinking need not be disabled
enable_search, search_options
enable_search defaults to false; search_options.forced_search can force search. These models use strategies turbo/max. With include_tool_usage=true, actual search-call statistics appear in usage.x_tools
Supports none/low/medium/xhigh; default: xhigh; minimal maps to low, and high/max to xhigh
enable_thinking
Compatibility switch scheduled for removal; the vendor recommends reasoning.effort. If both are supplied, reasoning.effort takes precedence
max_output_tokens
Minimum: 16; includes thinking and the final answer
text.format
Supports text/json_object/json_schema; JSON Schema settings go inside text.format.json_schema, containing name/schema/strict, unlike the original protocol's flat structure
tool_choice
Supports auto/none/required and an allowed_tools object; required is available only with exactly one tool in the list
tools
Alongside functions, supports built-ins such as web_search, web_extractor and code_interpreter. Web extraction requires search; the code interpreter requires thinking
store, previous_response_id, conversation
Supports server-side history; store defaults to true, and response IDs last 7 days. The latter two fields are mutually exclusive
background and other extension parameters
Background asynchronous execution is unsupported; OpenAI parameters not listed in the vendor's Responses Reference are ignored
Supports enabled/disabled, with thinking enabled by default; do not apply Claude's adaptive configuration
output_config.effort
Uses low/medium/xhigh, defaulting to xhigh; high/max maps to xhigh. Do not reuse all Chat compatibility mappings
thinking.budget_tokens
Marked for upcoming deprecation; use output_config.effort for new integrations. With the old budget configuration, max_tokens must exceed that budget
max_tokens
Required; on Qwen3.8, limits thinking and the final answer together
temperature, messages[].role
Temperature range: [0,2); roles also allow system in addition to user/assistant
tool_result.content
Return tool results as strings; serialize objects or arrays first rather than using Claude's content-block arrays
output_config.format
Supports strict JSON Schema; use type: "json_schema", put the Schema in schema, and set additionalProperties to false
web_search in tools
Search tool name: web_search; use a dated type such as web_search_20250305. HTTP / SDK calls must also add client identifier x-anthropic-billing-header: cc_entrypoint=cli; to system
Enabled automatically; matching prefixes need at least 1024 Token to qualify, without guaranteeing a hit
Chat / Messages explicit caching
Mark content blocks with cache_control: { type: "ephemeral" }; minimum: 1024 Token; valid for 5 minutes, refreshed on a hit; at most 4 markers
Explicit cache locations
System prompts must use content-block arrays. Tool definitions contribute to the prefix, but markers placed on tool definitions alone are ignored. Do not reuse other TTLs or cache-breakpoint fields from the general Reference
Responses Session cache
Enable through Header x-dashscope-session-cache: enable; default: disable. Disabling Session caching does not disable automatic implicit caching
Cache usage
Chat: inspect usage.prompt_tokens_details.cached_tokens; Responses: usage.input_tokens_details.cached_tokens; Messages: usage.cache_read_input_tokens and usage.cache_creation_input_tokens
Chat: image_url.url supports public URLs or Base64 Data URLs
Video
video_url
Chat extension: video_url.url supports public URLs or Base64 Data URLs; fps belongs on the content block alongside video_url
Frame list
video
Chat extension: pass chronological images in a video array; at least 4 frames
Image
input_image
Responses: image_url is a public URL or complete Base64 Data URL string, not Chat's nested object
PDF
input_file
The vendor explicitly lists qwen3.8-max and qwen3.8-flash for Responses. Use file_url for a public PDF up to 100 MB; do not apply OCR-specific parameters to these models
Image
image
Messages: provide url for source.type=url; provide media_type and raw Base64 data for base64
Video
video
Messages extension: source contains a public URL, or media_type and raw Base64 data; this is not a native Claude content block
Field
Difference
Chat image controls
Content-block min_pixels/max_pixels adjust image pixels; with top-level vl_high_resolution_images=true, max_pixels no longer applies
Image size
Public images: at most 20 MB. Images before Base64 encoding: at most 20 MB. Encoded Data URLs: at most 20 MB in Chat or 32 MB in Messages
Video limits
Public videos: at most 2 GB; Base64 strings: less than 10 MB. Only visuals are processed, not the video's audio
Protocol scope
These models do not use Omni audio endpoints; Responses input_audio/input_video are currently Omni-only. Do not move Chat / Messages video blocks into Responses