Qwen4-Max returns a displayable thinking summary and the encrypted full thinking content to restore reasoning history in multi-turn conversations.
Supported model:
Full thinking is returned by default. When enabled, raw thinking is no longer returned in plaintext: the model returns a summary for display and the encrypted full thinking for restoring reasoning history.
Summaries and ciphertext are enabled together. Ciphertext may be absent if no reasoning is generated or encryption fails. Summaries may be missing or incomplete; raw reasoning remains unavailable.
Enable this feature in every request and replay historical ciphertext unchanged to restore the corresponding reasoning.
Text and multimodal input use the same parameters. Encryption stores only thinking, so retain historical images, videos, and other inputs. Store each encrypted thinking segment with its assistant message, including tool-call turns.
Enable
Chat Completions streams summary deltas in
This Chat Completions example handles one reply without tool calls. Process all three fields on every chunk and save one assistant message at the end. Retain standalone ciphertext frames even when no text is present; ciphertext is a complete value, not a text delta to concatenate.
Retain complete ciphertext when replaying history. Summaries can be omitted; the Responses
This feature has no additional charge. The model’s existing input and output token billing rules apply.
qwen4-max.
How it works
Full thinking is returned by default. When enabled, raw thinking is no longer returned in plaintext: the model returns a summary for display and the encrypted full thinking for restoring reasoning history.
Summaries and ciphertext are enabled together. Ciphertext may be absent if no reasoning is generated or encryption fails. Summaries may be missing or incomplete; raw reasoning remains unavailable.
Enable this feature in every request and replay historical ciphertext unchanged to restore the corresponding reasoning.
Text and multimodal input use the same parameters. Encryption stores only thinking, so retain historical images, videos, and other inputs. Store each encrypted thinking segment with its assistant message, including tool-call turns.
Enable enable_thinking=true for Chat Completions and DashScope, and use preserve_thinking=true to continue with encrypted history. Responses and Anthropic Messages use their own thinking parameters.
Enable the feature
| API | Enabling parameter | Summary field | Encrypted field |
|---|---|---|---|
| Chat Completions | thinking_display="summarized" | choices[i].message.reasoning_content | choices[i].message.encrypted_content |
| Responses | reasoning.summary="auto" | summary[].text | encrypted_content |
| Anthropic Messages | thinking.display="summarized" | thinking | signature |
| DashScope | parameters.thinking_display="summarized" | output.choices[i].message.reasoning_content | output.choices[i].message.encrypted_content |
- Chat Completions
- Responses
- Anthropic Messages
- DashScope
curl
Responses and streaming
Chat Completions streams summary deltas in choices[i].delta.reasoning_content, then a separate complete encrypted_content frame, then text or tool calls, and then completion. Non-streaming fields are in choices[i].message. Do not discard an encrypted frame because its text is empty or create a separate assistant message for it.
A Responses reasoning item contains summary (with summary_text elements) and encrypted_content. Summary text arrives incrementally; encrypted content arrives in the reasoning item completion event and final response. Use the completed snapshot to recover encrypted content without appending the summary twice.
An Anthropic Messages thinking block contains a thinking summary and an encrypted signature. Streaming emits thinking_delta first, then a complete signature_delta; text or tool calls follow after the thinking block closes. The signature may be empty if encryption fails or no thinking is generated.
DashScope fields are in output.choices[i].message and follow the Chat Completions streaming order. Put ciphertext in encrypted_content, not content[].text. Intermediate finish_reason is the string "null", and the final value is "stop". Streaming usage is cumulative; do not add it repeatedly.
Store streamed summaries, ciphertext, and answers
This Chat Completions example handles one reply without tool calls. Process all three fields on every chunk and save one assistant message at the end. Retain standalone ciphertext frames even when no text is present; ciphertext is a complete value, not a text delta to concatenate.
Python
Multi-turn conversations
If a turn returns no ciphertext, its summary cannot restore the full reasoning history. Retain the original input and answer, and check whether the turn generated reasoning and successfully enabled summaries. Do not fabricate ciphertext from a summary.
summary array can be empty.
- Chat Completions
- Responses
- Anthropic Messages
- DashScope
Pass the non-standard OpenAI Python SDK parameters
enable_thinking, thinking_display, and preserve_thinking through extra_body.Python