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

# 模型變體

> 在任意模型 ID 後附加後綴來控制路由行為——最佳化速度、成本、推理深度或上下文長度。

模型變體讓您透過在模型 ID 後附加後綴來修改路由行為。相比單獨設定 `provider` 物件，變體是直接嵌入模型字串中的簡潔縮寫方式。

```json theme={null}
{"model": "openai/gpt-5.4:nitro"}
```

***

## `:nitro` — 最大吞吐量

附加 `:nitro` 可路由到模型的最高吞吐量實例。等同於設定 `provider.sort = "throughput"`。

**最適合**：即時應用程式、互動式聊天、串流 UI

```json theme={null}
{"model": "openai/gpt-5.4:nitro"}
```

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

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

    const response = await client.chat.completions.create({
      model: "openai/gpt-5.4:nitro",
      messages: [{ role: "user", content: "Hello!" }],
    });
    ```
  </Tab>

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

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

    response = client.chat.completions.create(
        model="openai/gpt-5.4:nitro",
        messages=[{"role": "user", "content": "Hello!"}],
    )
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.arouter.ai/v1/chat/completions \
      -H "Authorization: Bearer lr_live_xxxx" \
      -H "Content-Type: application/json" \
      -d '{"model": "openai/gpt-5.4:nitro", "messages": [{"role": "user", "content": "Hello!"}]}'
    ```
  </Tab>
</Tabs>

***

## `:floor` — 最低成本

附加 `:floor` 可路由到模型的最低成本實例。等同於設定 `provider.sort = "price"`。

**最適合**：批次處理、離線工作負載、對成本敏感的流水線

```json theme={null}
{"model": "openai/gpt-5.4:floor"}
```

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const response = await client.chat.completions.create({
      model: "openai/gpt-5.4:floor",
      messages: [{ role: "user", content: "Summarize this document." }],
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    response = client.chat.completions.create(
        model="openai/gpt-5.4:floor",
        messages=[{"role": "user", "content": "Summarize this document."}],
    )
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.arouter.ai/v1/chat/completions \
      -H "Authorization: Bearer lr_live_xxxx" \
      -H "Content-Type: application/json" \
      -d '{"model": "openai/gpt-5.4:floor", "messages": [{"role": "user", "content": "Summarize this document."}]}'
    ```
  </Tab>
</Tabs>

***

## `:free` — 免費層

附加 `:free` 可路由到模型的免費層實例。免費層實例適用於許多熱門模型，但有速率限制。

**最適合**：原型開發、開發測試、低流量測試

```json theme={null}
{"model": "meta-llama/llama-4-maverick:free"}
```

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const response = await client.chat.completions.create({
      model: "meta-llama/llama-4-maverick:free",
      messages: [{ role: "user", content: "Hello!" }],
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    response = client.chat.completions.create(
        model="meta-llama/llama-4-maverick:free",
        messages=[{"role": "user", "content": "Hello!"}],
    )
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.arouter.ai/v1/chat/completions \
      -H "Authorization: Bearer lr_live_xxxx" \
      -H "Content-Type: application/json" \
      -d '{"model": "meta-llama/llama-4-maverick:free", "messages": [{"role": "user", "content": "Hello!"}]}'
    ```
  </Tab>
</Tabs>

<Note>
  免費層模型有更嚴格的速率限制，且上下文視窗可能縮減。詳情請參閱[速率限制](/zh-Hant/guides/limits)。
</Note>

***

## `:thinking` — 擴展推理

附加 `:thinking` 可在支援的模型上啟用擴展思維鏈推理（如 DeepSeek R1、啟用擴展思考的 Claude、Gemini Flash Thinking）。

**最適合**：複雜推理、數學、程式設計、多步驟問題

```json theme={null}
{"model": "deepseek/deepseek-r1:thinking"}
```

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const response = await client.chat.completions.create({
      model: "deepseek/deepseek-r1:thinking",
      messages: [
        { role: "user", content: "Prove that √2 is irrational." }
      ],
    });

    // 推理 Token 在 usage 中返回
    console.log(response.usage);
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    response = client.chat.completions.create(
        model="deepseek/deepseek-r1:thinking",
        messages=[{"role": "user", "content": "Prove that √2 is irrational."}],
    )

    # 推理 Token 在 usage 中返回
    print(response.usage)
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.arouter.ai/v1/chat/completions \
      -H "Authorization: Bearer lr_live_xxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "deepseek/deepseek-r1:thinking",
        "messages": [{"role": "user", "content": "Prove that √2 is irrational."}]
      }'
    ```
  </Tab>
</Tabs>

啟用 `:thinking` 後，推理 Token 將出現在回應的 `usage.completion_tokens_details` 中：

```json theme={null}
{
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 850,
    "total_tokens": 870,
    "completion_tokens_details": {
      "reasoning_tokens": 720
    }
  }
}
```

計費和使用詳情請參閱[推理 Token](/zh-Hant/guides/best-practices/reasoning-tokens)。

***

## `:extended` — 擴展上下文

附加 `:extended` 可存取上下文視窗比預設更大的模型版本。

**最適合**：長文件處理、大型程式碼庫、長對話

```json theme={null}
{"model": "google/gemini-2.5-flash:extended"}
```

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const response = await client.chat.completions.create({
      model: "google/gemini-2.5-flash:extended",
      messages: [{ role: "user", content: "Analyze this 500-page report..." }],
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    response = client.chat.completions.create(
        model="google/gemini-2.5-flash:extended",
        messages=[{"role": "user", "content": "Analyze this 500-page report..."}],
    )
    ```
  </Tab>
</Tabs>

***

## `:exacto` — 工具呼叫品質

附加 `:exacto` 可明確啟用工具呼叫請求的品質排名路由。ARouter 會選擇工具呼叫品質評分最高的提供商端點，而不是最便宜的選項。

**最適合**：生產工具呼叫流水線，對結構描述遵從和引數準確性的要求高於成本

```json theme={null}
{"model": "openai/gpt-5.4:exacto"}
```

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    const response = await client.chat.completions.create({
      model: "openai/gpt-5.4:exacto",
      messages: [{ role: "user", content: "Get the weather in Shanghai and Tokyo" }],
      tools: [weatherTool],
    });
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    response = client.chat.completions.create(
        model="openai/gpt-5.4:exacto",
        messages=[{"role": "user", "content": "Get the weather in Shanghai and Tokyo"}],
        tools=[weather_tool],
    )
    ```
  </Tab>
</Tabs>

**與 Auto Exacto 的區別**：[Auto Exacto](/zh-Hant/guides/routing/auto-exacto) 在存在 `tools` 時自動啟用。`:exacto` 即使在沒有工具的請求中也會強制使用品質排名路由——當您希望無論模型是否呼叫工具都保持一致的提供商選擇行為時非常有用。

***

## 組合變體

某些變體可以組合使用：

```json theme={null}
{"model": "meta-llama/llama-4-maverick:free:nitro"}
```

<Note>
  並非所有組合都有效。如果模型不支援所請求的組合，ARouter 將回傳錯誤。
</Note>

***

## 變體參考

| 後綴          | 效果         | 等同的 `provider` 設定              | 最適合                                                        |
| ----------- | ---------- | ------------------------------ | ---------------------------------------------------------- |
| `:nitro`    | 最高吞吐量      | `provider.sort = "throughput"` | 即時 / 互動式                                                   |
| `:floor`    | 最低成本       | `provider.sort = "price"`      | 批次處理 / 離線                                                  |
| `:free`     | 免費層（有速率限制） | —                              | 開發 / 原型                                                    |
| `:thinking` | 擴展推理模式     | —                              | 複雜推理                                                       |
| `:extended` | 更大的上下文視窗   | —                              | 長文件                                                        |
| `:online`   | 網路搜尋（已棄用）  | `plugins: [{id: "web"}]`       | 請改用[伺服器工具](/zh-Hant/guides/features/server-tools/overview) |
| `:exacto`   | 工具呼叫品質路由   | `provider.sort = "quality"`    | 生產工具呼叫                                                     |

***

## 變體如何影響路由

變體在伺服器端解析，並影響 ARouter 選擇的端點：

1. 基礎模型 ID（如 `openai/gpt-5.4`）識別模型系列
2. 後綴修改端點選擇標準
3. ARouter 在 `response.model` 中返回實際使用的模型

請始終檢查 `response.model` 以查看實際服務的模型變體：

```json theme={null}
{
  "model": "openai/gpt-5.4:nitro",
  "choices": [...],
  "usage": {...}
}
```

當您需要比變體提供更精細的控制時，請參閱[提供商路由](/zh-Hant/provider-routing)了解完整的 `provider` 物件選項。
