If you are a founder deciding whether to let an agent ship features, "how much will this cost" is a fair question that almost never gets a straight answer. The honest one is: it depends, but not on anything mysterious. It depends on a few levers you can see and control, and you can get a usable estimate in an afternoon.
Here is how to reason about it without hand-waving.
Start from public prices
Frontier model pricing is published, and the shape matters more than the exact numbers, because the numbers move. As of mid-2026, Anthropic's per-million-token rates look roughly like this (always check the current rates before you quote them):
- Opus 4.8: about $5 input, $25 output
- Sonnet 5: about $3 input, $15 output
- Haiku 4.5: about $1 input, $5 output
Two things jump out. Output costs roughly five times input across the board, so verbose agents are expensive agents. And the gap between the cheapest and most capable model is large, which is the first lever.
A feature is many small runs, not one big call
The instinct is to imagine one giant prompt. In reality, shipping a single unit of work is a sequence of smaller runs: a planning step, a few implement-and-test iterations, a check that the work meets its acceptance criteria, and usually a review pass. Your cost is the sum of those runs, and iterations dominate. A change that lands in one pass is cheap; one that needs five rounds of fixing is not.
This is why a flat "cost per feature" number is misleading. A trivial change and a gnarly refactor differ by more than an order of magnitude, and they should.
The four levers that actually move the bill
Once you see it as a sequence of runs, the ways to reduce cost become obvious:
1. Right model for each step. Not every step needs your best model. Planning and hard implementation can justify a top-tier model; routine checks and judgments can run on the cheapest one. Matching model to step, rather than using one model for everything, is often the single biggest saving, because you stop paying premium rates for grunt work.
2. Cache the stable prefix. If every run re-sends the same large block of context, you pay for those tokens every time. Prompt caching charges the repeated prefix at a steep discount, often around a tenth of the normal input rate. When your context is large and stable, this is close to free money.
3. Batch the work that is not urgent. Anything that does not need an immediate answer, background analysis, offline checks, can run through a batch path that is typically half price. Latency-insensitive work is a straight discount you are leaving on the table if you run it hot.
4. Cap the iterations. Most of the tail cost is an agent grinding on a task it is not going to finish. A hard limit on iterations and spend, with an escalation to a human when it hits the cap, converts a runaway bill into a bounded one.
Forecast from real runs, not from theory
You can estimate token math on paper, but the estimate will be wrong, because real repositories are messier than your model of them. The better move is empirical: run a representative sample of real work, measure what each unit actually cost, and extrapolate from that. Your first week of real usage is a better forecasting tool than any spreadsheet built before you started. Treat a-priori token math as a sanity check, not a quote.
The honest limitation
None of this gives you a fixed price per feature, and anyone who promises one is selling you an average that will not survive contact with your codebase. What you get instead is a bounded, explainable estimate: a range, the levers behind it, and the ability to tighten it as you gather real data.
That framing is deliberate in how we built Loopsfinity: you bring your own model account, so inference is billed to you directly at these public rates with no markup, and the levers above are yours to set. We would rather give you an honest range you control than a round number you cannot verify. For a decision as real as "should an agent ship my features," that is the only kind of cost answer worth trusting. The wider view, and the levers above in depth, is in the economics of AI coding agents.