BurnGuard can post a message to a Slack channel or Discord server the moment your AI spend crosses a budget threshold. This lets your team react before costs spiral — whether that means a Slack ping to an on-call engineer, a Discord notification in a shared dev server, or both at once.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Verifieddanny/BurnGuard/llms.txt
Use this file to discover all available pages before exploring further.
How Alerts Work
After every successful request, BurnGuard callsalerter.Check() with the current total spend and your configured budget limit. The alerter compares the spend ratio against each configured threshold and fires any that have not yet been triggered in this session.
Key behaviours to understand before you configure:
- Each threshold fires once per proxy session. The
triggeredmap in memory tracks which thresholds have already fired. Restarting BurnGuard resets the map. - Alert delivery is non-blocking. The HTTP POST to your webhook runs in a background goroutine so your application never waits for an alert to be delivered.
- Slack and Discord can both be active at the same time. Configure either, both, or neither — BurnGuard skips any webhook whose URL is an empty string.
- Alert message format:
BurnGuard: Budget 80% used ($40.0000 of $50.0000)
Setting Up Slack
Create an incoming webhook
Open your Slack workspace and navigate to Apps → Manage → Incoming
Webhooks (or visit
api.slack.com/messaging/webhooks
directly). Click Add New Webhook to Workspace, choose the channel where
alerts should appear, and click Allow.
Copy the webhook URL
After authorizing, Slack shows a webhook URL in the format:Copy the full URL including all three path segments.
Setting Up Discord
Open your server's webhook settings
In your Discord server, go to Server Settings → Integrations → Webhooks
and click New Webhook.
Configure and copy the webhook URL
Give the webhook a name (for example, “BurnGuard”), choose the channel where
alerts should be posted, and click Copy Webhook URL. The URL will look
like:
If
slack_webhook or discord_webhook is an empty string (or missing from
your config), BurnGuard skips that destination entirely — no error is logged
and no placeholder message is sent. You can safely configure only one of the
two.Configuring Thresholds
Thealerts.thresholds list controls which spend ratios trigger an alert. Each value is a decimal fraction of your total budget (0.5 = 50%, 1.0 = 100%).
The default thresholds generated by burnguard init are:
burnguard.yaml:
