# AI spend alerts: LLM budgets, spikes and Slack alerts

Use three layers. Provider spend limits are the hard backstop. A gateway or a cap on calls per task stops a runaway agent loop within minutes. Budgets per team, feature or customer, plus spike rules sent to Slack or on-call, warn everyone else. Tools that read billing data can warn but cannot block requests.

**Key takeaways**

- Only something in the request path, such as a gateway or a call cap in agent code, can stop a loop while it runs.
- Provider hard limits on OpenAI projects and Anthropic workspaces are free and should be on before anything else.
- Projected month-end spend = spend to date + recent daily average x days remaining; alert on it, not only on 100% of budget.
- Send each alert to the person who can act: on-call for limits, the feature team for spikes, the account owner for customer allowances.

Published 2026-11-18, updated 2026-11-29, by AI Spendbook. Web page: https://www.aispendbook.com/blog/ai-spend-alerts-budgets

The classic AI spend incident is an agent that calls itself in a loop overnight, or a batch job that retries on every error. The invoice shows it a month later. A good alert setup catches it the same day and makes sure the right person hears about it, in the channel they actually read.

## Which AI spend alert catches a runaway agent loop in time?

| Layer | What it can do | How fast | What it sees |
| --- | --- | --- | --- |
| Provider spend limits | Notify at an amount; with a hard limit, reject requests | Close to real time, with some lag | One provider account, project or workspace |
| Gateway or proxy budgets | Block requests per key, team, user or customer | Per request | Only traffic routed through the gateway |
| Hourly spike rules on request telemetry | Warn in chat, on-call or email | Each time the checker runs | Every route that sends request events, by customer and feature |
| Budgets on billing data | Warn and forecast overruns | Daily, after billing data arrives | Every provider, split by team, feature or customer |

*Each layer trades speed for coverage. Most teams need more than one.*

No single layer covers everything. A provider limit cannot tell which customer caused the spike. A [gateway](https://www.aispendbook.com/glossary/ai-gateway) cannot see traffic that bypasses it. A daily budget is too slow to stop a loop. Most teams use all of them.

## Layer 1: provider limits and notifications

- **OpenAI:** monthly spend limits for the organization and for each project. With "Enforce a hard limit" on, requests over the limit fail with a 429 error; without it, you get spend alerts only. OpenAI notes that enforcement is not instantaneous, so recorded spend can slightly exceed the limit.
- **Anthropic:** a monthly spend limit per workspace in the Claude Console, and, if Anthropic bills you directly, email notifications when spending reaches an amount you choose. Organization limits always apply, even when workspace limits add up to more.

Set one project or workspace per product and environment, so a limit on the staging workspace cannot take production down and a notification names the product that caused it. These controls are free and should be on before anything else.

## Layer 2: a gateway when you must stop a loop

If a runaway loop must be stopped within minutes, the check has to sit in the request path. Gateways such as LiteLLM track spend per key, user, team and customer and can reject requests once a budget is exceeded. The cost they use is calculated from tokens and a price list, not billed, which is fine for a limit. A simpler option inside your own code is a cap on calls per task or per conversation: an agent that may make at most 30 model calls per task cannot loop all night. The [gateway, SDK and OpenTelemetry guide](https://www.aispendbook.com/blog/llm-cost-tracking-gateway-sdk-opentelemetry) compares the ways to put a check in the request path.

A gateway can also ask a reporting tool whether a budget is already spent. AI Spendbook has a budget status endpoint for this (`GET /api/v1/budgets/gateway-status` with a read key): it returns each budget's limit, spend, share used and a state of `ok`, `warn` or `over`, cached for 30 seconds. Blocking or throttling stays the gateway's decision.

## How do I set budget alerts for LLM spend per team or project?

Budgets on billing data answer a different question: are we on track for the month, and who is not? Set a monthly amount per scope and alert at fixed shares of it. A common default is 50%, 80% and 100%, plus an alert when the projected month-end total will exceed the budget.

```
projected month-end spend = spend to date + average daily spend of recent days x days remaining
```

Illustrative numbers: the support team's budget is $6,000 for a 30-day month. After 12 days it has spent $3,100, and the last seven days averaged $310 a day. Projected month-end spend is $3,100 + $310 x 18 = $8,680. The 50% alert has already fired, and the forecast alert fires now, 18 days before the overrun, while there is still time to act. The same arithmetic drives the [LLM cost forecast](https://www.aispendbook.com/blog/forecast-llm-costs), just over a longer horizon.

- **Per team or project:** tag requests with a project, or use one provider project or workspace per team.
- **Per feature:** tag requests with a feature name. This is the scope that finds the agent that got expensive.
- **Per customer:** tag requests with a customer id. A budget at the size of the customer's included allowance tells customer success before the customer exceeds it. The [deal pricing guide](https://www.aispendbook.com/blog/price-ai-saas-deal) covers how to set that allowance.

## How do I get a Slack alert when an agent loop makes LLM spend spike?

Budgets only fire against a number someone set. Spike detection compares spend with recent history instead, and it needs data faster than a provider bill. Two rules cover most cases:

- **Hourly rule on request telemetry:** compare the last complete hour of estimated request cost with the average hour of the previous 24, for the whole workspace and for each customer and feature. Flag it when it is more than three times the average and above a floor such as $5, so quiet hours do not page anyone.
- **Daily rule on billed spend:** flag a provider's day when spend is more than three standard deviations above the mean of the previous 28 days, ignoring tiny amounts. Add a week-over-week rule for slower growth, such as the last seven days more than 50% above the seven before.

Then send the alert where the owner will see it. Slack and Microsoft Teams take an incoming webhook URL; PagerDuty and Opsgenie take an integration key so a spike can page on-call; a signed webhook lets you route it anywhere else. Keep the message specific: the scope, the hour, the amount and the average it was compared with.

### Worked example: does this hour trigger the spike rule?

| Scope | Previous 24 hours | Average hour | Last hour | Multiple | Above $5? | Alert? |
| --- | --- | --- | --- | --- | --- | --- |
| Feature: research-agent | $96.00 | $96.00 / 24 = $4.00 | $14.50 | $14.50 / $4.00 = 3.6x | Yes | Yes: above 3x and above the floor |
| Feature: autocomplete | $12.00 | $12.00 / 24 = $0.50 | $1.80 | $1.80 / $0.50 = 3.6x | No | No: the floor keeps a quiet feature from paging |
| Customer: acme | $240.00 | $240.00 / 24 = $10.00 | $26.00 | $26.00 / $10.00 = 2.6x | Yes | No: below 3x |

*Illustrative numbers. Rule: last complete hour above 3x the average of the previous 24 hours and at least $5.*

The multiple catches the jump; the floor stops small numbers from crying wolf. If the research agent keeps running at $14.50 an hour, the average rises over the next day and the alert stops on its own, which is why a spike rule never replaces a budget for spend that is high but steady.

### Step by step: a Slack alert for spend spikes

1. In Slack, create an app with an incoming webhook for the channel that should get alerts, such as #ai-spend. Slack posts only to the channel chosen at this step.
2. In AI Spendbook, open Budgets, card "Where alerts go", add a Slack channel and paste the webhook URL. It is stored encrypted and never shown again.
3. Click "Send test" and check the message arrived; the card records whether delivery worked and why not.
4. Under "Workspace rules", pick that channel for "Hourly spike" (and for unusual spend or sync failures if you want them there too).
5. For each budget, pick channels under "Also send to", so a team's budget posts in that team's channel.

## Who should receive an AI spend alert?

- **Provider limit reached:** the engineer on call, because production may be failing.
- **Spike on a feature:** the team that owns the feature, with the feature and model named in the message.
- **Budget forecast overrun:** the budget owner and finance.
- **Customer near their allowance:** the account owner in customer success.

Send fewer, better alerts. One alert per budget threshold per month, and one per spike per hour, is enough. An alert that fires every day is ignored by the second week.

## What is the cheapest way to get a daily Slack alert when OpenAI spend spikes?

1. Turn on provider notifications and a hard limit above your worst plausible month on every production project or workspace. Free.
2. Cap model calls per task in any agent code. Free.
3. Connect a tool that reads every provider's billing, add budgets per team and feature with threshold and forecast alerts, and point the spike rules at a Slack incoming webhook. AI Spendbook's [plans and pricing](https://www.aispendbook.com/pricing) list what each plan includes.

## What are the common mistakes with AI spend alerts?

- **Alerting only at 100% of budget.** By then the money is spent. Alert on the forecast and at 50% and 80% too.
- **One shared limit for staging and production.** A test job that hits the limit takes production down with it. Use one project or workspace per environment.
- **Expecting a billing-data alert to stop a loop.** It can only warn, and usually hours later. Put a gateway budget or a call cap in front of anything that can loop.
- **Alerts nobody owns.** An alert to a shared inbox is read by no one. Name an owner per budget and per customer.
- **No floor on spike rules.** A feature that goes from $0.20 to $1 an hour is a 5x spike and not worth a page.

## When is a budget alert the wrong tool?

When the cost must not happen at all, an alert is too late: use a hard limit or a gateway rule that rejects the request. When spend is tiny or flat, a monthly review of the [LLM spend management routine](https://www.aispendbook.com/blog/llm-spend-management) costs less attention than alerts. And when nobody is named to act on an alert, fix ownership first; more alerts will not help.

## What AI Spendbook does, and does not do

AI Spendbook has budgets scoped to a provider, model, feature, customer, project or category, with thresholds you choose (50%, 80% and 100% by default) and a month-end forecast alert. Workspace rules add an hourly spike rule on telemetry (3x the average of the hours with spend in the previous 23 and at least $5 by default, per workspace, customer and feature; alerts go out at the next scheduled run, daily on the hosted plan today), the daily three-standard-deviation rule, week-over-week growth, failed syncs and missing billing data. Customer contracts add allowance alerts at 80% and 100% of the included usage.

Alerts appear in the app and are emailed to owners and admins. Each budget and rule can also post to Slack, Microsoft Teams, PagerDuty, Opsgenie or a signed webhook, set up on the Budgets page ([alert channels docs](https://www.aispendbook.com/docs/alert-channels)). A customer can have an account owner who also gets that customer's alerts. Checks run each time the scheduler runs: the hosted service currently runs it once a day, and a deployment on Cloud Scheduler can run it hourly. AI Spendbook never sits in the request path, so it does not block requests; see [budgets and alerts](https://www.aispendbook.com/docs/budgets-and-alerts) for the full rules.

## Sources

- [OpenAI spend limits guide](https://developers.openai.com/api/docs/guides/spend-limits): organization and project limits, hard limits and spend alerts.
- [Anthropic workspaces documentation](https://platform.claude.com/docs/en/manage-claude/workspaces): workspace spend limits and email notifications.
- [LiteLLM spend tracking](https://docs.litellm.ai/docs/proxy/cost_tracking) and [budgets](https://docs.litellm.ai/docs/proxy/users): spend per key, user, team and customer.
- [Slack incoming webhooks](https://api.slack.com/messaging/webhooks): posting a message to a channel from a URL.

## Frequently asked questions

### Can AI Spendbook block LLM requests when a budget runs out?

No. AI Spendbook reads billing and request data and never sits in the request path. A gateway can read its budget status endpoint and decide to block or throttle; provider hard limits are the other way to stop requests.

### How do I check that an AI spend alert webhook really came from AI Spendbook?

Each webhook request carries a timestamp and a v1 signature header. Compute HMAC-SHA256 with the signing secret over the timestamp, a dot and the raw body, compare it in constant time, and reject timestamps older than five minutes.

### Why do hourly LLM spike alerts use estimates instead of the provider bill?

Provider cost reports arrive hours or days late, too late to flag a loop the same hour. Hourly rules price request telemetry from the SDK, HTTP ingestion or OpenTelemetry instead, and billed spend is compared later in the daily rules.

### Who gets the alert when one customer's AI spend spikes?

The rule's own recipients and channels, plus the customer's account owner when one is set: their email, and their Slack or Teams channel with an optional member mention. Each scope alerts at most once per hour.
