# Model routing cost: how AI-SDLC bounds LLM spend
Source: https://ai-sdlc.io/guides/model-routing-cost

How routing cheap models to review probes and strong models to development, plus per-task and monthly budget caps, bounds LLM spend, with a worked end-to-end task cost.

Published 2026-10-20, last modified 2026-10-20. Prices checked 2026-10-20.

LLM spend in an autonomous pipeline is a design decision, not a surprise on the invoice. AI-SDLC bounds it two ways: a routing table that sends each agent role to the cheapest model that does the job, and cost limits that stop a run before it overspends. Prices on this page were checked on 2026-10-20; each figure links to the AI-SDLC doc it comes from and to the [vendor price page](https://www.anthropic.com/pricing).

## Why does model routing change the cost of an AI-driven SDLC?

Output tokens on the strongest model cost five times as much as on the mid-tier model, and the gap between the strongest and smallest tier is wider still. Using [the model pricing table in the cost reference](https://ai-sdlc.io/docs/api-reference/cost#modelpricingconfig), Opus is $15 per million input tokens and $75 per million output tokens, Sonnet is $3 and $15, and Haiku is $0.80 and $4. Rates are in USD per million tokens as of 2026-10-20; confirm them on the [vendor price page](https://www.anthropic.com/pricing) because providers change them often.

A pipeline that pins one strong model to every step pays the top rate for work that does not need it. Reading a diff for a style problem and designing a migration are not the same difficulty, yet a single pinned model charges for both at the same rate.

Routing fixes that by deciding the model per agent role instead of per pipeline. The [usage ledger and model routing](https://ai-sdlc.io/docs/concepts/usage-ledger-model-routing) page describes the routing table that maps each role to a model, so the expensive model is reserved for the roles where it earns its price.

The rest of this guide shows the numbers: which roles go where, what the caps are, and what one task costs from start to finish.

## Which models should handle development and which should handle review probes?

The routing table in [the model routing runbook](https://github.com/ai-sdlc-framework/ai-sdlc/blob/main/docs/operations/model-routing.md) is keyed by agent role and task class. Without a table, the defaults are Sonnet for the developer, code reviewer and test reviewer, and Opus for the security reviewer. A repository changes that only by committing a table to its base branch.

Review probes are the natural place to go cheaper. Each probe reads a diff and returns a verdict, which is a narrow job with a clear right answer, so a small model such as Haiku is a candidate. Development is open-ended and is where a stronger model most often pays for itself, so it keeps a stronger model until evidence says otherwise.

The security reviewer is the exception to cost pressure. The table is validated so that this role cannot be set to a model weaker than Opus, and it cannot be given cheaper candidates to explore. Cost pressure never lowers the floor on security review.

The table is read from the base branch only, so a pull request cannot route its own review to a cheaper model by editing the table in its own diff. See the [routing concept page](https://ai-sdlc.io/docs/concepts/usage-ledger-model-routing).

## How does AI-SDLC cap spend per task and per month?

The `costPolicy` field on a pipeline declares limits at three levels, documented in the [cost governance reference](https://ai-sdlc.io/docs/api-reference/cost). The first is a per-execution limit: a hard limit of $100 with the action `abort` stops the whole run once its running cost crosses that figure. The second is a per-stage limit: the reference example caps each stage at $15 and 100,000 tokens.

The third is a rolling budget for a team or namespace. The reference example sets $5,000 per month with alerts at 80 percent of the budget. The [cost governance tutorial](https://ai-sdlc.io/docs/tutorials/cost-governance) extends this with notify, require-approval and block alerts at 60, 80 and 100 percent.

These are circuit breakers, not dashboards. The orchestrator reads token counts from each model response and recomputes the running cost every 30 seconds or every N calls, so a looping agent is interrupted while it runs and not after the bill arrives. On abort, partial work is saved and the stage is marked failed.

Whichever ceiling trips first wins: tokens, wall-clock time or money. Start with the per-execution hard limit, which the tutorial calls the minimum cost governance worth shipping, then add per-stage and monthly limits as you learn what a normal run costs.

## What does one task cost end to end?

The example below is a worked illustration, not a benchmark. Token counts are assumptions chosen to be round; the prices are the per-million-token rates from [the model pricing table in the cost reference](https://ai-sdlc.io/docs/api-reference/cost#modelpricingconfig), dated 2026-10-20. Each line is calls times (input tokens times input rate plus output tokens times output rate), divided by one million.

The routed task puts development on Sonnet, three review probes on Haiku and the security review on Opus. The baseline runs the same work with every step on Opus. The table after this section gives each line.

Routed, the task costs $4.731. The all-Opus baseline costs $22.425. Routing saves 78.9 percent, and the security review costs the same in both cases because it never leaves Opus.

At the reference example's $5,000 monthly budget, 1056 routed tasks fit in a month against 222 baseline tasks. Both costs sit well under the $15 per-stage and $100 per-execution limits, so the caps act as a backstop for runaways rather than a constraint on normal work.

Token cost is also not the whole bill. The cost reference notes that a $2 token cost can sit beside $37.50 for 30 minutes of senior review time (see [CostReceipt](https://ai-sdlc.io/docs/api-reference/cost#costbreakdown)), so spending a little more on the first pass can be cheaper overall if it saves a human review round.

| Step | Model | Calls | Input tokens | Output tokens | Cost | All-Opus cost |
| --- | --- | --- | --- | --- | --- | --- |
| Development (one implementation run) | sonnet | 1 | 600000 | 40000 | $2.40 | $12.00 |
| Review probes (three cheap reviewers) | haiku | 3 | 150000 | 8000 | $0.456 | $8.55 |
| Security review (floor: strongest model) | opus | 1 | 100000 | 5000 | $1.875 | $1.875 |
| Total | | | | | $4.731 | $22.425 |

## How does the routing table learn which cheaper model is safe?

A cheaper model has to earn its place with evidence, and the [routing concept page](https://ai-sdlc.io/docs/concepts/usage-ledger-model-routing) describes two mechanisms. Deterministic exploration sends a configurable share of tasks to a cheaper candidate, chosen by a salted hash so the assignment is reproducible and cannot be gamed per task.

Offline reviewer replay runs a corpus of past reviews against candidate models off-peak, within a budget, and scores them against known outcomes. That gives a quality comparison without risking live work.

The ledger joins cost to outcomes the framework already records, such as review verdicts and iteration counts, producing a scorecard of quality and cost per role, model and task class. The table changes under an asymmetric rule: a cheaper model must show evidence to be adopted, while falling back to the stronger model needs none.

The practical effect is that you can answer whether a cheaper model could do a role with data instead of an opinion, and a mistaken downgrade is cheap to undo.

## How do you see and attribute what was spent?

Cost governance only works if spend can be traced. The usage ledger keeps one normalized record per model call: the model, five token counts, the agent role, the task and the billing pool. It reports usage per model, role, task and subscription window, as described on the [usage ledger page](https://ai-sdlc.io/docs/concepts/usage-ledger-model-routing).

The ledger stores only counts, ids and attribution. No prompt, response, file content or tool output is read into it, and it lives on the operator's machine outside any repository.

For attribution across a team, the `attribution` policy tags every cost data point with dimensions such as agent, model, stage, repository and team, and can allocate chargeback per repository, team or agent. See [AttributionPolicy](https://ai-sdlc.io/docs/api-reference/cost#attributionpolicy).

Each pull request the orchestrator produces carries a cost receipt in its provenance with total cost and an itemized breakdown. Over time those receipts answer what it costs to ship a feature at a given complexity, which is the figure to put in your own copy of the worked example above.
