QwenChat Completions

Qwen4 Max API

Qwen's flagship for coding, multimodal understanding, and long-context reasoning.

On this page

Qwen4 Max API pricing

73% less than Qwen’s API for 1,000 input and 500 output tokens, before caching.

USD per 1 million tokens
Token typeRouterHubQwenOfficial API
Input$0.40$1.50
Output$1.20$4.50
Cached input$0.02$0.075
Cache write$0.50$1.875

Qwen pricing source · Checked 2026-11-19 · QwenCloud Singapore retail; 5-minute cache-write tier

Compatible with the tools you already use

One key, one base URL. OpenAI and Anthropic compatible.

Qwen4 Max uses Chat Completions. See the tools that support this model.

Start for free

Plus up to $5 bonus credit on your first top-up.

Context window and API compatibility

Qwen4 Max uses the OpenAI-compatible Chat Completions API over POST /v1/chat/completions and has a context window of 1,000,000 tokens. Use model ID qwen4-max in requests.

Exact model ID
qwen4-max
Provider
Qwen
Variant
Standard
Supported API
OpenAI-compatible Chat Completions API (/v1/chat/completions)
Availability
Preview
Context window
1,000,000 tokens
Maximum input
Not published
Maximum output
131,072 tokens
Input types
text and images
Coding tools
OpenCode, VS Code + Continue, VS Code + Cline, Hermes Agent

Make your first API request

Set ROUTERHUB_API_KEY locally, then send a request with the exact model ID below.

cURL
curl --connect-timeout 30 --max-time 600 https://routerhub.si/v1/chat/completions \
  -H "Authorization: Bearer $ROUTERHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen4-max","messages":[{"role":"user","content":"Write a short noir scene set in a lighthouse."}],"max_tokens":256}'

Python: install openai with pip. This example requests 256 output tokens and disables automatic retries. Check Usage before resending a paid request.

Python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["ROUTERHUB_API_KEY"],
    base_url="https://routerhub.si/v1",
    timeout=600.0,
    max_retries=0,
)
response = client.chat.completions.create(
    model="qwen4-max",
    messages=[{"role": "user", "content": "Write a short noir scene set in a lighthouse."}],
    max_tokens=256,
)
print(response.choices[0].message.content)

Common questions

What is Qwen4 Max?

Qwen4 Max is a Qwen language model served through RouterHub using the OpenAI-compatible Chat Completions API. Its exact API model ID is qwen4-max.

How much does Qwen4 Max cost?

RouterHub charges $0.40 input, $0.02 cached input and $1.20 output per million tokens (prices as of 2026-11-22). A typical chat message of about 1,000 input and 500 output tokens costs about 0.10¢. Usage is billed against your prepaid balance.

What is the Qwen4 Max context window?

Context window: 1,000,000 tokens. Maximum input: Not published. Maximum output: 131,072 tokens.

Which API does Qwen4 Max support?

Use the OpenAI-compatible Chat Completions API at https://routerhub.si/v1/chat/completions with the exact model ID qwen4-max and your RouterHub API key (Authorization: Bearer header).

Which coding tools work with Qwen4 Max?

OpenCode, VS Code + Continue, VS Code + Cline, Hermes Agent. These tools support this model’s Chat Completions endpoint with the configurations in their setup guides.

Can I try Qwen4 Max for free?

Qwen4 Max needs a free RouterHub account with prepaid credits. New accounts get $5 free on their first top-up of $20 or more.

Related models and guides