> ## 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 Fable 5.1

> Claude Fable 5.1：面向高难度推理、长程代理式编程和多步骤研究的 100 万上下文模型。

Claude Fable 5.1 是 Anthropic 当前能力最强的公开模型，面向高难度推理、长程代理式编程、多步骤研究与复杂知识工作。

可通过 MixRoute 的 Anthropic 兼容 Messages API 调用 `claude-fable-5-1`，同时支持 OpenAI 兼容的 Chat Completions API。

## 核心能力

* 长上下文 - 支持 100 万 token 上下文与最大 128K 输出
* 自适应思考 - 始终启用自适应思考，默认 effort 为 high
* 长程任务 - 强化代理式编程、多步骤研究和文档密集型工作流
* 多模态输入 - 支持文本与图像输入，输出文本
* 双接口支持 - 可通过 Anthropic 兼容 Messages 和 OpenAI 兼容 Chat Completions 调用

## 快速示例

### Messages API

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

  <Tab title="Python">
    ```python theme={null}
    from anthropic import Anthropic

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

    message = client.messages.create(
        model="claude-fable-5-1",
        max_tokens=256,
        messages=[{"role": "user", "content": "Explain quantum entanglement in simple terms."}],
    )

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

  <Tab title="Streaming">
    ```python theme={null}
    from anthropic import Anthropic

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

    with client.messages.stream(
        model="claude-fable-5-1",
        max_tokens=256,
        messages=[{"role": "user", "content": "Write a short poem about the sea."}],
    ) as stream:
        for text in stream.text_stream:
            print(text, end="")
    ```
  </Tab>
</Tabs>

### 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-fable-5-1",
      "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-fable-5-1",
        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-fable-5-1",
        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>

## 参数

### Messages API

| 参数           | 类型              | 必填 | 说明                       |
| ------------ | --------------- | -- | ------------------------ |
| `model`      | string          | 是  | 固定为 `claude-fable-5-1`。  |
| `messages`   | array           | 是  | 包含 role 与 content 的输入消息。 |
| `max_tokens` | integer         | 是  | 最大生成 token 数。            |
| `system`     | string \| array | 否  | 顶层系统指令。                  |
| `stream`     | boolean         | 否  | 启用 SSE 流式输出。             |
| `tools`      | array           | 否  | Anthropic 工具定义。          |
| `thinking`   | object          | 否  | 模型支持时使用的扩展思考配置。          |

### OpenAI 兼容 API

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

## 厂商参考

* [Claude Fable 5.1 官方文档](https://platform.claude.com/docs/en/models/fable-5-1/overview)
