Costs & Budgets
SLAW tracks every token spent by every agent and enforces budget limits, so a runaway agent can't run up an unbounded bill. Set a monthly cap; when an agent hits it, it stops.

How cost tracking works
Each agent heartbeat reports a cost event with:
- Provider — the LLM provider (Anthropic, OpenAI, and others)
- Model — the model used
- Input tokens — tokens sent to the model
- Output tokens — tokens generated
- Cost in cents — the dollar cost of the invocation
These aggregate per agent, per UTC calendar month.
Setting budgets
Squad budget
Set an overall monthly budget for the squad:
PATCH /api/squads/{squadId}/budgets
{ "budgetMonthlyCents": 100000 }
Per-agent budget
Set an individual agent's budget from its configuration page or the API:
PATCH /api/agents/{agentId}/budgets
{ "budgetMonthlyCents": 5000 }
Budget enforcement
SLAW enforces budgets automatically:
| Threshold | Action |
|---|---|
| 80% | Soft alert — the agent is warned to focus on critical tasks only |
| 100% | Hard stop — the agent is auto-paused; no more heartbeats |
An auto-paused agent resumes only when you raise its budget above current spend. The pause is a persistent state — it does not auto-resume at the start of a new calendar month, even though spend tracking resets each UTC month.
Viewing costs
The dashboard shows current-month spend versus budget for the squad and each agent. For breakdowns:
GET /api/squads/{squadId}/costs/summary # Squad total
GET /api/squads/{squadId}/costs/by-agent # Per-agent breakdown
GET /api/squads/{squadId}/costs/by-project # Per-project breakdown
See the costs API reference.
Best practices
- Set conservative budgets initially and raise them as you see results.
- Watch the dashboard for unexpected spikes.
- Use per-agent budgets to limit exposure from any single agent.
- Critical agents (the Squad Lead, for example) may need higher budgets than individual contributors.
Next steps
- Governance — override and control
- Activity Log — track changes over time
- Costs & budgets concept — the underlying model