How Much To Run AI
Hosted API

Qwen4-Max: API Access, Prices and 1M Context

Qwen4-Max is Qwen’s hosted multimodal flagship for coding, document work and tool-using agents. The official API ID is qwen4-max; it is separate from qwen4-max-preview. Compare Singapore and Global prices, then budget the tokens used by reasoning, prompts and final answers.

Content reviewed:

QwenCloud Qwen4-Max API guide ↗
Qwen4-Max Singapore budget: 100K fresh input and 10K output tokens cost $0.195; cache reads cost $0.075 per million tokens, with separate explicit-write rates and Token Plan Credits.
Original illustration of Singapore API and plan billing. The token example excludes separately billed tools.

Use this model

See access details in the guide below.

Use cases

  • Ask a coding agent to make a bounded change and report the checks it ran.
  • Review related documents, images or video in a single evidence-backed workflow.
  • Compare billed input, output and cached tokens across repeated tasks.

Qwen4-Max is different from Qwen4-Max-Preview

The released model uses the API ID qwen4-max. QwenCloud lists it as the first model in the Qwen4 family, with text generation, image and video understanding, thinking, function calling, structured output, web search, PDF understanding and MCP support. Batch inference, fine-tuning and managed model deployment are not listed as supported.

Qwen reports a 2.4T-parameter backbone with 71B active parameters per token, plus 328B N-gram embedding parameters. It accepts text, images and video; the hosted API returns text. A one-million-token context is the headline limit, with separate input and output caps depending on whether thinking is enabled.

Do not substitute qwen4-max-preview in a request for the released model. The preview is a separate endpoint with separate access and billing rules. See the Qwen4-Max-Preview page for its Token Plan details.

Connect the Singapore API endpoint

QwenCloud offers the pay-as-you-go API in Singapore, Beijing, Frankfurt, Hong Kong, Tokyo and Virginia. Install the Python client with pip install openai and set your regional API key as DASHSCOPE_API_KEY in the terminal running the example. Use a key created in the same region as the endpoint. Singapore has its own international price; Beijing and Global deployments share another price table.

Token Plan Personal and Team accounts are also supported, but those calls consume plan Credits rather than the pay-as-you-go rates below. This Chat Completions example uses the Singapore endpoint and sets a small combined reasoning-and-answer budget. The default reasoning effort is high.

OpenCode also lists Qwen4 Max in its Go subscription. Go starts at $10 per month, and Qwen4 Max draws from Go’s model-specific allowance; OpenCode treats subscription-included Go models separately from its limited-time free models. Its current free-model list does not include Qwen4 Max, so the Go listing does not establish free-tier access. Check the current Go model selector and allowance before planning usage.

First Qwen4-Max request through QwenCloud; API use is billed
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DASHSCOPE_API_KEY"],
    base_url="https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1",
)
response = client.chat.completions.create(
    model="qwen4-max",
    messages=[{"role": "user", "content": "Draft a short plan for a CSV import feature. Include the three highest-risk edge cases and one acceptance check for each."}],
    reasoning_effort="high",
    max_completion_tokens=4096,
)
print(response.choices[0].message.content)

Use Qwen4-Max through Runware

Runware provides Qwen4-Max through OpenAI-compatible Chat Completions and Responses endpoints. Create a Runware API key, use https://api.runware.ai/v1 as the base URL, and send the Runware model ID alibaba:qwen@4-max. The request below uses Chat Completions.

Runware publishes its own rates per million tokens. A request with 100,000 input tokens and 10,000 output tokens costs about $0.20 before tools or caching. Use the provider shown in your usage records when comparing costs. The QwenCloud price table and free-token quota on this page apply to QwenCloud accounts.

Qwen4-Max request through Runware
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["RUNWARE_API_KEY"],
    base_url="https://api.runware.ai/v1",
)
response = client.chat.completions.create(
    model="alibaba:qwen@4-max",
    messages=[{"role": "user", "content": "List three acceptance checks for a CSV import feature."}],
)
print(response.choices[0].message.content)
Runware rates per million tokensUSD
Input$1.50
Output$4.50
Cached input$0.075
Cache write$1.88

Qwen4-Max API prices by region

QwenCloud lists the same per-token rates for thinking and non-thinking requests, with no input-length price tiers. Thinking tokens count as output and are billed at the output rate. Prices are in US dollars per million tokens; use the column matching the region and deployment scope of your API key.

A Singapore request with 100,000 input tokens and 20,000 output tokens costs about $0.24 before cache use or separately billed tools: $0.15 for input and $0.09 for output. This is an example at the listed rates, not a fixed task price.

New Singapore-region API users typically receive 1 million free tokens per model. Eligibility requires account activation, the quota is shared between input and output, and its expiry depends on the quota type. Check the console for the model balance and expiry; other regions do not have this free quota. Built-in tool fees are not offset by it.

Billing item (USD per million tokens)Singapore (International)Beijing / Global
Input$1.50$1.413
Output, including thinking$4.50$4.24
Cache write, 5 minutes$1.875$1.767
Cache write, 1 hour$3.00$2.827
Explicit or implicit cache read$0.075$0.071

Use Qwen4-Max through Together AI

Together AI offers Qwen4-Max as a serverless chat API with the model ID Qwen/Qwen4-Max. Authenticate with a Together API key and use the OpenAI-compatible chat completions endpoint. Together enables deep thinking by default, and its usage is billed separately from QwenCloud and Runware.

Together’s listed rates are $1.05 per million input tokens and $3.15 per million output tokens, with cached input at $0.0525. At those rates, 100,000 input tokens and 20,000 output tokens cost about $0.168 before any separate tools. Check the provider usage record for the billed input and output totals.

Send a Qwen4-Max request through Together AI
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["TOGETHER_API_KEY"],
    base_url="https://api.together.ai/v1",
)
response = client.chat.completions.create(
    model="Qwen/Qwen4-Max",
    messages=[{"role": "user", "content": "Review this migration plan and list three acceptance checks."}],
)
print(response.choices[0].message.content)
Together AI serverless rates per million tokensUSD
Input$1.05
Cached input$0.0525
Output$3.15

Budget thinking and repeated prompts

Qwen4-Max supports explicit and implicit caching through Chat Completions, Responses and Anthropic Messages. The cache guide requires a reusable prefix of at least 1,024 tokens. Implicit cache hits are not guaranteed. Explicit caching uses breakpoints and a valid cached prefix, with 5-minute or 1-hour TTLs. Each route has published write and read rates, so use those rates when pricing repeated input.

Use caching for stable, repeated prefixes such as system instructions, tool definitions or reference material. The DashScope API does not support the new Qwen4 explicit-cache feature. Keep the changing task prompt after the reusable prefix.

Thinking is on by default at high effort. The API accepts low, high and xhigh; medium maps to high, while max maps to xhigh. max_completion_tokens limits thinking and the visible answer together. Start with the default for a bounded task, and raise effort only when your acceptance checks show a gain.

Published output limits are 131,072 tokens without thinking and up to 262,144 thinking-plus-answer tokens with thinking. Maximum input is 991,808 tokens without thinking or 983,616 with thinking. Long context is capacity, not a forecast of what a task will consume.

What do Qwen’s efficiency claims say about a task?

Qwen reports that Qwen4-Max used about 24% fewer tokens than Qwen3.8-Max at xhigh effort and 35% fewer at high on its Work360 evaluation. On Terminal-Bench 4.0, Qwen reports reductions of about 48% and 49%. Qwen also reports average Work360 task cost falling from $4.43 to $1.67, a 62% reduction. These are Qwen-reported evaluation results, not a promise that an individual customer task will cost 62% less.

A separate early coding-agent report from Atomic Agent used OpenRouter with Alibaba serving the model. On one roughly 1,400-line codebase with 13 planted bugs, one missing feature and 59 hidden tests, the authors report that Qwen4-Max at high passed all tests in each of three runs, taking about 25 minutes. The reported cost was about $0.65, the mean of two fully recorded runs. This is one task in the authors’ own agent and is a bounded example, not a general task-cost estimate.

For your own comparison, repeat the same task with the same acceptance tests. Record reasoning effort, model ID, provider, cache-read tokens, input and output tokens, retries, elapsed time and whether the final artifact passes. Count only accepted results when comparing cost per completed task.

Before you use it

  • QwenCloud does not list batch inference, fine-tuning or managed model deployment for this model.
  • Rates vary by region; cache hits are not guaranteed, and thinking is billed as output.

How to get started

Choose a provider and use its matching Qwen4-Max model ID, API key and endpoint. Set a combined output budget, then compare accepted tasks using that provider’s token and cache usage.

Sources

Sources (13)

Calculators