Unit 05.04: Costing a plan before you run it
You can price a plan before building it, and the arithmetic usually changes the plan.
Which steps carry the cost
Six steps, split into agent and code, with tokens and seconds for each.
The table below totals them and prices a thousand runs.
step by tokens secs
classify the ticket agent 1,200 2.00
look up the invoice code 0 0.05
look up the contract code 0 0.05
compare the dates code 0 0.01
draft the reply agent 3,400 4.50
check the reply agent 2,100 3.00
TOTAL 6,700 9.61
$0.0201 per run, $20.10 per 1,000 runs
code steps: 3 of 6, contributing 0 tokens
Three of six steps are free and instant. The three agent steps carry the entire cost and nearly all the latency, which is the same shape you will find in almost any workflow of this kind.
That makes the useful question narrow: could any two of those three be one call? Merging the draft and the check into a single structured request is often possible and removes a third of the dominant term.
The mistake this prevents
The mistake is optimising the code steps because they are yours to change. They already contribute nothing. Time spent making a lookup faster is time not spent on the three steps that account for the whole bill.
Takeaway
Price the plan before building it, split by agent and code. The agent steps carry the cost, so the question worth asking is whether two of them could be one.
