<!-- source: https://modelux.ai/docs/concepts/webhooks -->

> Event-driven integrations via webhooks.

# Webhooks

Webhooks let you react to Modelux events in your own infrastructure: budget
alerts, config changes, provider health transitions, request anomalies.

## Event types

- `budget.threshold_reached`
- `budget.exceeded`
- `routing_config.updated`
- `routing_config.created`
- `routing_config.deleted`
- `provider.health_changed`
- `api_key.revoked`
- `request.anomaly_detected`

## Endpoint setup

1. Open **Integrations -> Webhooks** in the dashboard.
2. Click **Add endpoint**. Enter the destination URL.
3. Select which event types to subscribe to.
4. Modelux generates a signing secret. Save it to verify incoming payloads.

## Signature verification

Every delivery includes an `X-Modelux-Signature` header with an HMAC-SHA256
of the raw body using your signing secret.

```javascript
import crypto from "crypto";

function verify(body, signature, secret) {
  const expected = crypto
    .createHmac("sha256", secret)
    .update(body)
    .digest("hex");
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected),
  );
}
```

## Delivery & retries

- Deliveries run asynchronously through a durable queue
- On non-2xx response or timeout: retried with exponential backoff up to 24h
- The dashboard shows per-delivery status, payload, response body, and a
  replay button for manual redelivery

## Slack-compatible format

Set the endpoint URL to a Slack webhook URL. Modelux detects it and formats
the payload as a Slack message automatically.
