Budgets
Control your AI spending with budget limits. Set daily, weekly, or monthly caps and choose what happens when limits are exceeded.
What Are Budgets?
Budgets are spending limits that prevent runaway costs. You can set limits per agent, per team, or globally. When a limit is reached, Fluxgate can block further runs, throttle them, or just send alerts.
Create a Budget
Create Budgetbash
curl -X POST http://localhost:8000/api/v1/budgets \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "production-agents-daily",
"agent_id": "AGENT_ID",
"period": "daily",
"limit_usd": 50.00,
"alert_threshold": 0.8,
"action_on_exceed": "block"
}'Actions on Exceed
| Action | Behavior | Recommended For |
|---|---|---|
| block | Stops all new runs until the period resets | Production with hard cost limits |
| throttle | Slows down runs and routes to cheaper models | Non-critical agents |
| alert_only | Sends alerts but allows runs to continue | Monitoring and awareness |
Check Usage
Check Budget Usagebash
# Check current usage vs limits
curl http://localhost:8000/api/v1/budgets/usage \
-H "Authorization: Bearer YOUR_API_KEY"
# View active alerts
curl http://localhost:8000/api/v1/budgets/alerts \
-H "Authorization: Bearer YOUR_API_KEY"Always set budgets for production!
Without budgets, a single malfunctioning agent can consume hundreds of dollars in minutes. Set daily limits before deploying any agent to production.
Best Practices
- Set alert thresholds at 80% so you get early warning
- Use "block" for production agents with hard limits
- Use "alert_only" during development to understand usage patterns
- Combine with Cost Optimizer for automatic model routing when approaching limits
- Review budget usage weekly in the Budget tab dashboard