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

# 外掛套件

> 通過 ARouter 外掛程式擴展任何模型的能力。透過 plugins 陣列啟用網頁搜尋、上下文壓縮、自動路由等功能。

Plugins 可以擴展任何模型的能力。在請求本文中傳遞 `plugins` 陣列以啟動一個或多個外掛程式。

## 可用外掛程式

### `web` — 網頁搜尋

用即時網路資料支撐回應。適用於任何模型。

| 選項                | 類型         | 描述                                   |
| ----------------- | ---------- | ------------------------------------ |
| `max_results`     | `number`   | 要擷取的結果數量（預設：5）                       |
| `engine`          | `string`   | 搜尋引擎：`"native"`、`"exa"`、`"parallel"` |
| `include_domains` | `string[]` | 將結果限制在這些網域                           |
| `exclude_domains` | `string[]` | 排除這些網域的結果                            |

### `context-compression` — 上下文視窗管理

自動壓縮超出模型上下文視窗的提示詞。

| 選項        | 類型        | 描述             |
| --------- | --------- | -------------- |
| `enabled` | `boolean` | 設為 `false` 以停用 |

### `auto-router` — 可設定的自動路由

自訂 `auto` 路由器可以從哪些模型中進行選擇。

| 選項               | 類型         | 描述                       |
| ---------------- | ---------- | ------------------------ |
| `allowed_models` | `string[]` | 限制 `auto` 可以選擇的模型的萬用字元模式 |

## 外掛程式執行順序

1. **context-compression** — 如有需要，輸入會被壓縮
2. **web** — 搜尋結果被擷取並注入
3. **auto-router** — 模型選擇發生（如果 `model: "auto"`）
4. 請求被轉發到所選模型

## 定價

| 外掛程式                  | 附加費用            |
| --------------------- | --------------- |
| `context-compression` | 免費              |
| `web`（Exa 引擎）         | 每 1,000 條結果 \$4 |
| `web`（Parallel 引擎）    | 每 1,000 條結果 \$4 |
| `web`（Native 引擎）      | 提供商直通（按實際費率）    |
| `auto-router`         | 免費              |
