DEV Community

Super Lewis
Super Lewis

Posted on Fully Autonomous

Cost per task, not per token: a Python calculator for Qwen 4 Max vs GPT-6 Sol, including the 272K-token price step

Price per token is a poor guide to what a language model costs you. Qwen 4 Max lists below GPT-6 Sol on every line, yet cost more than twice as much on my seven test tasks, because it emits about five times the output tokens. Past 272,000 input tokens the result reverses. This post gives a calculator that handles both effects.

Disclosure: the measurements come from apimodels.app, which is the API I work on. apimodels.app is a multi-model API gateway: one key and one OpenAI-compatible endpoint for image, video, audio and language models. I wrote this from my own test data, with AI assistance for drafting and editing.

The pricing rules

List prices per million tokens, checked on November 17, 2026:

  • Qwen 4 Max: $1.50 input, $4.50 output, flat across a one-million-token context
  • GPT-6 Sol: $2 input, $10 output. Above 272,000 tokens the whole request is billed at $4 input and $15 output

The step applies to the entire request, not just the overflow. Going from 270K to 280K input tokens reprices everything.

The calculator

def qwen4_max(inp, out):
    return (inp * 1.50 + out * 4.50) / 1_000_000

def gpt6_sol(inp, out):
    p_in, p_out = (4.00, 15.00) if inp > 272_000 else (2.00, 10.00)
    return (inp * p_in + out * p_out) / 1_000_000

cases = [  # name, input tokens, Qwen output, Sol output
    ("short request", 10_000, 3_000, 600),
    ("mid-size document", 200_000, 5_000, 1_000),
    ("very long document", 300_000, 5_000, 1_000),
]
for name, inp, out_q, out_s in cases:
    print(f"{name}: qwen4-max ${qwen4_max(inp, out_q):.4f}  "
          f"gpt-6-sol ${gpt6_sol(inp, out_s):.4f}")
Enter fullscreen mode Exit fullscreen mode

Output:

short request: qwen4-max $0.0285  gpt-6-sol $0.0260
mid-size document: qwen4-max $0.3225  gpt-6-sol $0.4100
very long document: qwen4-max $0.4725  gpt-6-sol $1.2150
Enter fullscreen mode Exit fullscreen mode

Why the output counts differ per model

The two models do not spend the same number of tokens on the same task, so the calculator takes a separate output figure for each.

On seven graded tasks (93 programmatic checks, all passed by both), Qwen 4 Max emitted about 22,100 output tokens and GPT-6 Sol about 4,350. On one set of counting puzzles Qwen 4 Max wrote 10,801 tokens, 10,777 of them thinking, while GPT-6 Sol wrote under 800. Thinking is billed as output.

Total for the seven tasks at the platform's posted rates: about $0.21 for Qwen 4 Max and about $0.09 for GPT-6 Sol. Total time was 415 seconds against 189.

To size your own workload, run a small batch on each model and feed the real completion_tokens into the calculator:

def measure(client, model, prompt):
    stream = client.chat.completions.create(
        model=model, messages=[{"role": "user", "content": prompt}],
        stream=True, stream_options={"include_usage": True})
    usage = None
    for chunk in stream:
        usage = chunk.usage or usage
    return usage.prompt_tokens, usage.completion_tokens
Enter fullscreen mode Exit fullscreen mode

Three rules of thumb

  • Short input, output-heavy work: output volume dominates, so GPT-6 Sol usually costs less and answers sooner.
  • Long input, short answers: the input rate dominates and Qwen 4 Max pulls ahead. Past 272K the gap is more than double.
  • Bulk work with no reasoning: Qwen 4 Max lets you turn thinking off per request, which leaves only the answer in the output. Check accuracy again afterwards. My results were measured with thinking on.

When the bill disagrees with the estimate

  • Confirm you are reading real usage. Streams need stream_options={"include_usage": True}.
  • Check whether the input crossed 272K. Conversation history accumulates, and turn N can cross the line without anyone noticing.
  • Look at completion_tokens, not the length of the answer. Thinking tokens are invisible in the reply and still billed.

When this comparison does not apply

  • You are not paying list price. Replace the rates with your own.
  • Latency matters more than cost. Artificial Analysis measures GPT-6 Sol at 125 output tokens per second. Published figures for Qwen 4 Max range from 30 to 53.
  • Long, difficult tasks. Mine were everyday difficulty and ran once each.

The full comparison, including GPT-6.1 Sol and the benchmark sources, is on the Qwen 4 Max vs GPT-6 Sol page at apimodels.app.

Top comments (0)