Docs/Features/Budget & Alerts

Budgets & Alerts

Set spending limits per API key, team, or organization. Get alerted before you overspend.

Per-Key Budget

Set a daily cost limit on any API key. When the limit is reached, requests are either blocked or routed to cheaper models.

// API key settings
{
  "costLimitDaily": 10.00,
  "routingStrategy": "balanced",
  "qualityThreshold": 0.85
}

Alert Thresholds

Configure when you get notified:

ThresholdAction
50%Info notification (Slack/email)
75%Warning — consider aggressive routing
90%Critical — auto-enable cost-saving mode
100%Budget exceeded — block or force cheapest model

Predictive Forecasting

CostLens tracks your burn rate and projects when you'll hit budget limits:

  • Current burn rate ($/hour)
  • Projected daily/monthly spend
  • Time until budget exhaustion
  • Recommendations to stay within budget

Kill Switch

When a budget alert fires, CostLens sends a one-click pause link that immediately stops all requests for that API key. Available via Slack and email.

Email Kill Link

Budget alert emails include a signed pause link. Click it to instantly pause the key for 30 minutes.

  • Link expires after 15 minutes (security)
  • Multiple recipients supported — configure in Settings → Alerts
  • Your account email is always included
  • Key auto-resumes after 30 minutes, or resume early from Settings → API Keys

Slack Kill Switch

If Slack is connected, alert messages include a "Pause" button. Requires Slack interactivity to be configured. See Slack docs.

Security

  • Slack requests verified via HMAC-SHA256 signature
  • Email links use time-limited signed tokens
  • All pause actions logged in audit trail
  • Unauthenticated requests are rejected (401)

Organization Budgets

Org admins can set budgets at multiple levels:

  • Organization-wide — total monthly cap across all teams
  • Per-team — allocate budget to each team
  • Per-key — granular control per service/environment