{"article":{"title":"Alerts","breadcrumb":["Operations","Alerts"],"body":"**What this solves**: Get notified when there's spend, request volume, a channel failure, or a DLP hit — and confirm the notification actually arrived, instead of stopping at \"saved successfully\".\n\nAlert configuration has to do two things at once: **rules** and **delivery channels**. Configure only half and you have no alerts.\n\n### Setup order\n\n1. Open **Alerts**.\n2. Choose an account-level rule, or configure an exception rule for a specific key.\n3. Set the threshold, action, and enabled state.\n4. Configure a delivery channel: Webhook or Feishu / Lark.\n5. **After saving, verify delivery**: check the recent notification log and confirm the target group or Webhook actually received the message.\n\n> [!WARNING]\n> Don't take \"saved successfully\" as \"alerts will be delivered\". The Feishu signing secret, bot permissions, and clock skew can all cause you to miss messages, and most of these failures are silent.\n\n### How to think about account-level vs. key-level\n\nAccount-level rules cover all keys that don't have their own configuration. When a key has its own rule, it overrides the account default. This lets you set a separate budget for a production key without repeating the configuration on every key.\n\n### Rule types\n\nConsole → **Alerts**. Rules monitor spend, error rate, and channel failures; the channel decides where notifications go.\n\nEach rule is resolved by (account, key), most specific wins: a rule set on a key overrides one set on the whole account, and an account-level one overrides the platform default.\n\n| `ruleType` | What it monitors | Default action | Scope |\n|---|---|---|---|\n| `HIGH_FREQUENCY` | Requests per minute for a single key: model, provisioning, or reconciliation key | `BLOCK` | Per key |\n| `HIGH_FREQUENCY_ACCOUNT` | Total model requests per minute for the whole account | `BLOCK` | Account |\n| `MONTHLY_BUDGET` | Monthly budget consumption, at the 50% / 80% / 100% tiers | `NOTIFY` | Account |\n| `LOW_BALANCE` | How many days you can last at the current burn rate, not a fixed balance figure | `NOTIFY` | Account |\n| `UPSTREAM_CHANNEL_DOWN` | A channel is circuit-broken or recovered, or keeps rejecting requests other channels serve | `NOTIFY` | Account |\n| `UPSTREAM_ALL_DOWN` | All candidate channels for a model are unavailable and requests are being rejected | `NOTIFY` | Account |\n| `DLP_DETECTED` | A request contains sensitive content you set to \"alert\" on the Security page; the request is forwarded unchanged | `NOTIFY` | Account |\n| `NODE_OFFLINE` | One of your local nodes has had its tunnel down for 3 minutes, or has reconnected after that | `NOTIFY` | Account |\n| `PROVIDER_ARREARS` | One of your channels' upstream accounts is out of credit (the upstream says so: in arrears, insufficient balance, HTTP 402) | `NOTIFY` | Account or channel |\n| `PROVIDER_ACCOUNT_BANNED` | One of your channels' upstream accounts is disabled, suspended, or refuses every request with an empty answer | `NOTIFY` | Account or channel |\n| `PROVIDER_STREAM_ERRORS` | One of your channels keeps cutting streams off with an error after output has started: 5 times in 10 minutes by default | `NOTIFY` | Account or channel |\n\n- `MONTHLY_BUDGET` counts everything you spend through Tare, including what you pay your own upstream on BYOK.\n- `LOW_BALANCE` only covers traffic Tare bills (platform models).\n- `UPSTREAM_CHANNEL_DOWN` is a heads-up: traffic fails over to the next candidate, unless it was the only channel for that model. You also get it when a channel rejects a request with a 4xx three times within an hour and the same request then succeeds on another channel. That channel is not paused, but each of those requests took an extra round trip. The notification carries the upstream's error message; usually the channel rejects a particular field or input type, so either add a parameter rule for it or remove it from that model's route. `UPSTREAM_ALL_DOWN` is an outage: calls to that model are refused with `503`.\n- `HIGH_FREQUENCY_ACCOUNT` is for fleets of child keys that each stay under the per-key limit but add up.\n- The three `PROVIDER_*` rules name the cause instead of the symptom, and fire once per channel, not once per model: an account that runs out of credit stops every model on it, and you get one notification that says to top it up. Out of credit and banned fire on the first occurrence and then stay quiet for 6 hours; error frames fire when the count reaches the threshold. They are on by default and only cover your own channels. You can switch any of them off for a single channel, see below.\n- An upstream that answers `200` but refuses before writing a single word counts as a failed attempt, and the request moves to the next channel on the route. If every channel refuses, you get the last refusal unchanged (`finish_reason: \"content_filter\"`): then it is the request content, not the channel.\n- A rule with no threshold and no platform default stays silent until you set a value.\n\n> [!WARNING]\n> **`BLOCK` exists only on these two `HIGH_FREQUENCY*` types, and only you can loosen it.**\n> All other rules default to `NOTIFY`: a spend or availability alert shouldn't block your own traffic the first time it fires.\n> `HIGH_FREQUENCY` is the platform's own request-rate guardrail, and it's in effect as `BLOCK` by default; you can raise the threshold or change it to\n> `NOTIFY` (see [Rate limits and quotas](limits)), but it never starts out looser than this.\n\n### Configuring a rule\n\n- `GET /v1/alerts/rules?apiKeyId=`: each rule type, whether it's configured, and if so the currently effective threshold/action/severity/channel. Omit `apiKeyId` for the account-level view.\n- `PUT /v1/alerts/rules`: create or update one, located by (`ruleType`, `apiKeyId`). Fields: `threshold`, `windowSeconds`, `action`, `severity` (`INFO`/`WARNING`/`CRITICAL`), `channels` (comma-separated channel names, see below; empty means send to all channels you've configured), `silenceSeconds`, `enabled`.\n- `DELETE /v1/alerts/rules/{id}`: delete your override, falling back to the account or platform default — not turning the whole rule off.\n- `GET /v1/alerts/rules/overrides`: which keys carry a rule different from the account default. Per-key exceptions are completely invisible in the account-level view; this is the only place to see them.\n- `PROVIDER_*` rules can also be set for one channel: add `providerId` (the channel's id) to `PUT /v1/alerts/rules`, without `apiKeyId`. `GET /v1/alerts/rules/providers` lists them. Order of precedence: this channel's rule, then your account rule, then the platform default. In the console this is the \"Provider alerts by channel\" table on the Alerts page.\n\n### Delivery channels\n\n| Channel | Target |\n|---|---|\n| **Webhook** | Any URL; Tare sends JSON via POST |\n| **Feishu / Lark** | Group bot webhook, with optional signature verification. Lark bots use the same format: paste the `open.larksuite.com` address here |\n| **WeCom** | Group robot webhook: `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=…`. The key in the address is the credential |\n\nSaving **replaces all channels**; any left empty are deleted. Existing targets are shown masked and can't be edited in place: the webhook URL is itself a credential and the platform doesn't return it.\n\n### Webhook payload\n\n```json\n{\n  \"msg_type\": \"text\",\n  \"content\": { \"text\": \"Monthly budget 80% used\\n\\n...\" },\n  \"rule_type\": \"MONTHLY_BUDGET\",\n  \"severity\": \"WARNING\",\n  \"title\": \"Monthly budget 80% used\",\n  \"text\": \"...\",\n  \"triggered_at\": \"2026-11-20T21:51:36\",\n  \"api_key_id\": 2051,\n  \"api_key_name\": \"customer-42\",\n  \"external_id\": \"cus_42\",\n  \"issuer_key_id\": 17,\n  \"issuer_key_name\": \"partner-master\"\n}\n```\n\n| Field | Meaning |\n|---|---|\n| `msg_type`, `content` | The shape Feishu / Lark group bots accept, so the same URL works there |\n| `rule_type` | One of the rule types above |\n| `severity` | `INFO`, `WARNING` or `CRITICAL` |\n| `title`, `text` | The notification in plain text |\n| `triggered_at` | When the rule fired, ISO 8601 without a time-zone offset |\n| `api_key_id`, `api_key_name` | The key the alert is about |\n| `external_id` | The `external_id` you gave the key when you created it with a [provisioning key](provisioning) |\n| `issuer_key_id`, `issuer_key_name` | The provisioning key that issued it |\n\nThe five key fields are `null` for account-wide alerts (budget, balance, channel and node alerts), and the issuer fields are `null` for a key you created yourself. If you issue one child key per customer, `external_id` tells you which customer an alert is for. The key itself is never sent.\n\n### Troubleshooting when alerts don't arrive\n\n![Alert not delivered: signing, clock, and delivery channel](diagram:en-alerts-silent-failure)\n\n### Feishu signature verification\n\nFill in the signing secret when the group bot has \"signature verification\" enabled; leave it empty when it's off.\n\n> [!WARNING]\n> Getting it wrong is **silent**. A bot with verification on **rejects** unsigned messages, and the reason stays on the Feishu side,\n> so the platform only sees an error code and you receive no alert. The platform also can't probe whether the other side has it on: a bot with\n> verification **off** also accepts signed messages. Only you can confirm the state of this switch.\n\nFeishu also only accepts timestamps within an hour of its own clock, so clock skew has exactly the same symptom as a wrong secret.\n\n### There is no platform-level fallback channel\n\nWhen no channel is configured, the alert is recorded as \"send failed\" and stays in that state; it is **not** forwarded to the platform. Your alert content shouldn't be forwarded through the platform — that would be a data leak, not a fallback.\n\n### Next steps\n\n- Raise or loosen rate limit thresholds: read [Rate limits and quotas](limits).\n- Make DLP hits trigger a notification: read [Data protection (DLP)](security).\n- See the full error code comparison: read [Error codes](errors).\n- Unfamiliar term: check the [glossary](glossary).\n"},"diagrams":{"en-alerts-silent-failure":"<svg viewBox=\"0 0 700 484\" width=\"700\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\">\n  <title>Alert missed: signature, clock, channel</title>\n  <desc>Four checks when an alert never arrives: the signing secret, container clock drift, the bot's signature setting, and whether any delivery channel exists. Most of these failures are silent.</desc>\n  <style>\n    text { font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }\n  </style>\n  <defs>\n    <marker id=\"arrow\" markerWidth=\"8\" markerHeight=\"8\" refX=\"2\" refY=\"4\" orient=\"auto\" markerUnits=\"userSpaceOnUse\">\n      <path d=\"M0,0 L8,4 L0,8 L2,4 z\" fill=\"#64748b\"/>\n    </marker>\n  </defs>\n\n  <!-- 浅色画布 -->\n  <rect x=\"0\" y=\"0\" width=\"700\" height=\"484\" fill=\"#ffffff\"/>\n\n  <!-- 版式算术：\n       这是「多条原因归到同一个后果」的归集图，不是鱼骨图——鱼骨图的骨刺是斜线，\n       而本包禁止对角线连线（斜插 / 直角折弯都不合格），硬画会过不了 svg-lint。\n       归集图把同一件事画成同一件事：四条原因横着汇入右侧那一个后果，连线全水平。\n       左列四条原因 22..442（宽 420），高 54，顶边 60 / 142 / 224 / 306，底边 114 / 196 / 278 / 360。\n       右列后果框 470..678（宽 208），从 60 通到 414，正好盖住四条原因的中心高度，\n       四条箭头因此都落在它的左边线上；列间距 470 - 442 = 28。\n       内容左右边界 22..678，中心 350；viewBox 宽 = 656 + 两侧各 22 = 700。\n       高度 = 脚注末行基线 459 + 下伸 2.5 + 22px 边距 = 483.5，取整 484。 -->\n\n  <text x=\"350\" y=\"34\" font-size=\"16\" fill=\"#1e293b\" text-anchor=\"middle\">Alert missed: signature, clock, channel</text>\n\n  <!-- 第 1 层：连线。起点 = 原因框右边 + 5 = 447，终点 = 后果框左边 - 11 = 459，留 12px 可见线。 -->\n  <path d=\"M447,87 L 459,87\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow)\"/>\n  <path d=\"M447,169 L 459,169\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow)\"/>\n  <path d=\"M447,251 L 459,251\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow)\"/>\n  <path d=\"M447,333 L 459,333\" fill=\"none\" stroke=\"#64748b\" stroke-width=\"1.5\" marker-end=\"url(#arrow)\"/>\n\n  <!-- 第 2 层：四条原因（蓝，都是配置事实）与一个后果（粉，全图唯一的强调色）。 -->\n  <rect x=\"22\" y=\"60\" width=\"420\" height=\"54\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"232\" y=\"82\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">Wrong signing secret</text>\n  <text x=\"232\" y=\"100\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">Signature checks reject unsigned messages. Feishu keeps the reason.</text>\n\n  <rect x=\"22\" y=\"142\" width=\"420\" height=\"54\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"232\" y=\"164\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">Container clock drift</text>\n  <text x=\"232\" y=\"182\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">Feishu allows one hour of clock skew. Same symptom as a bad secret.</text>\n\n  <rect x=\"22\" y=\"224\" width=\"420\" height=\"54\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"232\" y=\"246\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">Bot signature check not confirmed</text>\n  <text x=\"232\" y=\"264\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">The platform cannot detect this. You check the switch and the secret.</text>\n\n  <rect x=\"22\" y=\"306\" width=\"420\" height=\"54\" rx=\"6\" fill=\"#dbeafe\" stroke=\"#3b82f6\"/>\n  <text x=\"232\" y=\"328\" font-size=\"12\" fill=\"#1e40af\" text-anchor=\"middle\">No delivery channel set</text>\n  <text x=\"232\" y=\"346\" font-size=\"10\" fill=\"#1e40af\" text-anchor=\"middle\">The alert stays at send failed and is not passed to the platform.</text>\n\n  <!-- 后果框：竖着贯通四条原因的中心高度，文字居中在 197 / 215 / 230。 -->\n  <rect x=\"470\" y=\"60\" width=\"208\" height=\"354\" rx=\"6\" fill=\"#fce7f3\" stroke=\"#ec4899\"/>\n  <text x=\"574\" y=\"224\" font-size=\"12\" fill=\"#9d174d\" text-anchor=\"middle\">You get no alert</text>\n  <text x=\"574\" y=\"242\" font-size=\"10\" fill=\"#9d174d\" text-anchor=\"middle\">Most of these failures are silent</text>\n  <text x=\"574\" y=\"257\" font-size=\"10\" fill=\"#9d174d\" text-anchor=\"middle\">Only you can confirm the switch</text>\n\n  <!-- 脚注 -->\n  <text x=\"350\" y=\"444\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">Saved is not delivered. A rule and a channel are two halves. One half alone is no alert.</text>\n  <text x=\"350\" y=\"459\" font-size=\"10\" fill=\"#64748b\" text-anchor=\"middle\">After saving, check recent notifications and confirm the group or Webhook got the message.</text>\n</svg>\n"}}