> ## 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/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/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/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/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/provider-routing)了解完整的 `provider` 对象选项。
