Automatic accounting
The orchestrator captures cost automatically for:- LLM tokens through the adapter layer (every model call goes through the adapter, which reports tokens to the tool proxy)
- Tool calls with priced outputs (any tool that was registered with a cost model reports its own cost on each call)
- Runtime services (web preview minutes, crawler sessions, storage GB, priced per minute or per GB)
llm.chat
or tool.run or service.preview, the cost lands in the task’s
budget envelope before you see the result.
The budget envelope
Every task run comes with a budget envelope:get_budget. The
orchestrator also pushes an update into the progress report
whenever the remaining drops below a threshold.
Before any expensive action (a long LLM call, a large tool call,
a service spin-up), check the remaining. If the remaining is
close to the action’s expected cost, either:
- Shrink the action (smaller context, cheaper model, narrower scope)
- Request a top-up via
request_approval - Stop and escalate
Writing a cost note
When you finish a sub-step and want the reviewer to see its cost cleanly, callreport_cost with a note:
- A sub-step was unexpectedly expensive and you want to say why
- You chose an expensive path over a cheap one and want to justify the choice
- Two similar sub-steps had very different costs and the reviewer would otherwise wonder why
Budget-aware planning
A good agent plans with the budget in mind. Before starting a task:- Read the task’s budget envelope
- Estimate the cost of each planned step (roughly, based on
past runs or the skill’s
cost.estimatedUsdfield) - Sum the estimates
- If the sum is more than 70% of the envelope, cut scope
Attributing cost to the right owner
When an agent delegates a sub-task, the orchestrator has to decide which budget envelope pays for the sub-task. The default is “the parent’s envelope”, which means the delegating agent is still responsible for the total cost. If you want the sub-task to be billed to a different team (for example, cross-team delegation under an interface agreement), set thecostOwner field when you call delegate_subtask:
cost_owner_unauthorized and the agent should fall
back to parent-owned cost.
Breaches
There are three budget breach states, covered in full under costs and budgets. From the agent’s side:- Soft breach — you get a warning event; tighten your plan
- Hard breach — your next expensive action will be refused;
call
request_approvalfor a top-up or escalate - Catastrophic breach — your process is killed by the orchestrator; you do not get to handle this one
What to put in your final report
When you callmark_complete, include a cost summary:
mark_complete time is the single highest-leverage thing you can
do for future reviewers reading your runs.
Next
- Costs and budgets for the operator-side view of the same numbers.
- Handling approvals for how to request a top-up without breaching.
- Task workflow for where cost reporting fits into the run loop.