> ## Documentation Index
> Fetch the complete documentation index at: https://docs.4casters.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 速率限制

> REST API 和訂單 API 的限制

## 按帳戶限制下單

下單按帳戶限制。REST 和 [訂單 API](https://docs.4casters.io/zh-Hant/pages/websocket/introduction.md) 共用一個額度。

> [!NOTE]
>
> 限制自 2026-10-26 起開始統計，自 **2026-11-02（週一）** 起強制執行。

| 等級 | 突發 | 持續 |
| - | - | - |
| 標準 | 200 筆訂單 | 每秒 20 筆 |
| 高階 | 2,000 筆訂單 | 每秒 150 筆 |

* 每筆訂單都計數。一批 50 筆訂單佔用 50。
* 空閒帳戶可一次性下滿突發額度，之後按持續速率下單。額度持續恢復。
* 放不下的批次整批拒絕，不佔用額度。
* 每批最多 1,000 筆訂單。
* 取消、改單和替換從不計數。

高階限制按帳戶設定。請聯絡客服申請。

[按引用取消](https://docs.4casters.io/zh-Hant/pages/rest/orders/cancel-by-reference.md) 和 `pauseOrders` 走按帳戶的佇列：每秒 15 筆取消，排隊超過 50 筆時回傳 `429`，全部取消進行中時回傳 `423`。其他取消不走該佇列。

### 超出限制

* **REST：** 回傳 `429`，帶 `Retry-After`（秒）：

```json theme={null}
{
  "error": {
    "message": "rate limited",
    "code": 429,
    "details": { "code": "rate_limited", "retryAfterMs": 350, "retryAfterSeconds": 1 }
  }
}
```

* **WebSocket：** 回傳 `error_type` `rate_limited`，帶 `retryAfterMs`。連線保持開啟。見 [下單錯誤](https://docs.4casters.io/zh-Hant/pages/websocket/place-order.md#error-responses)。

`retryAfterMs` 是批次可放下前需等待的時間。`-1` 表示永遠放不下，請拆分批次。被拒絕的請求不會被處理，可以安全重發。

## 按 IP 限制（REST）

每個 REST 請求都計數，包括取消：

| 限制 | 超出後 |
| - | - |
| 每 10 秒 1,500 次請求 | 視窗結束前回傳 `429` |
| 每 10 分鐘 100,000 次請求 | IP 被封禁 10 分鐘，24 小時內每次重複翻倍，最長 24 小時 |

兩者都回傳 `429`，帶 `Retry-After` 和 `{ "error": "Too many requests. Please try again later." }`。封禁期間重試不會縮短封禁。

WebSocket 訊息不計數，因此高頻用戶端應使用 [訂單 API WebSocket](https://docs.4casters.io/zh-Hant/pages/websocket/introduction.md)。

## 認證

登入、密碼重置和註冊有額外速率限制。

已登入的讀取請求僅受按 IP 限制。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.