← Back to Agent

Agent Budget

Monitor token usage, set spending caps, and manage budget alerts for this agent.

Contents

Overview

For Everyone

AI agents cost money — every message, every tool call, every API request uses tokens that translate to real dollars. The Budget tab is your financial dashboard. It shows how much the agent has spent today and this month, lets you set spending caps so the agent can't run up a surprise bill, and alerts you when spending approaches your limits.

For Developers

Three endpoints power this section:

Saving: PUT /agents/:id/budget with { dailyTokens, dailyCost, monthlyTokens, monthlyCost }. Acknowledging alerts: POST /budget/alerts/:id/acknowledge.

How It Works

  1. Load — Usage, budget config, and alerts are fetched in parallel on mount.
  2. Monitor — The stats grid shows six key metrics. Progress bars visualize usage against limits.
  3. Configure — Click "Edit Budget" to set daily and monthly limits for both tokens and cost.
  4. Alert — When usage approaches or exceeds limits, alerts appear in the alerts table. Acknowledge them to clear the notification.
  5. Enforce — When a limit is reached, the agent is automatically paused to prevent overspending.

Key Concepts

Usage Statistics

Six stat cards provide real-time usage data:

MetricDescription
Tokens TodayTotal tokens consumed today (input + output). Resets at midnight UTC.
Tokens This MonthTotal tokens consumed this calendar month.
Cost TodayDollar cost of today's token usage.
Cost This MonthDollar cost of this month's token usage.
Sessions TodayNumber of agent sessions started today.
Errors TodayNumber of errors today. Shown in red if > 0.

Budget Limits

Four configurable spending caps:

When any limit is reached, the agent is automatically paused. It requires a manual resume or limit increase to continue.

Progress Bars

When budget limits are configured, progress bars visualize current usage against each limit. The bars show:

Only configured limits (non-zero) are displayed.

Budget Alerts

The system generates alerts at different thresholds:

Alert TypeTriggerImpact
WarningUsage reaches ~80% of limitNotification only. Agent continues.
CriticalUsage reaches ~95% of limitNotification. Consider pausing non-essential work.
ExceededLimit reachedAgent automatically paused. Requires intervention.

Each alert shows:

Best Practices

Troubleshooting

Agent paused due to budget but usage seems low

Check which specific limit was hit — it may be the daily limit that's too low, not the monthly. Also verify the budget type (tokens vs. cost). Some models use many tokens but are cheap per-token.

Budget not saving

Ensure all values are valid numbers. The API expects numeric values for all four fields. Zero means no limit. Check the console for error messages from the PUT request.

Alerts not appearing

Alerts are generated server-side when usage crosses thresholds. If no limits are configured, no alerts will be generated. Also check that the budget alerting system is enabled at the organization level.

Usage numbers seem wrong

Usage is aggregated server-side and may have a slight delay. Token counts include both input and output tokens. Cost calculations depend on the model's pricing. Refresh the page for the latest data.

Organization Context

When an agent belongs to a client organization, budget management integrates with org-level allocations:

What happens if the org budget cap is lower than the agent's limit?

The organization budget cap takes precedence. Even if an agent's individual limit is higher, the agent will be paused when the org-wide cap is reached.

AgenticMail Enterprise Documentation Report an issue