Qwen4-Max API Pricing: What Prompt Caching Saves Coding Agents

Alibaba’s Qwen4-Max discounts cached input by 95% on QwenCloud’s Singapore endpoint. A ten-review example shows what that means for the full coding-agent bill.

Qwen4-Max prompt caching illustrated by a glowing stack of data layers encircled by an arrow.

A coding agent reviewing ten changes in the same repository may read the same architecture notes, tests, and source files ten times. Alibaba’s Qwen4-Max, released on November 16, 2026, gives those repeated inputs a steep discount when they hit the cache. On QwenCloud’s Singapore endpoint, a million cached input tokens cost $0.075, down from $1.50 at the standard input rate.

That’s a 95% discount on the tokens served from cache. In the ten-review example below, it lowers the entire model bill by about 37%. The difference comes from the first request, the material that changes between reviews, and the tokens the model generates while thinking and answering.

What Alibaba released

Qwen4-Max is Alibaba’s new flagship model for coding, tool-using agents, and work involving documents and visual inputs. It accepts text, images, and video and returns text. Alibaba says its mixture-of-experts architecture has 2.4 trillion parameters in total and activates 71 billion per token. That means different parts of the model handle different tokens, with only a subset used for each one.

QwenCloud lists a one-million-token context window, with a lower maximum input of 983,616 tokens in thinking mode. For developers, the practical benefit is room to bring several kinds of evidence into one request. A bug report can include a screenshot, source files, and test output so an agent can follow the problem across the front end and back end.

The production API model ID is qwen4-max. QwenCloud offers it through its Token Plan and pay-as-you-go API, with OpenAI-compatible Chat Completions and Responses endpoints as well as Anthropic Messages support. Alibaba is offering the flagship as a hosted model and has announced plans to release smaller Qwen4 models with open weights.

How Qwen4-Max API pricing works

QwenCloud lists the following Singapore API rates in US dollars per million tokens. It publishes separate rates for Beijing and its Global deployment scope, which includes Frankfurt and Virginia.

Singapore billing item Price per million tokens
Standard input $1.50
Input served from cache $0.075
Explicit cache write with a five-minute lifetime $1.875
Explicit cache write with a one-hour lifetime $3.00
Output, including thinking and the final answer $4.50

The implicit cache looks for an identical sequence at the start of a prompt and applies the lower rate when it finds a match. With explicit caching, your application can mark the end of the material it intends to reuse. The initial write has its own price, and successful reads get the same $0.075 rate in Singapore.

For a code-review agent, a practical order is to put the shared instructions, repository snapshot, and review policy first, then append the pull request diff and question. Keep the shared files in the same order across requests. Putting a timestamp or pull request ID before the repository snapshot can interrupt the match before the model reaches the material you want to reuse. Check the API’s reported cached-token count to see how much of the prefix was actually reused.

What ten code reviews could cost

Suppose each of ten requests sends 30,000 tokens of shared repository context and 10,000 tokens specific to one pull request. Each review generates 10,000 billed output tokens, including the model’s thinking where enabled. The table treats the first request as a cache miss and assumes that, in the two caching scenarios, all nine follow-up requests reuse the full shared prefix. It estimates model tokens only and uses Singapore rates.

Scenario Input cost Output cost Total
All input billed at the standard rate $0.600 $0.450 $1.050
Nine implicit cache hits $0.215 $0.450 $0.665
One five-minute explicit write and nine cache reads $0.227 $0.450 $0.677

In the implicit-cache example, 270,000 input tokens get the discounted rate and 130,000 are billed at the standard rate. The output cost stays at $0.45 in all three scenarios. An explicit write costs slightly more here because the example gives implicit caching the same nine hits. If your measured implicit hit rate is lower, the comparison can change.

How to test Qwen4-Max in your coding agent

Alibaba reports that Qwen4-Max cut average task cost by around 60% relative to Qwen3.8-Max on Work360, its own benchmark for professional tasks. In a separate evaluation, Artificial Analysis gave Qwen4-Max an Intelligence Index score of 43 and recorded an average of roughly 32 minutes per task on that suite, compared with about 13 minutes for the median model in its comparison. Those timings describe the evaluator’s tasks and setup. Your agent’s deadlines and tool usage will determine which latencies are acceptable.

Compare Qwen4-Max with your current model on a set of closed pull requests and known regressions. Give both agents the same repository snapshot, tools, and review budget. Check whether each agent finds the issue, produces a patch that passes the tests, and avoids unrelated changes. Run a mix of first requests and repeated requests, and record billed input, cached tokens, billed output, retries, and elapsed time for the whole task.

Use cost per accepted patch to compare the results. Divide total model spending, including failed attempts, by the number of patches that pass your review. Qwen4-Max is a candidate for workloads that revisit a stable codebase, especially when the agent can work in the background. A cache hit makes the familiar part of a request cheaper. The evaluation shows whether the agent also saves time and delivers a patch worth keeping.

For a related evaluation method, see how we compared Gemini 4 Hydrogen and Carbon for coding agents.

Sources