
Use case / Agent cost control
Find the run that spent the budget.
Agent bills grow from loops and oversized prompts, not from one big call. See cost for every run and every step, and the expensive one stands out.
- Cost
- Per step
- Loops
- Detected
- Limits
- Enforced

The failure to catch
One stuck run that spent a day of budget in an hour.
See cost per run, per step and per model, so a loop or an oversized prompt shows up before the bill does.
What Tracify watches.
Cost per run
Recorded on every run, so it can be searched, compared and alerted on.
Tokens per step
Recorded on every run, so it can be searched, compared and alerted on.
Loop detection
Recorded on every run, so it can be searched, compared and alerted on.
Budget limits
Recorded on every run, so it can be searched, compared and alerted on.
Spend breakdown
Where the budget went.
Cost is recorded on each step, not only on the whole run.
Tokens and price are shown next to the call that spent them.
Repeated calls are the loop, counted and priced.
Budget ceilings can stop a run, and the stop is part of the trace.
Sort by cost to find the runs worth fixing first.
- 01ok
Run starts
Support agent, production, release 2.14.
- 02ok
Step costs add up
Each model call is priced as it finishes.
- 03runaway
Loop begins
The same tool is called 14 times in a row.
- 04runaway
Budget limit hit
The run passes its daily cost ceiling.
- 05ok
Run stopped
The agent is stopped and the run is flagged.
Instrument it
Price every step as it runs.
Model calls already carry their token cost. Wrap the steps around them and the trace adds up where the money went.
$ npm install tracify-sdk
import { span, traceAgent } from "tracify-sdk";
export const work = traceAgent(async (task: string) => {
const plan = await span("plan", () => callModel(task), { type: "llm", input: task });
return span("act", () => runTools(plan), { type: "tool" });
}, { environment: "production", release: "2.14" });