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

# Claude Fable 5.1

> 通过 AnyFast 调用 Anthropic Claude Fable 5.1，适用于高难度推理、长时智能体编程、研究和文档任务。

Claude Fable 5.1 是 Anthropic 面向高难度推理和长时智能体任务的最新 Fable 模型。使用 AnyFast 模型 ID `claude-fable-5-1`，通过原生 Anthropic Messages API 的 `POST /v1/messages` 调用。

## 模型规格

| 规格        | 值                                   |
| --------- | ----------------------------------- |
| 模型 ID     | `claude-fable-5-1`                  |
| 上下文窗口     | 1M Token                            |
| 最大输出      | 128K Token                          |
| 输入 → 输出   | 文本和图片 → 文本                          |
| Thinking  | Adaptive，始终开启                       |
| 默认 effort | `high`                              |
| effort 档位 | `low`、`medium`、`high`、`xhigh`、`max` |
| 可靠知识截止时间  | 2026 年 6 月                          |

## 相比 Fable 5 的变化

* **长时任务能力增强** — 提升智能体编程、多步研究、文档、表格、幻灯片、视觉和计算机操作能力。
* **上游缓存读取价格降低** — Anthropic 保持基础输入和输出价格不变，同时降低缓存读取价格。
* **不支持强制工具调用** — `tool_choice: {"type":"any"}` 和 `tool_choice: {"type":"tool"}` 会返回 `400`，请使用 `auto` 或 `none`。
* **Thinking 块与对话绑定** — 历史消息应保持只追加，并原样回传 Thinking 块。修改系统提示词、工具或较早消息可能使后续 Thinking 块失效。
* **Thinking 单向兼容** — Fable 5.1 可以读取更早 Claude 模型的 Thinking 块，但更早模型无法读取 Fable 5.1 的 Thinking 块。

## 快速示例

<CodeGroup>
  ```bash cURL theme={null}
  curl https://www.anyfast.ai/v1/messages \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "claude-fable-5-1",
      "max_tokens": 4096,
      "output_config": { "effort": "high" },
      "messages": [
        {
          "role": "user",
          "content": "审查这份迁移计划，并找出风险最高的三个假设。"
        }
      ]
    }'
  ```

  ```python Python theme={null}
  import anthropic

  client = anthropic.Anthropic(
      api_key="YOUR_API_KEY",
      base_url="https://www.anyfast.ai"
  )

  message = client.messages.create(
      model="claude-fable-5-1",
      max_tokens=4096,
      output_config={"effort": "high"},
      messages=[
          {
              "role": "user",
              "content": "审查这份迁移计划，并找出风险最高的三个假设。"
          }
      ]
  )

  for block in message.content:
      if block.type == "text":
          print(block.text)
  ```

  ```python 流式输出 theme={null}
  import anthropic

  client = anthropic.Anthropic(
      api_key="YOUR_API_KEY",
      base_url="https://www.anyfast.ai"
  )

  with client.messages.stream(
      model="claude-fable-5-1",
      max_tokens=4096,
      output_config={"effort": "high"},
      messages=[
          {"role": "user", "content": "为数据库迁移制定一份分阶段上线计划。"}
      ],
  ) as stream:
      for text in stream.text_stream:
          print(text, end="")
  ```
</CodeGroup>

## 核心参数

| 参数                     | 类型      | 必填 | 说明                                                         |
| ---------------------- | ------- | -- | ---------------------------------------------------------- |
| `model`                | string  | 是  | 固定为 `claude-fable-5-1`。                                    |
| `messages`             | array   | 是  | 对话消息，角色为 `user` 或 `assistant`，支持文本、图片和工具结果。                |
| `max_tokens`           | integer | 是  | 最大输出 Token 数，包括 Thinking 和可见文本，范围为 1–128000。               |
| `output_config.effort` | string  | 否  | 控制思维深度，支持 `low`、`medium`、`high`、`xhigh` 和 `max`，默认 `high`。 |
| `thinking.type`        | string  | 否  | 省略或设为 `adaptive`，不能关闭 Thinking。                            |
| `tools`                | array   | 否  | 提供给模型使用的工具定义。                                              |
| `tool_choice.type`     | string  | 否  | 支持 `auto` 和 `none`，不支持强制 `any` 或指定 `tool`。                 |
| `stream`               | boolean | 否  | 开启 SSE 流式传输，默认 `false`。                                    |
| `stop_sequences`       | array   | 否  | 触发停止生成的自定义序列。                                              |

<Note>
  Adaptive Thinking 始终开启。请省略 `thinking` 或传入 `{"type":"adaptive"}`。手动扩展思维的 `budget_tokens` 和 `{"type":"disabled"}` 均会返回 `400`。请使用 `output_config.effort` 控制推理深度。
</Note>

<Warning>
  Claude Fable 5.1 不支持非默认采样值。请省略 `temperature`、`top_p` 和 `top_k`。仅为向后兼容接受 `temperature: 1` 和 `0.99`–`1` 的 `top_p`；任何 `top_k` 值都会返回 `400`。模型也不支持预填 Assistant 回答。
</Warning>

## 工具调用

请使用 `tool_choice: {"type":"auto"}`（默认）或 `{"type":"none"}`。请在提示词中明确工具的使用时机，并准确描述输入 Schema。不要使用 `any` 或指定工具的强制调用方式。

## 多轮对话

回传包含 Thinking 块的 Assistant 消息时，请完整保留原始内容。系统提示词、工具定义和历史消息应保持只追加。修改 Fable 5.1 Thinking 块之前的内容，可能返回对话绑定相关的 `400` 错误。

<Info>
  Anthropic 于 2026 年 9 月 1 日发布 Claude Fable 5.1。参见官方[模型概览](https://platform.claude.com/docs/zh-CN/models/fable-5-1/overview)、[版本变化](https://platform.claude.com/docs/en/models/fable-5-1/whats-new-fable-5-1)和[提示词指南](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1)。
</Info>

<Card title="API 参考" icon="code" href="/zh/api-reference/model-api/anthropic/claude-fable-5-1">
  查看请求字段、响应内容块和交互式 API Playground。
</Card>

<script src="/public/feedback.js" />
