Blog / 2026-11-18
2026-11-18ai agents cost control local ai model routing

Cost per task, not cost per token

From a $10 month on DeepSeek to a free local coder that cost time, to the night my most expensive model was the only seat left open, and why cost per task is the number I now compare models by.

Flat cartoon seen from my desk: three small robots hold up their invoices, one with a single dollar sign, one with two, and one with a long page of dollar signs unrolling across the desk
Flat cartoon seen from my desk: three small robots hold up their invoices, one with a single dollar sign, one with two, and one with a long page of dollar signs unrolling across the desk

My first year with AI agents, I compared models by the number on the price page: dollars per million tokens. It took three stages and one bad night to learn that the number I actually pay is a different one: what a model costs to finish a task, including the runs that finish nothing.

Stage one: the $10 month

When I first saw DeepSeek's API prices, I got excited. In July their Flash model cost $0.14 per million input tokens, $0.0028 when the input was already cached, and $0.28 per million output tokens, at any hour. My coding agents ran on it, and the real work cost me about $10 a month. I thought I had found the trick.

Then the pricing scheme changed. From 16 August DeepSeek split the day into peak and off-peak hours. Off-peak, Flash output went to $0.66 per million, more than double; at peak every rate doubles again, so output cost $1.32. A September release cut the Flash rates back a little ($0.60 off-peak, $1.20 at peak today), but output is still more than twice the July price.

The peak window is 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays. In Toronto in winter that is 8 to 11 in the evening and 1 to 5 in the morning, which is exactly when my agents do their work. The $10 month was over.

I had also put $40 of credit on OpenRouter to try other models. This morning the balance read $40.11 used, a few cents into debt, and the free variants I was counting on kept leaving the roster.

Stage two: the free coder, which cost time

So I went free. A Qwen model runs on one 16 GB card in my own rack, and the API price per token is zero.

Free per token is not free per task. The card holds one model at a time (15,529 MiB of it was in use when I checked this morning) and the engine answers one request at a time, so a heavy card can hold the lane for an hour while the rest of the queue waits. Yesterday the local coder started 15 runs and merged one change; across all seats the pipeline started 65 runs and merged 8. On the free lane, the bill arrives as time and as runs that end in a failed test.

Stage three: the night the expensive seat ran alone

My architect seat runs on Claude Opus, the most expensive model I use. Its last four recorded runs report $1.53, $1.64, $1.88 and $2.00 at API list prices, an average of $1.76 per card.

On 13 November my two Google seats, which shared one subscription, ran out of quota 16 minutes apart, at 03:01 and 03:17. The routing sent architect work from the Google seats to Opus as the last fallback, so Opus became the only seat open, and between about 05:00 and 06:30 it wrote specs for 23 cards until it hit its own usage limit. Nothing stopped it, because nothing in the design was built to: an open queue feeding the most expensive model in the house, at night, while I slept.

Cost per token versus cost per task

Cost per token is what the price page shows. Cost per task is what you pay: the tokens of every attempt, the retries, the runs that end in a failed gate, and the hours a slow lane holds the queue. On that measure the ranking moves. A cheap token can be an expensive task when it takes five attempts, and the free model is only cheap when it lands the change.

So I now ask one question of every seat: what does a merged change cost here, counting everything it took to get one?

The limits live in the job

I never set a monthly spending cap. The limits are structure around the models, not inside them:

  • A spec queue capped at 8 items, and 4 spec rounds that rotate across architect seats. - Backoff waits of 60, 180 and 360 minutes before a card is retried, and a 30-minute rest for a seat whose run changes nothing. - Size caps on cards, 150, 400 and 800 lines by size class, so no single job grows into a spending event. - A quota ladder per model, so when one model caps out the seat moves to a sibling model with its own quota instead of draining a shared one. - A seat that reports a usage limit is closed until its reset time instead of retrying into a closed door. - Gates that are not models: the pipeline commits, checks the diff, runs the tests and merges. A model's own report of success is never the evidence.

The rule I keep

The cheapest model that passes the tests wins, and "cheapest" means per task, not per token. Free local first, low-cost seats second, and the expensive model for architecture, review and the cases the cheaper seats already failed. Model choice is arithmetic, and the budget belongs in the design of the job.

Part of the daily AI-journey series: published here Mon-Sat alongside the LinkedIn edition, this version carries the fuller detail.