> ## 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` 配列を渡して、1つ以上のプラグインを有効にしてください。

## 利用可能なプラグイン

### `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`         | 無料              |
