Skip to content

Qwen4-Max

Qwen4-Max is the first model of the Qwen4 series, built for coding, long-horizon agent tasks, analysis of long documents, and image and video understanding. It takes text, image and video input and produces text.

Model Context Input / Output ($/1M) Cached input ($/1M)
qwen/qwen4-max 1,000,000 1.50 / 4.50 0.075

The price does not depend on prompt length; one rate applies across the whole 1M context.

Terminal window
curl "$LLMTR_BASE_URL/v1/chat/completions" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen4-max",
"messages": [
{ "role": "user", "content": "Find the race condition in this function." }
],
"max_tokens": 8192
}'

By default the model reasons before answering and returns that chain separately in reasoning_content. content carries the final answer. Reasoning tokens are output and are counted inside completion_tokens.

max_tokens bounds reasoning and answer together. If it is too low the budget runs out during reasoning; treat a response with finish_reason: "length" as incomplete and raise max_tokens. If you send thinking_budget, it must be lower than max_tokens; otherwise the request is rejected with a 400.

To turn reasoning off, send "reasoning": false or add :fast to the model id:

Terminal window
curl "$LLMTR_BASE_URL/v1/chat/completions" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen4-max:fast",
"messages": [
{ "role": "user", "content": "What is 17 x 23? Reply with the number only." }
]
}'

reasoning_effort is not supported on this model and is rejected with a 400. For models with levelled control, see Reasoning Effort.

Send an image as a base64 data URL in an image_url part, and a video as a reachable https address in a video_url part:

{
"model": "qwen/qwen4-max",
"messages": [
{
"role": "user",
"content": [
{ "type": "video_url", "video_url": { "url": "https://example.com/clip.mp4" } },
{ "type": "text", "text": "What happens in this video? One sentence." }
]
}
]
}

Image and video tokens are input and are counted inside prompt_tokens.

The auto and required forms of tool_choice work with reasoning on; in a streamed response the tool arguments arrive in pieces. You can feed the tool result back with a role: "tool" message and continue the conversation. See Tool Calling for details.

response_format accepts both json_object and strict json_schema:

{
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "answer",
"strict": true,
"schema": {
"type": "object",
"properties": {
"product": { "type": "integer" },
"verified": { "type": "boolean" }
},
"required": ["product", "verified"],
"additionalProperties": false
}
}
}
}

When you send web_search_options or "enable_search": true, the model searches the web when it needs to; it does not search on every request. To make it search, add "search_options": { "forced_search": true }. Search results become part of the prompt and are billed as input tokens.

The agent and agent_max values of search_strategy are not available on this model.

Repeated prompt prefixes can be cached automatically; no parameter is needed. The first request warms the cache and later requests can hit it. Tokens read from cache are reported in usage.prompt_tokens_details.cached_tokens and billed at $0.075 per 1M.

If you work with a long, fixed system prompt, keep that prefix byte-identical across requests.

prompt_cache_options and a request-level cache_control are not applied on this model and are removed from the request; a /v1/chat/completions response lists them in its llmtr_dropped_parameters field. The request is answered as usual.

  • Context is 1,000,000 tokens. Per the provider, the longest prompt is 991,808 tokens with reasoning off and 983,616 with it on.
  • Output. Per the provider, an answer can be at most 131,072 tokens with reasoning off, and reasoning plus answer at most 262,144. The gateway does not reject a larger max_tokens; in a long generation, finish_reason: "length" tells you the answer was cut.
  • Input types. Text, image and video. Audio input is not accepted.
qwen/qwen3.8-max qwen/qwen4-max
Input / Output ($/1M) 2.00 / 6.00 1.50 / 4.50
Cached input ($/1M) 0.25 0.075
Context 1,000,000 1,000,000
Input types Text, image, video Text, image, video
Turning reasoning off :fast or "reasoning": false :fast or "reasoning": false

To move over, change the model id to qwen/qwen4-max. qwen/qwen3.8-max stays available.

This model is of foreign origin and is hosted abroad; requests are processed outside Turkey. It is not an LLMTR model hosted in Turkey. For Turkey-hosted models see LLMTR Qwen.