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

> 通过 OpenAI 兼容接口调用 Anthropic 的最强模型 Claude Fable 5，自适应思维始终开启，适用于复杂推理和长时智能体任务。

Claude Fable 5 是 Anthropic 目前最强大的公开发布模型，通过 AnyFast 以 OpenAI 兼容接口提供服务。专为高难度推理、长时智能体编程和高自主性任务设计。

## 核心能力

* **最强 Claude** — Anthropic 顶级模型，擅长推理和智能体编程
* **自适应思维始终开启** — 每次请求自动启用智能推理，无需配置
* **1M 上下文窗口** — 128K 最大输出 Token
* **OpenAI 兼容** — 可直接替换 OpenAI SDK，无需修改其他代码
* **安全分类器** — 可能拒绝某些请求，返回 `finish_reason: "refusal"`，拒绝前不收费
* **Fallback 支持** — 传入 `fallbacks` 参数可自动在其他 Claude 模型上重试被拒请求
* **流式输出** — 支持通过 SSE 实时 Token 流式传输

## 快速示例

<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",
      "messages": [
        { "role": "user", "content": "用简单的语言解释量子纠缠。" }
      ]
    }'
  ```

  ```python Python theme={null}
  from openai import OpenAI

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

  response = client.chat.completions.create(
      model="claude-fable-5",
      messages=[
          {"role": "user", "content": "用简单的语言解释量子纠缠。"}
      ]
  )

  print(response.choices[0].message.content)
  ```

  ```python 流式输出 theme={null}
  from openai import OpenAI

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

  stream = client.chat.completions.create(
      model="claude-fable-5",
      messages=[
          {"role": "user", "content": "写一首关于大海的短诗。"}
      ],
      stream=True
  )

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

## 参数说明

| 参数           | 类型             | 必填 | 说明                       |
| ------------ | -------------- | -- | ------------------------ |
| `model`      | string         | 是  | 固定为 `claude-fable-5`     |
| `messages`   | array          | 是  | `{ role, content }` 对象数组 |
| `max_tokens` | integer        | 否  | 最大生成 Token 数             |
| `stream`     | boolean        | 否  | 开启 SSE 流式传输，默认 `false`   |
| `stop`       | string / array | 否  | 触发停止生成的序列                |

<Note>
  Claude Fable 5 不支持 `temperature`、`top_p` 和 `top_k` 参数。设置非默认值将返回 400 错误，请通过提示词引导模型行为。
</Note>

<Note>
  Claude Fable 5 包含安全分类器，可能返回 `finish_reason: "refusal"`。被拒绝的请求不收费。可使用 `fallbacks` 参数自动在其他 Claude 模型上重试。
</Note>

<Card title="API 参考" icon="code" href="/zh/api-reference/model-api/anthropic/claude-fable-5">
  查看 Claude Fable 5 的交互式 API Playground。
</Card>
