Qwen's flagship multimodal model for text generation, reasoning, and visual understanding.
qwen4-maxText generation, streaming, reasoning, and fixed-prefix caching.
Required parameters: model, messages
Available parameters: model, messages, enable_thinking, max_tokens
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | 填写 qwen4-max。 Options: qwen4-max |
messages | array | Yes | 按顺序传入对话。 |
enable_thinking | boolean | No | 设为 false 关闭思考。 |
thinking_budget | integer | No | 可选思考预算。与 max_tokens 同时提供时应小于 max_tokens。 |
max_tokens | integer | No | 总输出上限,包含思考和正文。 |
stream | boolean | No | 设为 true 使用 SSE。 |
stream_options | object | No | 流式用量选项。 |
prompt_cache_options | object | No | 可选的缓存设置。 |
curl --request POST https://api.router.ai/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
--data '{"model": "qwen4-max", "messages": [{"role": "user", "content": "Suggest a name for a fictional lighthouse."}], "enable_thinking": false, "max_tokens": 64}'Endpoint reference: Create a chat completion (OpenAI-compatible)