DeepSeek V4.1 Flash Uncensored · Try it →

What an Agent Step Costs: Qwen3.8 27B vs MiMo V2.6 Flash

by

Published:

An agent step is one request: the whole context so far plus a short reply, and the agent pays for that context again on every step. At our catalog prices on 2 November 2026, an average coding-agent step (52,000 tokens of context, 90% of it from the prompt cache, 330 tokens out) costs $0.0102 on Qwen3.8 27B and $0.0125 on MiMo V2.6 Flash. Measured on an open issue from a GitHub project, a step cost $0.0071 and $0.0086.

Prices for language models are quoted per million tokens, separately for fresh input, cached input and output. For a chat that is enough. For a coding agent it hides the number that decides the bill: what one step costs, and how much of each step the prompt cache absorbs.

This article gives the formula, works it out for the two coding models we serve on our own GPUs, Qwen3.8 27B and MiMo V2.6 Flash, at the catalog prices of 2 November 2026, and checks it against steps measured on one actual task. The method is written out at the end so you can redo it with your own numbers.

What is an agent step?

A step is one request from the agent to the model. It carries everything the agent has seen so far (system prompt, tool definitions, files it opened, command output) and gets back a short reply, usually a tool call. The next step sends all of that again, plus the new tool result.

So the input of a step is large and grows during a task, while the output stays small, and almost all of that input is the prefix the previous step already sent. That is the case a prompt cache is built for.

Our gateway logs give an average step for coding agents: 52,000 tokens of context, 90% of it a prefix the previous step sent, and about 330 tokens of output. Across agent sessions on our gateway, 79–92% of input tokens come from the cache.

The formula

step cost = cached tokens × cached price
          + new input tokens × input price
          + output tokens × output price

With the average profile on Qwen3.8 27B (qwen38: $1.05 input, $0.08 cached input, $3.15 output per million tokens):

46,800 × $0.08 / 1M  = $0.00374
 5,200 × $1.05 / 1M  = $0.00546
   330 × $3.15 / 1M  = $0.00104
                       --------
                       $0.0102 per step

On MiMo V2.6 Flash (mimo-v26-flash: $0.50 input, $0.20 cached input, $1.50 output) the same profile gives $0.0125.

How does the price change with context and cache rate?

One step, 330 tokens of output, catalog prices on 2 November 2026. Each cell is Qwen3.8 27B / MiMo V2.6 Flash:

Context No cache 80% cached 90% cached 97% cached
20,000 tokens $0.0220 / $0.0105 $0.0065 / $0.0057 $0.0046 / $0.0051 $0.0032 / $0.0047
52,000 tokens $0.0556 / $0.0265 $0.0153 / $0.0140 $0.0102 / $0.0125 $0.0067 / $0.0114
100,000 tokens $0.1060 / $0.0505 $0.0284 / $0.0265 $0.0187 / $0.0235 $0.0119 / $0.0214
200,000 tokens $0.2110 / $0.1005 $0.0558 / $0.0525 $0.0364 / $0.0465 $0.0229 / $0.0423

Read across a row and the cache matters more than the model: at 52,000 tokens, going from no cache to 90% cached cuts a Qwen3.8 27B step by a factor of 5.4. Read down a column and the cost grows with the context, which is why long sessions get expensive even when every step looks small.

Which of the two is cheaper per step?

It depends on the cache rate, and the crossover sits where agent sessions on our gateway actually run. MiMo V2.6 Flash has the lower fresh-input price, Qwen3.8 27B the lower cached price. At the 52,000-token profile the two cost the same per step when about 84% of the input is cached (between 82% and 86% across the context sizes in the table). Below that, MiMo V2.6 Flash is cheaper; above it, Qwen3.8 27B is.

Since agent sessions on our gateway land between 79% and 92%, the answer for your workload is in your own logs: look at the share of cached_tokens in the input before you pick a model for price.

The number of steps matters as much as the price of one. The two models are not the same: MiMo V2.6 Flash has a 1,048,576-token window, Qwen3.8 27B has 524,288, and they will not solve a task in the same number of steps.

What did one actual task cost?

We ran Claude Code (claude -p) through our API on an open issue, python-tabulate #460: fix the bug, add a regression test, run the test suite. One run per model, 31 October 2026:

qwen38 — Qwen3.8 27B mimo-v26-flash — MiMo V2.6 Flash
Steps 55 43
Cost of the task $0.39 $0.37
Cost per step $0.0071 $0.0086
Wall-clock time 4 min 42 s 2 min 48 s

On the Qwen3.8 27B run, 97% of input tokens came from the cache, so its measured step was cheaper than the 90% profile. MiMo V2.6 Flash cost more per step but needed 12 fewer steps, which made the task slightly cheaper. Both reached the same change as an open pull request on the issue; the full run, with its caveats, is in Run Claude Code on open models for about a cent a step.

Get an API key and check the numbers on your own agent: Qwen3.8 27B is free for 7 days, no card. After that you pay per token, and your first top-up gets $5 extra. Free requests run at lower priority at peak times.

How do you measure your own steps?

Every response from our API reports its usage, including the cached part of the input in the cached_tokens field, and every request shows up in the Logs page of the console. For one session, sum the input, cached and output tokens and count the requests: the cache rate is cached divided by input, and the cost per step is the formula above divided by the number of requests.

The cache rate drops, and the step price goes up, after compaction (/compact or an automatic one rewrites the history), after switching models (the cache belongs to a model) and after a change of system prompt or tools in the middle of a session.

What does the step price not tell you?

It does not rank models by quality. A cheaper step that needs twice as many steps costs more per task, and one run on one issue is an example, not a benchmark. Use the per-step number to compare setups for the same agent on the same model: cache rate, context limits, how often the agent compacts.

Method

  • Prices: our model catalog on 2 November 2026 (Qwen3.8 27B, MiMo V2.6 Flash). Both models run on GPUs we operate in the European Economic Area and do not store prompts or completions.
  • Step profile: averages from our gateway logs for coding-agent sessions: 52,000 tokens of context, 90% cached, 330 tokens of output. The 79–92% range is the share of cached input across agent sessions on the gateway.
  • Crossover: the cache rate at which the two step costs are equal, solved from the formula for each context size in the table.
  • Measured run: Claude Code in non-interactive mode against api.heabsy.com, the same prompt and checkout for both models, one run each on 31 October 2026; steps, tokens and cost counted from the gateway’s per-request records at catalog prices.

FAQ

How much does an AI coding agent cost per task?+
It is the price of one step times the number of steps. At our catalog prices on 2 November 2026, an average step costs $0.0102 on Qwen3.8 27B, so 100 steps come to about $1.02. On an open issue in python-tabulate, Claude Code took 55 steps on Qwen3.8 27B and $0.39 in total.
Why does cached input matter so much for agents?+
Because most of every request is context the agent already sent. At a 90% cache rate, 46,800 of the 52,000 input tokens in an average step are billed at the cached price. On Qwen3.8 27B that price is $0.08 per million tokens against $1.05 for fresh input, so the same step without the cache would cost $0.0556 instead of $0.0102.
Is MiMo V2.6 Flash cheaper per step than Qwen3.8 27B?+
Only when less than about 84% of the input comes from the cache. MiMo V2.6 Flash has the lower fresh-input price ($0.50 against $1.05 per million tokens), Qwen3.8 27B the lower cached price ($0.08 against $0.20). At the 52,000-token profile the two are equal at a cache rate of about 84%; above it Qwen3.8 27B is cheaper per step.
Do I have to turn prompt caching on?+
No. On the Heabsy API the cache works without any setting: when a request starts with the same tokens as an earlier one on the same model, that prefix is billed at the cached price. Every response reports the cached part in the cached_tokens field of its usage block.