> ## 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.

# モデル

> Models API を使用して利用可能なモデルを照会し、機能を比較し、モデルのメタデータを閲覧できます。

ARouter は、単一の統合 API を通じて主要プロバイダーの何百ものモデルへのアクセスを提供します。[ARouter ウェブサイト](https://arouter.ai/models) でモデルを閲覧するか、API を直接使用できます。

## クエリパラメータ

Models API はクエリパラメータによる結果のフィルタリングをサポートしています。

### `output_modalities`

出力能力でモデルをフィルタリングします。カンマ区切りのモダリティリスト、または `"all"` を指定してすべてのモデルを含めます。

| 値            | 説明                             |
| ------------ | ------------------------------ |
| `text`       | テキスト出力を生成するモデル（デフォルト）          |
| `image`      | 画像を生成するモデル                     |
| `audio`      | 音声出力を生成するモデル                   |
| `embeddings` | 埋め込みモデル                        |
| `all`        | すべてのモデルを含める（モダリティフィルタリングをスキップ） |

```bash theme={null}
# デフォルト — テキストモデルのみ
curl "https://api.arouter.ai/v1/models" \
  -H "Authorization: Bearer lr_live_xxxx"

# 画像生成モデルのみ
curl "https://api.arouter.ai/v1/models?output_modalities=image" \
  -H "Authorization: Bearer lr_live_xxxx"

# テキストと画像モデル
curl "https://api.arouter.ai/v1/models?output_modalities=text,image" \
  -H "Authorization: Bearer lr_live_xxxx"

# モダリティに関係なくすべてのモデル
curl "https://api.arouter.ai/v1/models?output_modalities=all" \
  -H "Authorization: Bearer lr_live_xxxx"
```

### `supported_parameters`

サポートする API パラメータでモデルをフィルタリングします。例えば、ツール呼び出しをサポートするモデルを検索する場合：

```bash theme={null}
curl "https://api.arouter.ai/v1/models?supported_parameters=tools" \
  -H "Authorization: Bearer lr_live_xxxx"
```

## モデル一覧

```
GET /v1/models
```

API key で利用可能なモデルの完全なリストを返します。

```bash theme={null}
curl https://api.arouter.ai/v1/models \
  -H "Authorization: Bearer lr_live_xxxx"
```

### レスポンス形式

```json theme={null}
{
  "data": [
    {
      "id": "openai/gpt-5.4",
      "canonical_slug": "openai/gpt-5.4",
      "name": "GPT-5.4",
      "created": 1748000000,
      "description": "OpenAI's flagship multimodal model with state-of-the-art performance.",
      "context_length": 128000,
      "architecture": {
        "input_modalities": ["text", "image"],
        "output_modalities": ["text"],
        "tokenizer": "cl100k_base",
        "instruct_type": "chatml"
      },
      "pricing": {
        "prompt": "0.000005",
        "completion": "0.000015",
        "request": "0",
        "image": "0.00765",
        "web_search": "0",
        "internal_reasoning": "0",
        "input_cache_read": "0.0000025",
        "input_cache_write": "0.000005"
      },
      "top_provider": {
        "context_length": 128000,
        "max_completion_tokens": 16384,
        "is_moderated": true
      },
      "supported_parameters": [
        "tools",
        "tool_choice",
        "max_tokens",
        "temperature",
        "top_p",
        "structured_outputs",
        "response_format",
        "stop",
        "frequency_penalty",
        "presence_penalty",
        "seed"
      ],
      "per_request_limits": null,
      "default_parameters": null,
      "expiration_date": null
    }
  ]
}
```

## モデルオブジェクトスキーマ

`data` 配列の各モデルには以下のフィールドが含まれます：

| フィールド                  | 型                | 説明                                            |
| ---------------------- | ---------------- | --------------------------------------------- |
| `id`                   | `string`         | API リクエストで使用する一意のモデル識別子（例：`"openai/gpt-5.4"`） |
| `canonical_slug`       | `string`         | 変更されないモデルの永続的なスラッグ                            |
| `name`                 | `string`         | 人間が読める表示名                                     |
| `created`              | `number`         | モデルが ARouter に追加された Unix タイムスタンプ              |
| `description`          | `string`         | モデルの機能の詳細な説明                                  |
| `context_length`       | `number`         | トークン単位の最大コンテキストウィンドウサイズ                       |
| `architecture`         | `Architecture`   | 技術的な機能オブジェクト                                  |
| `pricing`              | `Pricing`        | このモデルの使用コスト構造（USD/トークン）                       |
| `top_provider`         | `TopProvider`    | プライマリプロバイダーの設定詳細                              |
| `per_request_limits`   | `object \| null` | レート制限情報（制限なしの場合は `null`）                      |
| `supported_parameters` | `string[]`       | サポートされる API パラメータの配列                          |
| `default_parameters`   | `object \| null` | デフォルトパラメータ値（ない場合は `null`）                     |
| `expiration_date`      | `string \| null` | 廃止日（廃止されていない場合は `null`）                       |

### Architecture オブジェクト

```typescript theme={null}
{
  "input_modalities": string[],  // 例：["text", "image"]
  "output_modalities": string[], // 例：["text"]
  "tokenizer": string,           // 例："cl100k_base"
  "instruct_type": string | null // 例："chatml"、該当しない場合は null
}
```

### Pricing オブジェクト

すべての価格値は**USD/トークン**です。`"0"` は無料を意味します。

```typescript theme={null}
{
  "prompt": string,              // 入力トークンあたりのコスト
  "completion": string,          // 出力トークンあたりのコスト
  "request": string,             // API リクエストあたりの固定コスト
  "image": string,               // 画像入力あたりのコスト
  "web_search": string,          // ウェブ検索操作あたりのコスト
  "internal_reasoning": string,  // 内部推論トークンのコスト
  "input_cache_read": string,    // キャッシュされた入力トークン読み取りあたりのコスト
  "input_cache_write": string    // キャッシュされた入力トークン書き込みあたりのコスト
}
```

### Top Provider オブジェクト

```typescript theme={null}
{
  "context_length": number,         // プロバイダー固有のコンテキスト制限
  "max_completion_tokens": number,  // レスポンスの最大トークン数
  "is_moderated": boolean           // コンテンツモデレーションが適用されるか
}
```

### サポートされるパラメータ

`supported_parameters` 配列は、モデルで動作する OpenAI 互換パラメータを一覧表示します：

| パラメータ                | 説明            |
| -------------------- | ------------- |
| `tools`              | 関数呼び出し機能      |
| `tool_choice`        | ツール選択の制御      |
| `max_tokens`         | レスポンス長の制限     |
| `temperature`        | ランダム性の制御      |
| `top_p`              | ニュークリアスサンプリング |
| `reasoning`          | 内部推論モード       |
| `include_reasoning`  | レスポンスに推論を含める  |
| `structured_outputs` | JSON スキーマの強制  |
| `response_format`    | 出力形式の指定       |
| `stop`               | カスタム停止シーケンス   |
| `frequency_penalty`  | 繰り返しの削減       |
| `presence_penalty`   | トピックの多様性      |
| `seed`               | 決定論的な出力       |

## モデルの使用

`id` をリクエストの `model` フィールドに直接使用します：

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(
        base_url="https://api.arouter.ai/v1",
        api_key="lr_live_xxxx",
    )

    # List available models
    models = client.models.list()
    for model in models.data:
        print(model.id)

    # Use a specific model
    response = client.chat.completions.create(
        model="anthropic/claude-sonnet-4.6",
        messages=[{"role": "user", "content": "Hello!"}],
    )
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    import OpenAI from "openai";

    const client = new OpenAI({
      baseURL: "https://api.arouter.ai/v1",
      apiKey: "lr_live_xxxx",
    });

    // List available models
    const models = await client.models.list();
    for (const model of models.data) {
      console.log(model.id);
    }

    // Use a specific model
    const response = await client.chat.completions.create({
      model: "anthropic/claude-sonnet-4.6",
      messages: [{ role: "user", content: "Hello!" }],
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.arouter.ai/v1/models \
      -H "Authorization: Bearer lr_live_xxxx"
    ```
  </Tab>
</Tabs>

## サポートされるパラメータによるフィルタリング

ツール呼び出しをサポートするモデルを検索：

```bash theme={null}
curl "https://api.arouter.ai/v1/models?supported_parameters=tools" \
  -H "Authorization: Bearer lr_live_xxxx"
```

構造化出力をサポートするモデルを検索：

```bash theme={null}
curl "https://api.arouter.ai/v1/models?supported_parameters=structured_outputs" \
  -H "Authorization: Bearer lr_live_xxxx"
```

## 自動ルーティング

特定のモデル ID に加えて、ARouter は自動モデル選択をサポートします：

| モデル      | 説明                             |
| -------- | ------------------------------ |
| `"auto"` | ARouter がリクエストに最適な利用可能モデルを自動選択 |

```bash theme={null}
curl https://api.arouter.ai/v1/chat/completions \
  -H "Authorization: Bearer lr_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{"model": "auto", "messages": [{"role": "user", "content": "Hello!"}]}'
```

レスポンスの `model` フィールドには常に実際に使用されたモデルが表示されます。詳細は[モデルルーティング](/jp/model-routing#auto-routing)を参照してください。

## モデルバリアント

任意のモデル ID にサフィックスを追加してルーティング動作を変更できます：

| サフィックス      | 効果                             |
| ----------- | ------------------------------ |
| `:nitro`    | 最高スループットのインスタンスにルーティング — 速度最適化 |
| `:floor`    | 最低コストのインスタンスにルーティング — 価格最適化    |
| `:free`     | 無料ティアのインスタンスにルーティング（レート制限あり）   |
| `:thinking` | 拡張推論 / 思考の連鎖モードを有効化            |

```json theme={null}
{"model": "openai/gpt-5.4:nitro"}   // 最速
{"model": "openai/gpt-5.4:floor"}   // 最安値
{"model": "deepseek/deepseek-r1:thinking"} // 推論モード
```

完全なリファレンスは[モデルバリアント](/jp/guides/features/model-variants)を参照してください。

## トークン化

モデルによってテキストのトークン化方法が異なります。一部のモデル（GPT、Claude、Llama）はテキストを複数文字のチャンクに分割しますが、他のモデルは文字単位でトークン化します（PaLM）。これは、入力と出力が同一であっても、モデルによってトークン数——したがってコスト——が異なることを意味します。

コストは使用中のモデルのトークナイザーに基づいて請求されます。各レスポンスの `usage` フィールドを使用して正確なトークン数を取得してください：

```json theme={null}
{
  "usage": {
    "prompt_tokens": 42,
    "completion_tokens": 128,
    "total_tokens": 170
  }
}
```

## 注意事項

* モデルリストはアカウントで有効なプロバイダーでフィルタリングされます。プロバイダーが有効でない場合、そのモデルは表示されません。
* 新しいモデルはプロバイダーがリリースすると自動的に追加されます。
* このリストのモデル ID をチャット補完リクエストの `model` フィールドに直接使用してください。

利用可能なプロバイダーとそのフラッグシップモデルのキュレーションリストは[プロバイダー](/jp/providers)を参照してください。
