Skip to content

Latest commit

 

History

History
63 lines (47 loc) · 1.75 KB

File metadata and controls

63 lines (47 loc) · 1.75 KB
title Set limits
description Set up alerts and hard caps on agent spending
icon shield-alert

What are limits?

Two types of rules you can set per agent:

  • Email Alert — Sends you an email when a threshold is hit.
  • Hard Limit — Returns HTTP 429 and stops requests once the threshold is hit.

You can also combine both on a single rule.

Creating a rule

Navigate to your agent's **Limits** page in the dashboard. Click **+ Create rule**. Pick a rule type (Email Alert, Hard Limit, or both), a metric (tokens or cost), a threshold, and a period (hour / day / week / month). Click **Create rule**. The rule takes effect immediately.

How blocking works

When a Hard Limit triggers, the next proxy request returns 429 Too Many Requests with a message:

Limit exceeded: cost usage ($X) exceeds $Y per day

The block resets at the start of the next period.

Email notifications

Alerts are sent to your account email. Make sure it is correct in your profile settings. Choose an email provider in the dashboard's **Limits** page. Supported providers:
- **Resend**
- **Mailgun**
- **SendGrid**

Click a provider card, enter your API key, domain, and notification email, then save. If no provider is configured, email alerts are skipped (Hard Limit rules still work).

Checking rules

  • Rules are evaluated hourly (cron) for notifications, and on every request for blocks.
  • A notification is sent once per rule per period to avoid spam.