> For the complete documentation index, see [llms.txt](https://docs.blockchainsecurity.asia/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blockchainsecurity.asia/documentation/api-can-kao/limits.md).

# 限制與配額

下列為平台層級限制與方案型額度。固定限制適用於所有 API key；RPS、Burst 與 Credit 配額則依方案設定而定。

## 分頁

| 項目         | 值                        |
| ---------- | ------------------------ |
| `limit` 預設 | 20                       |
| `limit` 上限 | 1000                     |
| 超過上限       | 回 `400 bad_request`（不截斷） |

## 限流與方案配額

| 項目    | 說明                          |
| ----- | --------------------------- |
| 維度    | 每 API key + 端點              |
| RPS   | 每秒請求數，依方案                   |
| Burst | 突發容量，依方案                    |
| 超量行為  | `reject`（回 429）或 `wait`（排隊） |

詳見[限流](/documentation/he-xin-gai-nian/rate-limiting.md)。

## Credit 計費

| 項目   | 說明                                            |
| ---- | --------------------------------------------- |
| 計費時機 | 僅成功回應（HTTP 2xx）扣 Credit                       |
| 餘額不足 | 回 `402 insufficient_credit`                   |
| 每月配額 | 依方案 `monthly_credit_quota`                    |
| 餘額回傳 | 成功回應會帶 `X-Credit-Cost` 與 `X-Credit-Remaining` |

## 輸入欄位限制

| 欄位                   | 限制                                     |
| -------------------- | -------------------------------------- |
| Webhook `target_url` | 須以 `http://` 或 `https://` 開頭，長度 ≤ 2048 |
| Webhook `event_type` | 1–64 字元                                |
| `X-Request-Id`（自帶）   | ≤ 128 字元，僅限英數、`-`、`_`                  |

## 請求限制

| 項目     | 說明                                                  |
| ------ | --------------------------------------------------- |
| 請求逾時   | 超過處理時間上限時，回 HTTP `408`（此回應由基礎設施層產生，不帶 `{error}` 信封） |
| 請求主體大小 | 超過大小上限時，回 HTTP `413`（同上，不帶 `{error}` 信封）            |

{% hint style="info" %}
逾時與主體大小上限可依部署環境設定，正式環境的實際值請洽你的客戶經理。
{% endhint %}
