Recipes
Set a per-agent budget cap
Cap daily or monthly spend per agent and decide what happens when the cap hits.
Set a per-agent budget cap
Cap an agent's spend per day, week, or month. Decide whether to alert-only or hard-block when the cap hits.
The goal
A budget that fails loud and (optionally) refuses new turns when the cap is exceeded. The cap covers all four cost lanes (model, embeddings, extraction, judge).
Steps
Open the budgets page.
Sidebar -> Budgets (
/agent-budgets).New cap.
Click "New cap":
- Agent: pick or "All agents" for env-wide.
- Period:
daily,weekly,monthly. - Cap (cents): e.g.
5000= $50/day. - Soft warn (cents): e.g.
4000= warn at $40. - Hard cap: on (block) or off (alert only).
Save.
The cap is active immediately. The agent header shows a pill with "X% used today".
Wire alerts (optional).
Subscribe a webhook to
budget.soft_warnandbudget.exceeded. Tie to your alerting channel.
Verify
- The agent's header shows the budget pill.
- Crossing the soft warn produces a
budget.soft_warnwebhook. - Crossing the cap produces a
budget.exceededwebhook; with hard cap on, the next turn returnsBUDGET_CAP_EXCEEDEDplus the reset time.
Bypass during incident
await platos.platos_call("budgets.override", {
capId,
bypassUntil: new Date(Date.now() + 60 * 60 * 1000).toISOString(),
reason: "P0 incident workaround",
});
Logged in audit.
Next steps
- Debug a sudden cost spike to find what blew the cap.
- Cap restricted to specific lanes: in the cap settings, set
lanesto e.g.["model_inference"]to leave embeddings unmetered.
