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

# Claude Opus 4.5

> Claude Opus 4.5：面向高级编程、智能体与复杂分析的模型。包含 MixRoute 调用示例与参数。

Claude Opus 4.5 是 Anthropic 推出的面向高级编程、智能体与复杂分析的模型。

通过 MixRoute 的 OpenAI 兼容 Chat Completions API `/v1/chat/completions` 调用 `claude-opus-4-5-20251101`。

<Info>
  部分上游渠道可能无法使用 Messages API。如果 `/v1/messages` 返回 `Operation not allowed`，请使用相同模型 ID，按照下方 OpenAI 请求格式改用 `/v1/chat/completions`。
</Info>

## 核心能力

* OpenAI 兼容 - 使用 Chat Completions 请求与响应格式
* 流式输出 - 通过 SSE 增量返回内容
* 系统提示词 - 使用 `role: "system"` 的消息
* 工具调用 - 使用 OpenAI 兼容的工具定义

## 快速示例

### OpenAI 兼容 API

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.mixroute.ai/v1/chat/completions" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "model": "claude-opus-4-5-20251101",
      "messages": [
        {
          "role": "user",
          "content": "Explain quantum entanglement in simple terms."
        }
      ],
      "max_tokens": 256
    }'
    ```
  </Tab>

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

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

    response = client.chat.completions.create(
        model="claude-opus-4-5-20251101",
        messages=[{"role": "user", "content": "Explain quantum entanglement in simple terms."}],
        max_tokens=256,
    )

    print(response.choices[0].message.content)
    ```
  </Tab>

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

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

    stream = client.chat.completions.create(
        model="claude-opus-4-5-20251101",
        messages=[{"role": "user", "content": "Write a short poem about the sea."}],
        max_tokens=256,
        stream=True,
    )

    for chunk in stream:
        print(chunk.choices[0].delta.content or "", end="")
    ```
  </Tab>
</Tabs>

## 参数

### OpenAI 兼容 API

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `model` | string | 是 | 固定为 `claude-opus-4-5-20251101`。 |
| `messages` | array | 是 | 包含 role 与 content 的对话消息。 |
| `max_tokens` | integer | 否 | 最大生成 token 数。 |
| `stream` | boolean | 否 | 启用 SSE 流式输出，默认 false。 |
| `temperature` | number | 否 | 模型支持时用于控制采样随机性。 |
| `top_p` | number | 否 | 模型支持时使用的核采样阈值。 |
| `stop` | string \| array | 否 | 触发停止生成的序列。 |
| `tools` | array | 否 | OpenAI 兼容工具定义。 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.