Skip to main content

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.

The alert config endpoints manage the webhook URLs and threshold flags that BurnGuard Cloud uses to send spend notifications. Whenever the proxy syncs usage records via POST /v1/usage, the server evaluates the current total spend against the configured monthly budget. If spend crosses the 50%, 80%, or 100% threshold — and the corresponding flag is enabled — BurnGuard fires an HTTP POST to the configured Slack and/or Discord webhook with a formatted alert message. Alert configuration is stored in the cloud and managed via the dashboard settings page. The proxy itself reads alert configuration from burnguard.yaml for local in-process alerting; the cloud config is the authoritative source for the server-side webhook dispatch described above.
If no alert config exists for your account yet, GET /v1/alerts/config returns an empty-webhook config with all three threshold flags set to true as a safe default. The first PUT call persists your actual configuration.

GET /v1/alerts/config

Returns the current alert configuration for the authenticated user. Auth: Requires session — Authorization: Bearer session_<id>. Request: No parameters or body. Response:
slack_webhook
string
Slack incoming webhook URL. Empty string if not configured.
discord_webhook
string
Discord webhook URL. Empty string if not configured.
threshold_50
boolean
Whether to fire an alert when spend reaches 50% of the monthly budget.
threshold_80
boolean
Whether to fire an alert when spend reaches 80% of the monthly budget.
threshold_100
boolean
Whether to fire an alert when spend reaches 100% (or more) of the monthly budget.
id
number
Internal numeric ID of this alert config record. Omitted when no config exists yet (the default response is returned as a plain object without an id).
created_at
string
ISO 8601 timestamp of when this config was first created. Omitted in the default response.
updated_at
string
ISO 8601 timestamp of the last update. Omitted in the default response.
curl https://api.burnguard.run/v1/alerts/config \
  -H "Authorization: Bearer session_abc123"
{
  "data": {
    "id": 7,
    "user_id": 42,
    "slack_webhook": "https://hooks.slack.com/services/T00/B00/xxxx",
    "discord_webhook": "https://discord.com/api/webhooks/1234/xxxx",
    "threshold_50": true,
    "threshold_80": true,
    "threshold_100": true,
    "created_at": "2025-01-10T09:00:00Z",
    "updated_at": "2025-01-18T16:22:10Z"
  }
}
When no config has been saved yet, the response omits id, user_id, created_at, and updated_at and returns only the five webhook/threshold fields with empty strings and all thresholds set to true. After the first PUT, the full object including timestamps is returned on subsequent GET calls.

PUT /v1/alerts/config

Creates or replaces the alert configuration for the authenticated user. All fields are required in the request body — send the full config object, including any fields you are not changing. Auth: Requires session — Authorization: Bearer session_<id>. Request body:
slack_webhook
string
required
Slack incoming webhook URL. Set to an empty string ("") to disable Slack notifications.
discord_webhook
string
required
Discord webhook URL. Set to an empty string ("") to disable Discord notifications.
threshold_50
boolean
required
Set to true to receive an alert when cumulative spend reaches 50% of your monthly budget.
threshold_80
boolean
required
Set to true to receive an alert when cumulative spend reaches 80% of your monthly budget.
threshold_100
boolean
required
Set to true to receive an alert when cumulative spend reaches or exceeds 100% of your monthly budget.
Response: 200 OK — the updated AlertConfig object.
slack_webhook
string
The stored Slack webhook URL.
discord_webhook
string
The stored Discord webhook URL.
threshold_50
boolean
Stored 50% threshold flag.
threshold_80
boolean
Stored 80% threshold flag.
threshold_100
boolean
Stored 100% threshold flag.
id
number
Internal numeric ID of the alert config record.
created_at
string
ISO 8601 timestamp of when this config was first created.
updated_at
string
ISO 8601 timestamp of the last update.
curl -X PUT https://api.burnguard.run/v1/alerts/config \
  -H "Authorization: Bearer session_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "slack_webhook": "https://hooks.slack.com/services/T00/B00/xxxx",
    "discord_webhook": "",
    "threshold_50": false,
    "threshold_80": true,
    "threshold_100": true
  }'
{
  "data": {
    "slack_webhook": "https://hooks.slack.com/services/T00/B00/xxxx",
    "discord_webhook": "",
    "threshold_50": false,
    "threshold_80": true,
    "threshold_100": true
  }
}
Alert thresholds are evaluated at sync time, not on a schedule. If your proxy syncs infrequently, an alert for a crossed threshold may be delayed until the next sync batch is uploaded. To receive timely alerts, configure the proxy to sync at a short interval.
To obtain a Slack webhook URL, go to api.slack.com/apps → Your App → Incoming Webhooks → Add New Webhook to Workspace. For Discord, go to your server’s Channel Settings → Integrations → Webhooks → New Webhook.

Build docs developers (and LLMs) love