HomeWorkBlogVideosProjectsTalksColabs
  • rss

  • github

© Arindam Majumder 2026. All rights reserved.

Qwen4-Max vs Claude Opus 5.5: up to 4x cheaper per token, but is it any good?

Nov 23, 2026 · 18 min read

Qwen4-Max vs Claude Opus 5.5: up to 4x cheaper per token, but is it any good? cover image

Last week, Alibaba launched Qwen4-Max, the latest model in the Qwen family, and the first thing I noticed was the price. It costs $1.50 per million input tokens and $4.50 per million output tokens, while Claude Opus 5.5 costs $4 and $20, so Qwen is about 2.7x cheaper on input and more than 4x cheaper on output. I spend a lot of my day working with coding agents, and a gap that big made me wonder whether I could switch over without giving up much.

I didn't want to decide that from a leaderboard, because what I actually care about is how a model behaves when I give it a real task inside an agent and let it work on its own. So I put together a small test of my own, with three coding tasks and 22 shorter questions. Opus ran in Claude Code, Qwen ran in OpenCode, and everything was graded by hidden tests that I wrote before running anything.

I ended up running Qwen twice, once as it comes and once with its reasoning capped, because in the first round it would sometimes think through an entire response and return nothing at all. That turned out to be one of the more useful things I learned, and I'll get to it below along with everything else.

Watch the video

If you'd rather watch than read, I made a video of the whole comparison with both agents running side by side:

This post goes deeper than the video, covering every task and every run, and where the time and money went.

The short version

  • With tests to pass, everyone scored (nearly) full marks. Cron parser: Opus 45/45 and 45/45, Qwen default 45/45 and 45/45, Qwen capped 43/45 and 45/45. Bug hunt: 30/30 on every run. Single-turn questions: 22/22 for every setup.
  • Opus got there far sooner. On the cron task its last edit came at 33 seconds, against 12.5 minutes (Qwen default) and 5.1 minutes (Qwen capped). On the bug hunt it was 21 seconds, against 4.1 and 10.5 minutes.
  • The open-ended build split them. Opus shipped a working traffic simulator twice (8/8, 8/8). Qwen with default reasoning didn't (0/8, 7/8): it can reason through an entire response and return nothing. With its reasoning capped, Qwen shipped twice too (8/8, 8/8), at $0.82 a take against Opus's $2.85.
  • Capping Qwen's reasoning also halved its single-turn time (47 s to 23 s per answer) with no accuracy lost. Opus averaged 9 s.
  • Cheaper tokens, not always cheaper tasks. Over the whole benchmark, Opus cost $6.82 and capped Qwen $2.82 at list price. On the two tasks with tests, though, Qwen often cost more, because it read and reasoned so much more.

How I ran it

Setup: the same tasks go to Claude Opus 5.5 in Claude Code and to Qwen4-Max in OpenCode; graders produce scores, tokens, time and cost.

  • Claude Opus 5.5 ran in Claude Code with its default settings. I didn't tune it.
  • Qwen4-Max ran in OpenCode, two ways. "Default" is the model's stock reasoning behaviour. "Reasoning capped" limits its reasoning to 12,000 tokens per step. That's one option in the model config, and it's the only difference between the two Qwen setups.
  • Both agents got the same shell allowlist: python3, pytest, ls, cat, grep, find, node and a few more. They had no network access and couldn't install packages.
  • Every agentic run had a 45-minute budget. A run that hits it is graded on whatever it had written by then, and its time and tokens are counted only up to the deadline.
  • Every run starts in a fresh folder, and each agentic task ran twice per setup (two "takes").
  • The single-turn questions used a lean setup: a one-line system prompt and no tools.

Dollar figures are measured tokens multiplied by list price, so both models are priced the same way. They are not what I actually paid.

Per 1M tokens Input Cached read Cache write Output
Claude Opus 5.5 $4.00 $0.20 $8.00 (1-hour) $20.00
Qwen4-Max $1.50 $0.075 n/a $4.50

The tasks

I wrote every grader before running anything. The agents never saw the hidden tests.

Task 1: build a cron parser from a spec

A cron expression is the five-field schedule string Unix uses for recurring jobs: 30 9 * * MON-FRI means 9:30 on weekdays. The agent gets a two-page SPEC.md and a stub, and has to implement next_fire(expr, after): the first minute strictly after after that matches the expression. It sees 6 easy tests. The grader runs 45 hidden ones.

It sounds simple, but the spec follows classic Vixie cron, and that's full of traps:

0 0 13 * FRI    -> every 13th AND every Friday   (both day fields restricted: they OR)
0 0 */2 * FRI   -> only Fridays on odd days      (*/2 starts with *, so it counts as unrestricted)
0 0 * * 7       -> Sundays                       (0 and 7 are both Sunday)
0 0 29 2 *      -> Feb 29: 2028, 2032, ... but not 2100   (2100 isn't a leap year)
0 0 30 2 *      -> never fires                   (the spec says: raise ValueError)
Enter fullscreen mode Exit fullscreen mode

The hidden answers come from a brute-force reference that scans a full 400-year Gregorian cycle, cross-checked against croniter.

Task 2: a bug hunt

A small expense-splitting library (parse money, split bills, work out who owes whom, settle up) with 7 planted bugs. The docstrings are the specification. The visible tests catch only 3 of the bugs; the hidden suite has 30 tests that cover all 7:

# Planted bug Caught by a visible test?
1 parse_amount used float(), so "0.29" could become 28 cents yes
2 parse_amount accepted inputs the docstring rejects ("1e3", "nan", "--5") no
3 format_cents broke on negatives (-5 should be "-0.05") no
4 split_even dropped the remainder (100 split 3 ways must be 34/33/33) yes
5 split_weighted rounded each share on its own instead of using largest remainder yes
6 expenses_between excluded the end date no
7 settle leaked state through a mutable default argument and mutated its input no

The tests/ folder is hashed before and after each run, so an agent that "fixes" the tests instead of the code gets caught.

Task 3: a one-shot front end

The whole prompt, condensed:

Build index.html: one self-contained file (inline CSS and JS, no CDN) that simulates a busy four-way city intersection seen from above. Coordinated traffic lights, cars that stop at the line, keep a safe gap and sometimes turn, pedestrians who cross only on their walk signal, and a control panel with play/pause, a speed slider (0.5x to 4x), a spawn-rate slider and live counters for "cars passed" and "average wait". A hand-drawn, sketchy style is welcome. It must open directly in a browser.

There are no tests to lean on, so the agent decides for itself when it's done. Headless Chrome grades the result on 8 checks:

  1. the file exists
  2. it loads with no external requests
  3. no console errors
  4. it animates on its own
  5. it has at least 2 sliders
  6. pause freezes it
  7. play resumes it
  8. the counters move

22 single-turn questions

No tools, and every answer is checked by code:

  • 10 reasoning puzzles I wrote fresh, so they can't have been memorized, with every answer brute-forced. For example: "What's the date of the third Friday of the month exactly 17 months after November 2026?" (2028-04-21), "How many 6-digit numbers have digits summing to 27 with no two equal neighbours?" (32,654), and "What's the smallest n such that n! ends in exactly 5 zeros?" (trick question: there isn't one).
  • 8 instruction-following tests, such as a 5-7-5 poem counted in words, a 40-60 word paragraph with no letter "e", a 12-word sentence where every word starts with "s", and a JSON object whose score must be a prime between 1 and 10.
  • 4 vision reads: an unlabeled bar chart, an architecture diagram (list every arrow), a receipt (sum only the starred items) and a screenshot of code (what does it print?).

Results at a glance

Scoreboard: Opus 5.5, Qwen4-Max with default reasoning, and Qwen4-Max with reasoning capped, across six task groups.

Task Opus 5.5 (Claude Code) Qwen4-Max default (OpenCode) Qwen4-Max capped (OpenCode)
Cron parser, 45 hidden tests 45/45, 45/45 · last edit 33 s · $0.21 45/45, 45/45 · last edit 12.5 min · $0.38 43/45, 45/45 · last edit 5.1 min · $0.26
Bug hunt, 30 hidden tests 30/30, 30/30 · last edit 21 s · $0.16 30/30, 30/30 · last edit 4.1 min · $0.14 30/30, 30/30 · last edit 10.5 min · $0.26
Traffic sim, 8 browser checks 8/8, 8/8 · last edit 31.1 min · $2.85 0/8, 7/8 · last edit 44.7 min · $0.22 8/8, 8/8 · last edit 35.8 min · $0.82
10 reasoning puzzles 10/10 · 13 s per answer · $0.27 10/10 · 74 s per answer · $0.17 10/10 · 38 s per answer · $0.11
8 instruction tests 8/8 · 6 s per answer · $0.075 8/8 · 23 s per answer · $0.015 8/8 · 10 s per answer · $0.017
4 vision reads 4/4 · 5 s per answer · $0.036 4/4 · 30 s per answer · $0.012 4/4 · 15 s per answer · $0.012

Scores are per take. Agentic times are the average time to the last edit of the deliverable, inside the 45-minute budget. Agentic costs are the average per take.

Single-turn: all perfect, very different speeds

Per-item results for 22 single-turn questions: every setup answered every question correctly.

Every setup answered all 22 correctly. That includes the trick factorial question, the lipogram and the unlabeled bar chart. Where they differed was speed: Opus averaged 9.0 seconds per answer, Qwen 47.3 seconds with default reasoning, and 23.4 seconds with it capped.

The slowest question shows why. Counting 6-digit numbers whose digits sum to 27 with no equal neighbours took Qwen 410 seconds by default and 192 seconds capped, against 55 seconds for Opus. It's really an enumeration problem, and Qwen tried to reason its way through it.

All 22 questions together cost $0.38 with Opus, $0.20 with Qwen default and $0.14 with Qwen capped. So on simple single-turn work, capped Qwen was 2.8x cheaper and lost nothing in accuracy, just time.

Cron parser: same score, very different clocks

On the two tasks with tests, the scores were nearly identical. How each model worked was not. Each chart below plots every tool call on one shared clock.

Cron task timeline, take 2: Opus finishes in under a minute; Qwen reasons for several minutes before its first edit, less so with reasoning capped.

Opus read everything in one shell command (ls -la && cat SPEC.md && cat cronnext.py && cat tests/*.py). At 33 seconds it wrote cronnext.py in one go, ran the tests plus a few edge cases by hand, and stopped at 48 seconds: 45/45. It used 4 tool calls. Both takes looked almost identical, down to the second.

Qwen with default reasoning read the same files, then reasoned for 6.1 minutes before its first edit at 7.0 minutes. Then it wrote its own randomized check scripts to verify the parser, and stopped at 13.3 minutes: 45/45. Its other take also scored 45/45, after 11.9 minutes of thinking before its first edit. It used 17 to 18 tool calls per take.

Qwen with reasoning capped started writing sooner (first edit at 4.0 minutes), then iterated in smaller steps with its own checks, and stopped at 12.3 minutes: 45/45.

Its other take is the one miss of the benchmark: 43/45. I re-ran its code on the two failing cases to see why:

0 0 29 2 MON  after 2026-02-20  -> expected 2026-02-23, 2027-02-01   got: ValueError "can never fire"
0 0 30 2 SUN  after 2026-01-01  -> expected 2026-02-01               got: ValueError "can never fire"
Enter fullscreen mode Exit fullscreen mode

Both are the Vixie OR rule in disguise. February 30 never exists, but because both day fields are restricted, 0 0 30 2 SUN also fires on every Sunday in February. Qwen's "can this ever fire?" check ran before the OR logic, so it rejected expressions that do fire. That's exactly the kind of edge case a longer think catches, and capping the reasoning made it slightly more likely to slip through.

Bug hunt: everyone found all seven

Bug-hunt timeline for all three setups.

On the bug hunt, every run found all 7 planted bugs, including the 4 that no visible test catches. Every run scored 30/30 without touching tests/.

The styles were very different again:

  • Opus took 28 and 32 seconds, with 2 to 3 tool calls. In take 1 it read the whole package and ran the tests in one command (3 failed, 2 passed), then rewrote the files with a single python - <<'EOF' script, and all tests passed.
  • Qwen (default) took 5.6 and 2.9 minutes, with 18 to 19 tool calls.
  • Qwen (capped) took 6.0 and 16.0 minutes, with 19 and 28 tool calls. Before finishing, it ran randomized property checks of its own, like "shares always sum to the total" and "settling always reaches zero".

Opus also caught a latent bug I hadn't planted: net_balances silently dropped people who were missing from weights. It fixed it and listed its judgement calls for me to review, which is what I'd want from a human reviewer too.

The traffic simulator: where reasoning made the difference

This is the task with no tests to lean on, so the agent decides for itself when the simulator is "done".

Three traffic simulators: Opus 8/8; Qwen with default reasoning 7/8 with a visible gridlock; Qwen with reasoning capped 8/8.

Here they are running untouched in headless Chrome, Opus on the left and capped Qwen on the right, both 8/8:

Same prompt, two simulators: Opus (left) and Qwen with its reasoning capped (right), running in headless Chrome.

Opus: shipped both times

  • Take 1: 8/8. First index.html at 10.3 minutes, last edit at 23.7 minutes, 72 tool calls, $4.03.
  • Take 2: 8/8. First and only index.html at 38.6 minutes, 7 tool calls in total, $1.67.

Take 1 is the thorough engineer. Its "Crossroads" is a hand-drawn town with houses, ponds and a compass. It built a headless test harness in Node and used it to find and fix real simulation bugs:

  • two opposing left-turners deadlocking, because each yielded to the car queued behind the other
  • pedestrians stepping into stopped cars
  • gridlock at high spawn rates

Take 2 worked completely differently. After reading the prompt, it went more than half an hour without a single successful tool call, thinking and composing, then wrote the whole 34 KB simulator in one write at 38.6 minutes. It stress-tested the logic in Node with a stubbed canvas (375 cars through, and an empty intersection box at the end), and finished at 39 minutes. In its summary it said it couldn't open a real browser in the sandbox, so it hadn't seen the page render. That's honest, and the page passed all 8 checks anyway.

Qwen with default reasoning: didn't ship a working version

  • Take 1: 0/8. No index.html at all, after the full 45 minutes.
  • Take 2: 7/8. First index.html at 36.1 minutes, last edit at 44.7 minutes. Its pause button didn't fully freeze the scene, and the gallery shot above shows a gridlock.

Take 1 made 3 tool calls in 45 minutes. The same step restarted every 17 minutes or so and never produced a file. You can see why without the agent. Here's Qwen4-Max through the plain API, on a hard puzzle:

output cap 6000 tokens   -> finish_reason: length, reasoning: 6000 tokens, answer: ""
reasoning capped at 300  -> finish_reason: stop,   reasoning: 300 tokens,  answer: "41132" (wrong)
Enter fullscreen mode Exit fullscreen mode

Uncapped, it spent the whole response reasoning and returned nothing. An agent loop treats an empty response as a wasted step and retries it, which is what take 1 did for 45 minutes. Capped too tightly, it answers fast but wrong. So the cap has to be generous, not tiny.

Qwen with reasoning capped: shipped both times

With a 12k-token reasoning cap per step:

  • Take 1: 8/8. First index.html at 7.9 minutes, last edit at 27.1 minutes, 39 tool calls, $0.77.
  • Take 2: 8/8. First index.html at 10.1 minutes, last edit at 44.5 minutes, 35 tool calls, $0.88.

Its "Sketchy Junction" has coordinated lights with an all-red clearing phase, walk signals and a sketchy control card. Like Opus's take 1, it wrote its own headless test and kept refining until the budget ran out. Both takes were still refining when the 45-minute budget ran out. Each was graded on the file it had at that point, and both scored 8/8.

Here's take 1 of all three on one clock. The flat middle lane is default Qwen stuck in that retry loop:

Traffic-sim timeline, take 1: Opus edits and self-tests from 10 to 24 minutes; Qwen default makes 3 tool calls in 45 minutes; capped Qwen edits from 8 to 27 minutes.

Capped Qwen cost $0.82 a take against Opus's $2.85. Opus's take-1 verification loop, at $4.03, was the single most expensive run in the benchmark.

How each model works

Put the runs side by side and a pattern shows up. On the tasks with tests, Opus works in a few big steps: read everything, write the whole file, run the tests, stop. Qwen works in many small steps and checks itself with scripts it writes.

Tool calls per take Opus 5.5 Qwen default Qwen capped
Cron parser 4, 4 17, 18 11, 21
Bug hunt 2, 3 19, 18 19, 28
Traffic sim 72, 7 3, 9 39, 35

And Qwen thinks a lot more, even with the cap:

Reasoning tokens per task: Qwen with reasoning capped uses 20x more on cron, 45x more on the bug hunt, 1.3x more on the traffic sim and 2.2x more on single-turn questions.

On the cron parser, capped Qwen used 20x as many reasoning tokens as Opus, and on the bug hunt 45x. Only on the open-ended build did Opus think about as much as Qwen. Qwen's output tokens cost about a quarter of Opus's, so it can afford to think more, but thinking still takes time.

Time

Average time per agentic run for each setup, with the time of the last edit to the deliverable marked.

With tests to pass, Opus reached its last edit in 33 seconds on the cron task, against 12.5 minutes (Qwen default) and 5.1 minutes (Qwen capped). On the bug hunt it was 21 seconds, against 4.1 and 10.5 minutes.

API throttling doesn't explain the gap. Across all eight Qwen runs of those two tasks, waiting on throttled requests cost 4.3 minutes in total. The time goes into reasoning and into Qwen's habit of verifying with its own scripts.

On the open-ended build the clocks converged: 31.1 minutes for Opus and 35.8 minutes for capped Qwen to the last edit. Both spent most of that time testing their own work, because nothing told them when to stop.

Tokens and money

Input and output tokens per agentic run, with list-price cost.

Per token, Qwen4-Max is 2.7x cheaper on input and 4.4x cheaper on output. Per task, it depends on how much each model reads and thinks:

Run (average of 2 takes) Input tokens Output tokens List price
Cron · Opus 144k 5k (1k reasoning) $0.21
Cron · Qwen default 915k 45k (35k reasoning) $0.38
Cron · Qwen capped 652k 28k (21k reasoning) $0.26
Bug hunt · Opus 100k 3k (0.5k reasoning) $0.16
Bug hunt · Qwen default 433k 12k (7k reasoning) $0.14
Bug hunt · Qwen capped 740k 30k (23k reasoning) $0.26
Traffic sim · Opus 2.5M 79k (46k reasoning) $2.85
Traffic sim · Qwen default 251k 29k (22k reasoning) $0.22
Traffic sim · Qwen capped 3.1M 90k (62k reasoning) $0.82

Where the money goes: list-price cost per task, Opus vs Qwen with reasoning capped.

  • On the tasks with tests, Qwen often cost more. With reasoning capped it was $0.26 vs $0.21 on cron (1.2x), and $0.26 vs $0.16 on the bug hunt (1.7x). Opus read 144k tokens for the cron task; capped Qwen read 652k.
  • On the open-ended build, capped Qwen cost about a third ($0.82 vs $2.85). Its millions of input tokens were mostly cache reads at $0.075 per million. Opus paid $20 per million for its long output and $8 per million for Claude Code's one-hour cache writes.
  • Overall (6 agentic runs plus 22 questions): $6.82 for Opus and $2.82 for capped Qwen, so Qwen did the whole benchmark for 41% of the price.
  • Qwen default looks even cheaper overall ($1.67), but don't read much into that. Its stalled traffic-sim take shows almost no tokens, because its giant step never finished and its usage was never reported.

So which one would I use?

Here's how I'd split my own work after this:

  • For interactive work, where you're waiting on the agent, Opus 5.5 is the better tool. On well-specified tasks it reached its last edit 9 to 30 times sooner. On those tasks it wasn't more expensive either: it was the cheapest setup on the cron parser, and within 2 cents of the cheapest on the bug hunt.
  • For long, open-ended builds you can leave running, capped Qwen4-Max is a strong, cheap option. It shipped the same 8/8 simulator as Opus at under a third of the cost.
  • For high-volume single-turn work, capped Qwen gave the same 22/22 accuracy at about a third of the price, if you can live with 23 seconds per answer instead of 9.
  • If you use Qwen4-Max in an agent, cap its reasoning. It's the difference between 0/8 and 8/8 on the open-ended task.

What I learned

  1. On well-specified tasks, correctness didn't separate them. Every setup passed (nearly) everything. Speed did: Opus wrote, ran the tests and stopped, while Qwen thought for minutes and then verified with its own scripts.
  2. For agent work, cap Qwen4-Max's reasoning. With default reasoning it can spend a whole response thinking and return nothing, which stalled the open-ended build. Capped, it shipped that build twice and answered single-turn questions twice as fast.
  3. The cap is a trade-off. It also made Qwen slightly more likely to miss an edge case: one of its two capped cron takes dropped two hidden tests (43/45).
  4. Price per token isn't price per task. Qwen was far cheaper overall, mostly because Opus's thoroughness on one open-ended task was expensive. On the tasks with tests it often cost more. Measure your own workload.
  5. The harness and the API show up in the numbers. OpenCode's stock prompt is about 24k tokens, the API throttled, and Claude Code's safety checks blocked some of Opus's commands. None of that is the model, but all of it is what you'd live with.

Things that bit me (so they don't bite you)

  • opencode run hangs forever if stdin is an open pipe. Pass </dev/null, and give --dir an absolute path.
  • "Anthropic-compatible" isn't the same as "works in Claude Code". I tried running Qwen inside Claude Code through an Anthropic-compatible endpoint, for a same-harness comparison. That endpoint's stream put thinking deltas inside a text block and opened a tool block before closing the previous one, and Claude Code discarded every turn. Test streaming with tools before you rely on one.
  • The API throttled. OpenCode silently retries quota errors with backoff. I parsed its log for every retry, so throttling is reported separately from model time.
  • My timeout didn't fire. Python's threading.Timer waits on the monotonic clock, which on macOS stops while the machine naps. A few runs went past the 45-minute budget before I stopped them. The runner now checks wall-clock time. Each such run is graded on what it had written by the deadline, and its tokens are counted only up to the deadline.
  • A command allowlist isn't a sandbox. I allowed cat, and Qwen used cat > $TMPDIR/opencode/verify.py <<'PY' to write scratch scripts into OpenCode's temp folder. That was harmless, but cat with a redirect is a write.
  • Claude Code's own safety checks cost Opus time. They blocked several of its compound shell commands; it rewrote each one and carried on.
  • My graders were wrong twice, so I re-checked everything. A JSON extractor picked an inner array and marked a correct answer wrong. And the simulator's "animates" and "counters" checks looked at only a 2.5-second window, which fails simulators that start with an empty road. I added a second pass (motion across a whole 12-second clip, counters over 30 seconds) and applied it to every run. It raised four takes, across all three setups, to the scores you see above.

Caveats

  • Small samples. There are 3 agentic tasks with 2 takes per setup, and 22 single-turn questions. Read a single flipped item as noise.
  • Different harnesses. Opus ran in Claude Code and Qwen ran in OpenCode, so part of what you see is the harness. That's how you'd actually use each one, and the same-harness option didn't work (see above).
  • Configuration. Opus ran on Claude Code's defaults; I didn't tune it. Qwen's two setups differ only in the reasoning cap, applied the same way on every task.
  • Throttling and network. Qwen's times include API throttling, reported separately. One of Qwen's cron runs also hit a network drop on my side.

How the benchmark works

The runner is a small Python script that launches each harness headless (claude -p --output-format stream-json and opencode run --format json) in a fresh folder, under a wall-clock deadline. It streams every tool call into a live dashboard and logs tokens per step. After each run, the graders take over: hidden pytest suites for the cron parser and the bug hunt, and a headless-Chrome script for the simulator that records a 12-second clip and checks the 8 behaviours. Every run was recorded with asciinema, and every number in this post is read from the results file, not typed by hand.

If you want to run something like this yourself, the most useful advice I can give is: write the graders first, hide them from the agent, and count time to the last edit, not just time to exit.


If you want to see the agents actually working through these tasks, the full video is here. And if you run your own version of this, tell me in the comments what you found. I'm curious whether your numbers look anything like mine.

I make videos like this regularly, so subscribe to my YouTube channel if you want more model comparisons and AI coding deep dives.

On this page

    aillmclaudeprogramming

    Also published on DEV.to.