Home / Guides / Cutting AI agent costs by routing each step to a cheaper model

Cutting AI agent costs by routing each step to a cheaper model

An agent does many different jobs in one run, and most of them do not need the most expensive model. Sending each step to a model sized for it can lower the total bill.

By Piotr Olszewski · Oct 22, 2026 · prices as of Oct 22, 2026

The cheapest way to cut an agent's bill is to stop sending every step to your strongest model. In my measurements, classification, invoice extraction and SQL steps cost a fraction of a cent on budget models, while code review is the one step where a premium model is easier to justify. The rule below sends simple steps to a cheap model and only the hard step to a stronger one.

Why one model for every step is expensive

An agent makes many small calls, and most do not need deep reasoning. My modeled agent scenario assumes an 8,000-token system prompt, 50 steps, 1,500 extra context tokens per step and 300 visible output tokens per step. Every step is billed at the chosen model's rate.

Here is the modeled 50-step run when one model handles every step:

Model50-step agent cost per runPer 1,000 runs
GPT-6 Luna4.1¢$40.71
Claude Haiku 5.56.6¢$66.35
GPT-5.4 Mini32¢$321.83
Claude Opus 5.5$1.68$1,683.28
GPT-6 Astra$3.72$3,721.00

These figures are modeled, not measured, so treat them as a planning baseline. The median across all 334 models is 48¢ per run. The gap between the top and bottom rows is why routing matters. See the ai-agent-50-steps task page for the full table.

The three cheap steps

Classifying tickets, extracting invoice data and writing SQL are short, structured tasks. Costs per task, with the per-1,000 figure in brackets:

ModelClassify 100 ticketsExtract invoiceWrite SQL
GPT-6 Luna0.06¢ ($0.64)0.03¢ ($0.32)0.04¢ ($0.40)
Claude Haiku 5.50.09¢ ($0.92)0.06¢ ($0.64)0.08¢ ($0.84)
GPT-5.4 Mini0.56¢ ($5.60)0.28¢ ($2.81)0.36¢ ($3.61)
Claude Opus 5.51.8¢ ($17.81)2.1¢ ($20.60)2.2¢ ($21.87)
GPT-6 Astra3.9¢ ($38.56)2.6¢ ($26.23)2.4¢ ($24.21)

The median of all 334 models is 0.68¢ for classification, 0.24¢ for invoice extraction and 0.23¢ for SQL.

Three points stand out:

  • GPT-6 Luna and Claude Haiku 5.5 are well below the median on all three tasks, and Luna is the cheaper of the two on each.
  • GPT-5.4 Mini is above the median on all three, so it is not the cheap-step pick here.
  • Luna and Haiku were measured. Opus 5.5, GPT-6 Astra and GPT-5.4 Mini are estimated, so the gap is a price-based estimate. I did not test whether the premium models produce better labels or fields.

These are one run per task with default settings. Details are on the pages for classifying support tickets, extracting invoice data and writing SQL.

The hard step: code review

Reviewing 500 lines of code shows a wider spread:

ModelCode review (500 lines)
GPT-6 Luna0.31¢ ($3.08 per 1,000)
Claude Haiku 5.50.66¢ ($6.61 per 1,000)
GPT-5.4 Mini2.7¢ ($27.08 per 1,000)
Claude Sonnet 5.58.0¢ ($79.66 per 1,000)
Claude Opus 5.516¢ ($159.33 per 1,000)
GPT-6 Astra24¢ ($244.47 per 1,000)

The median across all 334 models is 1.3¢. Claude Opus 5.5 scores 1508 on LMArena Text, the highest of the models in this comparison. Claude Sonnet 5.5 scores 1475 and GPT-6 Astra 1477. That is a general chat score, not a code review benchmark, so it is a hint, not proof.

Some cheap models hit the 16,000-token output cap on this task, including GLM 5.3 Flash and Qwen3.8 Flash. Their low per-task costs reflect truncated runs, so read them with care. See the code review task page.

The routing rule

The rule I would use:

  • Classification, invoice extraction and SQL go to GPT-6 Luna, with Claude Haiku 5.5 as the fallback.
  • Code review goes to Claude Sonnet 5.5 by default, and to Claude Opus 5.5 when review quality matters more than cost.
  • Any other step goes to the cheapest model that passes your own tests on that step.

A fixed mapping from step type to model is easy to write, test and audit. You decide which steps are hard before the run starts.

What the savings look like

I did not measure a full 50-step run that mixes models, so I cannot give a verified total for a routed agent. What my data supports is the per-step difference and the range.

Moving the cheap steps from Opus 5.5 to GPT-6 Luna changes the per-task cost like this:

  • Classification: 1.8¢ to 0.06¢
  • Invoice extraction: 2.1¢ to 0.03¢
  • SQL: 2.2¢ to 0.04¢

At the run level, the modeled all-Opus agent costs $1,683.28 per 1,000 runs and the modeled all-Haiku agent costs $66.35. A routed run should land between those two, closer to the cheap end the more of your steps are simple. Check that against your own step mix.

Caveats

  • The 50-step agent figures are modeled. The other rows are measured or estimated, as labeled on each task page.
  • Prices are list prices as of 2026-10-22, in USD. Check the official pricing page before you budget.
  • One run per task is a thin sample. Test on your own inputs.
  • Routing adds engineering work, and a router that picks the wrong model can cost more in rework than it saves in tokens.

To estimate your own run, use the calculator. For how I measure, see the methodology.

FAQ

Is routing worth it if my agent only has a few steps?

Probably not for a short run, since the saving comes from steps you move off the premium model. Count your simple steps first. If most steps are simple, routing usually pays off.

Why not use the cheapest model for code review too?

Cheap models vary most on this task, and some hit the 16,000-token output cap in my runs. Test a cheap option on your own code before trusting it for review.

Will these prices stay the same?

No. These are list prices as of 2026-10-22, and providers change them. Re-check the official pricing pages before you commit to a routing setup.

Sources