# Qwen4 Max API

Canonical: https://bettertoken.ai/en/qwen4-max-api/
Prices as of: 2026-11-17

Build with Qwen’s latest flagship. One API key for your code, multimodal workflows and agents.

## Built for the whole task

### 1M context
Bring up to one million tokens into a single conversation.

### Up to 262K output
Generate up to 262K tokens in thinking mode, or 131K without thinking.

### Text, images + video
Send text and visual inputs, and get a text response.

### Tools + JSON Schema
Use parallel function calls and structured JSON outputs.

## Work out your API cost
per million tokens
Qwen4 Max: Input $1.08; Output $3.24; Cache read $0.054
Qwen3.8 Max: Input $1.44; Output $4.32; Cache read $0.18
Prices per 1M tokens. Input includes cache hits. Sources: BetterToken and Alibaba Cloud Model Studio · checked 17 Nov 2026.

[GLM 5.4 API](/en/glm-5-4-api/)

## Put Qwen4 Max to work
Copy the setup for your AI agent, or start with an SDK example.

### 1. OpenAI Chat Completions
```sh
curl https://bettertoken.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_BETTERTOKEN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen4-max",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

### 2. Anthropic Messages
```sh
curl https://bettertoken.ai/v1/messages \
  -H "x-api-key: YOUR_BETTERTOKEN_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen4-max",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

### 3. OpenAI Responses
```sh
curl https://bettertoken.ai/v1/responses \
  -H "Authorization: Bearer YOUR_BETTERTOKEN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen4-max",
    "input": "Hello!"
  }'
```

## A few things you might want to know

### How much does the Qwen4 Max API cost?
Per million tokens, BetterToken charges $1.08 for input, $3.24 for output and $0.054 for cache reads — 28% below the official Qwen4 Max API price of $1.50, $4.50 and $0.075. Thinking tokens are billed as output. Your first top-up of $5 costs $3.

### How do I get a Qwen4 Max API key?
Create a BetterToken account or sign in, create an API key in Workspace, then top up your balance. Use qwen4-max as the model name in your first request.

### Do I need an Alibaba Cloud account to use the Qwen4 Max API?
No. Sign up with BetterToken, create an API key and call qwen4-max with it. You pay from your BetterToken balance — no Alibaba Cloud account or separate contract is needed.

### Qwen4 Max vs Qwen3.8 Max: which should I choose?
Qwen4 Max has lower token prices: $1.08 / $3.24 for input / output, compared with $1.44 / $4.32 for Qwen3.8 Max. Alibaba reports about 60% lower average task cost in its own tests. Compare them on your workload. Qwen3.8 Max currently supports Chat Completions only.

### Which official Qwen4 Max price do you compare against?
Alibaba Cloud Model Studio's international list price for Qwen4 Max: $1.50 input, $4.50 output and $0.075 cached input per million tokens, checked on 17 Nov 2026. Our price is 28% lower on each of the three.

### What are the context and output limits?
Qwen4 Max has a 1,000,000-token context window. Maximum output is 131,072 tokens without thinking, or 262,144 with thinking enabled.

### How do thinking mode and reasoning effort work?
Thinking is enabled by default and thinking tokens are billed as output. Set enable_thinking: false to turn it off. reasoning_effort accepts low, high or xhigh; the default is high. A lower effort setting does not guarantee lower cost.

### Does the Qwen4 Max API support function calling, JSON Schema and streaming?
Yes. We tested tool calls (function calling), JSON Schema structured output and streaming through Chat Completions on BetterToken. Alibaba also documents parallel function calls for Qwen4 Max.

### Which APIs and SDKs can I use?
Qwen4 Max supports OpenAI Chat Completions, OpenAI Responses and Anthropic Messages. Configure the OpenAI Python or Node SDK with https://bettertoken.ai/v1. For Anthropic, use https://bettertoken.ai and an x-api-key header.

### Can I send images and video?
Yes. Qwen4 Max accepts text, images and video and returns text. Send media as base64 or a public URL that can be downloaded directly.

### How are cached input tokens billed?
Input tokens served from cache are billed at $0.054 per million instead of $1.08. The cache-read price applies only to tokens the response reports as cached, so repeated long prompts can cost less.

### Can I use Qwen4 Max and other models with one account?
Yes. The same BetterToken balance also works with Qwen3.8 Max, Claude, GPT, Gemini and other models — set the model name in each request. See all prices on Models & pricing.

### Is there a subscription or monthly fee?
No subscription is required to use the Qwen4 Max API. Top up your balance and pay only for the tokens you use.

### How can I pay?
Top up in US dollars with Stripe or USDT on TRC-20. On your first top-up, get $5 credit for $3. See the table above for regular top-up offers.

BetterToken is an independent service and is not affiliated with Alibaba Cloud. Qwen and related model names belong to their respective owners.
