New Tool Radar

AI Agents & Automation

How to Track Agent Spend per Task and Alert When the Budget Is Near

Track what the agent spends per task and alert before the budget runs out, so the overspend is caught in time to act.

Schematic illustration with three step boxes: record spend per task, set the alert level, and act on the alert.

Tracking spend per task turns a surprise invoice into a daily number: how much each task type costs, which ones are drifting up, and when the monthly budget will run out at the current rate. The alert is the part that makes the tracking useful: a budget nobody watches is a budget that gets exceeded quietly.

Before you start

A way to record cost per run with its task type, and a place to send alerts, such as an email or a message.

Record the spend per task, every run

For each run, record the task type, the model, the token counts and the cost. Keep the record in a table you can sum by task type and by day.

Do not average across task types: a research task and a lookup have different costs, and one average hides both.

Set the alert level before the budget

Set the alert at 80 percent of the budget for the period, not at 100 percent: an alert at 100 percent arrives after the money is spent. Set a second alert at the task level, for any single run that costs more than three times the normal for its type.

Send the alert to a person who can act on it, not to a channel nobody reads.

Act on the alert the same day

When the alert fires, check which task type is over budget and why: a new model, a longer context, a retry loop, or more volume. Fix the cause, not the alert.

If the volume grew, raise the budget deliberately and record why. If the cost per task grew, fix the task.

Practice check: fictional Maple Corner agent, November budget $100

The table below is fictional practice material, worked out by hand from the stated spend. It is the expected result for the practice month, not a real invoice.

Task type Runs Spend Share Verdict
Lookups 400 $28.00 28% On track
Summaries 120 $36.00 36% On track
Research 30 $24.00 24% Watch – costly per run
Total so far 550 $88.00 88% Alert fired at 80%

Spend reaches $88 of the $100 budget, so the 80 percent alert fired at $80. Research tasks are the costly ones at $0.80 per run, and they are the first place to look.

Expected result. UNTESTED: the spend figures in the practice table are worked out by hand, not measured by running an agent. Record your own spend per task type for a week, set the alert at 80 percent of the budget, and act on it the same day it fires.

Limits

  • An alert at 100 percent of the budget is a report, not a warning: set it at 80 percent.
  • Track spend per task type: one average across all tasks hides the expensive ones.

Sources

See all