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

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

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

## 模型规格

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

## 相对 Fable 5.1 的迁移注意事项

官方对 Fable 5.2 的思考块前缀绑定检查适用于所有账户。回传思考块时，保持 `system`、`tools` 和历史消息不变，只追加新消息；切换模型时，不要假定旧模型能读取 Fable 5.2 的思考块。AnyFast 实测中，修改 system 或历史用户消息后，带原始 thinking 块的请求仍返回 `200`，未复现官方绑定错误。无法从响应判断思考块是否被丢弃或改写；不要依赖这种宽松行为。

## 快速示例

```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-2",
    "max_tokens": 4096,
    "output_config": { "effort": "high" },
    "messages": [
      {
        "role": "user",
        "content": "审查这个数据库迁移计划并找出风险最高的三个假设：一夜复制 2 TB 数据，暂停写入五分钟，一次切换全部客户端，并保留旧库以便回滚。"
      }
    ]
  }'
```

```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-2",
    max_tokens=4096,
    output_config={"effort": "high"},
    messages=[
        {
            "role": "user",
            "content": "审查这个数据库迁移计划并找出风险最高的三个假设：一夜复制 2 TB 数据，暂停写入五分钟，一次切换全部客户端，并保留旧库以便回滚。"
        }
    ]
)

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-2",
    max_tokens=4096,
    output_config={"effort": "high"},
    messages=[
        {"role": "user", "content": "为数据库迁移制定一份分阶段上线计划。"}
    ],
) as stream:
    for text in stream.text_stream:
        print(text, end="")
```

## 核心参数

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `model` | string | 是 | 固定为 `claude-fable-5-2`。 |
| `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` 控制推理深度。

> [!WARNING]
>
> 生产采样参数兼容性与官方限制存在差异：`temperature=0.5`、`top_p=0.5` 和 `top_k=1` 在独立测试中均返回 HTTP `200`，未被拒绝；这不证明参数实际影响采样，也无法据此判断是否被网关忽略或改写。调用时建议省略这三个参数。

## 验证中的兼容性差异

生产接口也接受了非法 `output_config.effort="not-a-level"`，因此不要依赖服务端拒绝非法档位；客户端应只使用上表列出的官方值。省略 effort 的请求成功，但仅凭响应无法确认内部实际采用的档位。

`tool_choice={"type":"none"}` 测试未返回工具调用，但出现 `content: []`、`stop_reason: "end_turn"`，即没有可展示文本；客户端不能假定每个 HTTP `200` 都包含文本块。该行为尚未定位原因。

已验证 `max_tokens=1` 触发 `stop_reason="max_tokens"`；`max_tokens=0` 返回 `400`。停止序列测试返回 `stop_reason="stop_sequence"` 与匹配的 `stop_sequence`，文本不包含该停止序列。最大输出边界尚未实测。

## 工具调用

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

## 多轮对话

回传包含 Thinking 块的 Assistant 消息时，请完整保留原始内容。系统提示词、工具定义和历史消息应保持只追加。官方对前缀修改执行绑定检查；本次 AnyFast 的 system/历史消息修改测试未复现该错误，不能依赖其宽松行为。

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

> [card] [API 参考](https://docs.anyfast.ai/zh/api-reference/model-api/anthropic/claude-fable-5-2.md)
>
> 查看请求字段、响应内容块和交互式 API Playground。


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