---
title: Claude Fable 5.1 與 Claude Mythos 5.1 遷移指南
url: https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide
description: 透過本遷移指南，從 Claude Fable 5、Claude Mythos 5、Claude Opus 5 或 Claude Opus 4.8 切換至 Claude Fable 5.1 與 Claude Mythos 5.1。啟用 Claude Fable 5.1 與 Claude Mythos 5.1 的指引包含模型 ID、重大變更以及遷移檢查清單。
---

<Note>
  本指南涵蓋遷移 [Messages API](https://platform.claude.com/docs/zh-TW/build-with-claude/working-with-messages) 程式碼的相關內容。如果您使用 [Claude Managed Agents](https://platform.claude.com/docs/zh-TW/managed-agents/overview)，除了更新模型名稱之外，不需要進行任何其他變更。
</Note>

<Tip>
  **使用 Claude API skill 自動化您的遷移。** 在 Claude Code 中，執行 `/claude-api migrate` 以呼叫內建的 [Claude API skill](https://platform.claude.com/docs/zh-TW/agents-and-tools/agent-skills/claude-api-skill#migrating-to-a-newer-claude-model)。它適用於以任何目前的 Claude 模型作為目標：

  讓 Claude Code 為您遷移程式碼

  ```text
  /claude-api migrate 將此專案遷移至 claude-fable-5-1
  ```

  此 skill 會在您的整個程式碼庫中套用模型 ID 替換，並視需要處理破壞性參數變更、prefill（預填）替換，以及針對目標模型的 effort（努力程度）校準，然後產生一份需要手動驗證的項目清單。在編輯任何檔案之前，它會請您確認遷移範圍（整個工作目錄、某個子目錄，或特定的檔案清單）。此 skill 也會偵測 Amazon Bedrock 與 Claude Platform on AWS 用戶端，並針對這些平台調整模型 ID 格式與功能變更。
</Tip>

[Claude Fable 5.1](https://platform.claude.com/docs/zh-TW/models/fable-5-1/whats-new-fable-5-1) 接替 Claude Fable 5，輸入與輸出價格相同，而快取讀取的費用僅為四分之一。它可在 Claude API、[Amazon Bedrock](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-in-amazon-bedrock)、[Claude Platform on AWS](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-platform-on-aws)、[Google Cloud](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-on-vertex-ai) 以及 [Microsoft Foundry](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-in-microsoft-foundry) 上使用。[Claude Mythos 5.1](https://platform.claude.com/docs/zh-TW/models/mythos-5-1/overview) 具備相同的功能，僅提供給通過 Anthropic 驗證計畫（例如 [Cyber Verification Program](https://support.claude.com/en/articles/14604842)）驗證的組織使用。關於行為差異與提示模式，請參閱[為 Claude Fable 5.1 撰寫提示](https://platform.claude.com/docs/zh-TW/build-with-claude/prompt-engineering/prompting-claude-fable-5-1)。

`claude-fable-5-1` 與 `claude-mythos-5-1` 共用的基準設定：

* **思考：**[自適應思考](https://platform.claude.com/docs/zh-TW/build-with-claude/thinking)（adaptive thinking）始終開啟，與 Claude Fable 5 相同。模型會自行決定何時思考以及思考多少。不需要任何 `thinking` 設定。`thinking: {type: "disabled"}` 與手動擴展思考（`thinking: {type: "enabled", budget_tokens: N}`）都會回傳 400 錯誤。
* **預填（Prefill）：**&#x9810;填助理訊息會回傳 400 錯誤，與 Claude Fable 5 相同。請改用「system prompt」（系統提示）指令。
* **工具選擇（Tool choice）：**&#x652F;援 `{type: "auto"}`（預設值）與 `{type: "none"}`。以 `{type: "any"}` 或 `{type: "tool", name: "..."}` 強制呼叫工具會回傳 400 錯誤。請參閱[重大變更](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-breaking-changes)。
* **跨模型保留的思考：**&#x43;laude Fable 5.1 可讀取來自 Claude Opus 5、Claude Fable 5、Claude Mythos 5 以及更早期 Claude 模型的思考區塊。這些模型皆無法讀取 Claude Fable 5.1 的區塊。請參閱[重大變更](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-breaking-changes)。
* **上下文視窗與輸出：**&#x9810;設為 [1M token 的「context window」（上下文視窗）](https://platform.claude.com/docs/zh-TW/build-with-claude/context-windows)，每次請求最多 128k 輸出 token。
* **定價：**&#x6BCF;百萬輸入 token 10 美元，每百萬輸出 token 50 美元，與 Claude Fable 5 相同。「prompt caching」（提示快取）讀取為每百萬 token 0.25 美元，是 Claude Fable 5 費率的四分之一。請參閱 [Claude 定價](https://platform.claude.com/docs/zh-TW/about-claude/pricing)。
* **資料保留：**&#x5169;個模型皆要求 30 天資料保留，除非經 Anthropic 明確授權，否則不適用於零資料保留（ZDR）安排，並且被指定為 Covered Models，與 Claude Fable 5 及 Claude Mythos 5 相同。在 Claude API 上，來自未設定 30 天保留的組織或工作區的請求會回傳 400 `invalid_request_error`。具有 ZDR 安排的組織應聯繫其 Anthropic 客戶團隊，或依工作區設定保留。各平台的詳細資訊請參閱[特定模型的資料保留要求](https://platform.claude.com/docs/zh-TW/manage-claude/api-and-data-retention#model-specific-data-retention-requirements)。

兩個模型的差異之處：

* **可用性：**&#x43;laude Fable 5.1 不需要存取核准。Claude Mythos 5.1 僅提供給通過 Anthropic 驗證計畫（例如 [Cyber Verification Program](https://support.claude.com/en/articles/14604842)）驗證的組織使用。若要申請存取，請申請涵蓋您使用案例的計畫，或聯繫您的 Anthropic 客戶團隊。
* **Priority Tier：**&#x5169;個模型皆不支援 [Priority Tier](https://platform.claude.com/docs/zh-TW/api/service-tiers#supported-models)。Claude Fable 5 則支援。

## 從 Claude Fable 5 遷移至 Claude Fable 5.1

遷移大致上可直接替換。API 介面、限制、每 token 定價、分詞器（tokenizer）、始終開啟的自適應思考、拒絕處理以及 `stop_details` 類別都與 Claude Fable 5 相同。變更之處：強制工具選擇會回傳 400 錯誤；只有 Claude Fable 5.1 與 Claude Mythos 5.1 能讀取 Claude Fable 5.1 的思考區塊，且僅限於產生這些區塊的對話中；快取讀取費用更低；以及代理迴圈行為有三方面的差異。相同的變更也適用於 [Claude Mythos 5.1](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#migrating-from-claude-mythos-5-to-claude-mythos-5-1)，但思考區塊的對話檢查除外，Claude Mythos 5.1 不會執行該檢查。

### 更新您的模型名稱

```python
model = "claude-fable-5"  # Before
model = "claude-fable-5-1"  # After

# 或者，若使用 Claude Mythos 5.1（為經驗證的組織提供相同功能）：
model = "claude-mythos-5-1"  # After
```

### 重大變更

1. **不支援強制工具選擇：**&#x43;laude Fable 5 接受 `tool_choice` 的 `auto`、`none`、`any` 與 `tool`。在 `claude-fable-5-1` 上，`{type: "any"}` 與 `{type: "tool", name: "..."}` 會回傳 400 `invalid_request_error`：

   ```text wrap
   tool_choice: type "tool" and "any" are not supported for this model.
   ```

   此檢查適用於 Messages API、Message Batches API 以及 [token 計數](https://platform.claude.com/docs/zh-TW/build-with-claude/token-counting)端點。

   之前（Claude Fable 5）：

   <CodeGroup>
     ```bash cURL
     curl -sS https://api.anthropic.com/v1/messages \
       -H "content-type: application/json" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01" \
       -d '{
         "model": "claude-fable-5",
         "max_tokens": 16000,
         "tools": [
           {
             "name": "record_summary",
             "description": "Record the structured summary of the document.",
             "input_schema": {
               "type": "object",
               "properties": {"summary": {"type": "string"}},
               "required": ["summary"]
             }
           }
         ],
         "tool_choice": {"type": "tool", "name": "record_summary"},
         "messages": [
           {"role": "user", "content": "Summarize: The meeting moved to Thursday."}
         ]
       }'
     ```

     ```bash CLI
     ant messages create <<'YAML'
     model: claude-fable-5
     max_tokens: 16000
     tools:
       - name: record_summary
         description: Record the structured summary of the document.
         input_schema:
           type: object
           properties:
             summary:
               type: string
           required: [summary]
     tool_choice:
       type: tool
       name: record_summary
     messages:
       - role: user
         content: "Summarize: The meeting moved to Thursday."
     YAML
     ```

     ```python Python
     client = anthropic.Anthropic()

     record_summary_tool = {
         "name": "record_summary",
         "description": "Record the structured summary of the document.",
         "input_schema": {
             "type": "object",
             "properties": {"summary": {"type": "string"}},
             "required": ["summary"],
         },
     }

     response = client.messages.create(
         model="claude-fable-5",
         max_tokens=16000,
         tools=[record_summary_tool],
         tool_choice={"type": "tool", "name": "record_summary"},
         messages=[{"role": "user", "content": "Summarize: The meeting moved to Thursday."}],
     )
     print(response.content)
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const response = await client.messages.create({
       model: "claude-fable-5",
       max_tokens: 16000,
       tools: [
         {
           name: "record_summary",
           description: "Record the structured summary of the document.",
           input_schema: {
             type: "object",
             properties: { summary: { type: "string" } },
             required: ["summary"]
           }
         }
       ],
       tool_choice: { type: "tool", name: "record_summary" },
       messages: [{ role: "user", content: "Summarize: The meeting moved to Thursday." }]
     });

     console.log(response.content);
     ```

     ```csharp C#
     AnthropicClient client = new();

     var parameters = new MessageCreateParams
     {
         Model = Model.ClaudeFable5,
         MaxTokens = 16000,
         Tools = [
             new ToolUnion(new Tool()
             {
                 Name = "record_summary",
                 Description = "Record the structured summary of the document.",
                 InputSchema = new InputSchema()
                 {
                     Properties = new Dictionary<string, JsonElement>
                     {
                         ["summary"] = JsonSerializer.SerializeToElement(new { type = "string" }),
                     },
                     Required = ["summary"],
                 },
             }),
         ],
         ToolChoice = new ToolChoiceTool { Name = "record_summary" },
         Messages = [
             new() { Role = Role.User, Content = "Summarize: The meeting moved to Thursday." }
         ]
     };

     var message = await client.Messages.Create(parameters);
     Console.WriteLine(message);
     ```

     ```go Go
     client := anthropic.NewClient()

     response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
     	Model:     anthropic.ModelClaudeFable5,
     	MaxTokens: 16000,
     	Tools: []anthropic.ToolUnionParam{
     		{OfTool: &anthropic.ToolParam{
     			Name:        "record_summary",
     			Description: anthropic.String("Record the structured summary of the document."),
     			InputSchema: anthropic.ToolInputSchemaParam{
     				Properties: map[string]any{
     					"summary": map[string]any{"type": "string"},
     				},
     				Required: []string{"summary"},
     			},
     		}},
     	},
     	ToolChoice: anthropic.ToolChoiceUnionParam{OfTool: &anthropic.ToolChoiceToolParam{Name: "record_summary"}},
     	Messages: []anthropic.MessageParam{
     		anthropic.NewUserMessage(anthropic.NewTextBlock("Summarize: The meeting moved to Thursday.")),
     	},
     })
     if err != nil {
     	log.Fatal(err)
     }
     fmt.Println(response.RawJSON())
     ```

     ```java Java

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         MessageCreateParams params = MessageCreateParams.builder()
             .model(Model.CLAUDE_FABLE_5)
             .maxTokens(16000L)
             .addTool(Tool.builder()
                 .name("record_summary")
                 .description("Record the structured summary of the document.")
                 .inputSchema(InputSchema.builder()
                     .properties(JsonValue.from(Map.of("summary", Map.of("type", "string"))))
                     .required(List.of("summary"))
                     .build())
                 .build())
             .toolChoice(ToolChoice.ofTool(ToolChoiceTool.builder()
                 .name("record_summary")
                 .build()))
             .addUserMessage("Summarize: The meeting moved to Thursday.")
             .build();

         Message response = client.messages().create(params);
         IO.println(response);
     }
     ```

     ```php PHP
     $client = new Client();

     $message = $client->messages->create(
         maxTokens: 16000,
         messages: [
             ['role' => 'user', 'content' => 'Summarize: The meeting moved to Thursday.']
         ],
         model: 'claude-fable-5',
         toolChoice: ['type' => 'tool', 'name' => 'record_summary'],
         tools: [
             [
                 'name' => 'record_summary',
                 'description' => 'Record the structured summary of the document.',
                 'input_schema' => [
                     'type' => 'object',
                     'properties' => [
                         'summary' => ['type' => 'string']
                     ],
                     'required' => ['summary']
                 ]
             ]
         ],
     );

     echo $message;
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     message = client.messages.create(
       model: Anthropic::Model::CLAUDE_FABLE_5,
       max_tokens: 16000,
       tools: [
         {
           name: "record_summary",
           description: "Record the structured summary of the document.",
           input_schema: {
             type: "object",
             properties: { summary: { type: "string" } },
             required: ["summary"]
           }
         }
       ],
       tool_choice: { type: "tool", name: "record_summary" },
       messages: [
         { role: "user", content: "Summarize: The meeting moved to Thursday." }
       ]
     )
     puts message
     ```
   </CodeGroup>

   之後（Claude Fable 5.1）：將 `tool_choice` 保留為 `auto`，在指令中指名工具，並設定 `strict: true` 使呼叫符合您的結構描述（schema）。（在 [CMEK](https://platform.claude.com/docs/zh-TW/manage-claude/cmek) 組織中，[結構化輸出](https://platform.claude.com/docs/zh-TW/build-with-claude/structured-outputs)（包括 `strict: true`）在 Claude Fable 模型上不可用，請僅依賴指令。）例如：

   <CodeGroup>
     ```bash cURL
     curl -sS https://api.anthropic.com/v1/messages \
       -H "content-type: application/json" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01" \
       -d '{
         "model": "claude-fable-5-1",
         "max_tokens": 16000,
         "tools": [
           {
             "name": "record_summary",
             "description": "Record the structured summary of the document.",
             "strict": true,
             "input_schema": {
               "type": "object",
               "properties": {"summary": {"type": "string"}},
               "required": ["summary"],
               "additionalProperties": false
             }
           }
         ],
         "tool_choice": {"type": "auto"},
         "messages": [
           {"role": "user", "content": "Summarize: The meeting moved to Thursday. Call the record_summary tool with your result."}
         ]
       }'
     ```

     ```bash CLI
     ant messages create <<'YAML'
     model: claude-fable-5-1
     max_tokens: 16000
     tools:
       - name: record_summary
         description: Record the structured summary of the document.
         strict: true
         input_schema:
           type: object
           properties:
             summary:
               type: string
           required: [summary]
           additionalProperties: false
     tool_choice:
       type: auto
     messages:
       - role: user
         content: "Summarize: The meeting moved to Thursday. Call the record_summary tool with your result."
     YAML
     ```

     ```python Python
     client = anthropic.Anthropic()

     record_summary_tool = {
         "name": "record_summary",
         "description": "Record the structured summary of the document.",
         "strict": True,
         "input_schema": {
             "type": "object",
             "properties": {"summary": {"type": "string"}},
             "required": ["summary"],
             "additionalProperties": False,
         },
     }

     response = client.messages.create(
         model="claude-fable-5-1",
         max_tokens=16000,
         tools=[record_summary_tool],
         tool_choice={"type": "auto"},
         messages=[
             {
                 "role": "user",
                 "content": "Summarize: The meeting moved to Thursday. Call the record_summary tool with your result.",
             }
         ],
     )
     print(response.content)
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const response = await client.messages.create({
       model: "claude-fable-5-1",
       max_tokens: 16000,
       tools: [
         {
           name: "record_summary",
           description: "Record the structured summary of the document.",
           strict: true,
           input_schema: {
             type: "object",
             properties: { summary: { type: "string" } },
             required: ["summary"],
             additionalProperties: false
           }
         }
       ],
       tool_choice: { type: "auto" },
       messages: [
         {
           role: "user",
           content:
             "Summarize: The meeting moved to Thursday. Call the record_summary tool with your result."
         }
       ]
     });

     console.log(response.content);
     ```

     ```csharp C#
     AnthropicClient client = new();

     var parameters = new MessageCreateParams
     {
         Model = Model.ClaudeFable5_1,
         MaxTokens = 16000,
         Tools = [
             new ToolUnion(new Tool()
             {
                 Name = "record_summary",
                 Description = "Record the structured summary of the document.",
                 Strict = true,
                 InputSchema = new InputSchema(new Dictionary<string, JsonElement>
                 {
                     ["properties"] = JsonSerializer.SerializeToElement(new Dictionary<string, object>
                     {
                         ["summary"] = new { type = "string" },
                     }),
                     ["required"] = JsonSerializer.SerializeToElement(new[] { "summary" }),
                     ["additionalProperties"] = JsonSerializer.SerializeToElement(false),
                 }),
             }),
         ],
         ToolChoice = new ToolChoiceAuto(),
         Messages = [
             new() { Role = Role.User, Content = "Summarize: The meeting moved to Thursday. Call the record_summary tool with your result." }
         ]
     };

     var message = await client.Messages.Create(parameters);
     Console.WriteLine(message);
     ```

     ```go Go
     client := anthropic.NewClient()

     response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
     	Model:     anthropic.ModelClaudeFable5_1,
     	MaxTokens: 16000,
     	Tools: []anthropic.ToolUnionParam{
     		{OfTool: &anthropic.ToolParam{
     			Name:        "record_summary",
     			Description: anthropic.String("Record the structured summary of the document."),
     			Strict:      anthropic.Bool(true),
     			InputSchema: anthropic.ToolInputSchemaParam{
     				Properties: map[string]any{
     					"summary": map[string]any{"type": "string"},
     				},
     				Required: []string{"summary"},
     				ExtraFields: map[string]any{
     					"additionalProperties": false,
     				},
     			},
     		}},
     	},
     	ToolChoice: anthropic.ToolChoiceUnionParam{OfAuto: &anthropic.ToolChoiceAutoParam{}},
     	Messages: []anthropic.MessageParam{
     		anthropic.NewUserMessage(anthropic.NewTextBlock("Summarize: The meeting moved to Thursday. Call the record_summary tool with your result.")),
     	},
     })
     if err != nil {
     	log.Fatal(err)
     }
     fmt.Println(response.RawJSON())
     ```

     ```java Java

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         MessageCreateParams params = MessageCreateParams.builder()
             .model(Model.CLAUDE_FABLE_5_1)
             .maxTokens(16000L)
             .addTool(Tool.builder()
                 .name("record_summary")
                 .description("Record the structured summary of the document.")
                 .inputSchema(InputSchema.builder()
                     .properties(JsonValue.from(Map.of("summary", Map.of("type", "string"))))
                     .putAdditionalProperty("required", JsonValue.from(List.of("summary")))
                     .putAdditionalProperty("additionalProperties", JsonValue.from(false))
                     .build())
                 .strict(true)
                 .build())
             .toolChoice(ToolChoice.ofAuto(ToolChoiceAuto.builder().build()))
             .addUserMessage("Summarize: The meeting moved to Thursday. Call the record_summary tool with your result.")
             .build();

         Message response = client.messages().create(params);
         IO.println(response);
     }
     ```

     ```php PHP
     $client = new Client();

     $message = $client->messages->create(
         maxTokens: 16000,
         messages: [
             ['role' => 'user', 'content' => 'Summarize: The meeting moved to Thursday. Call the record_summary tool with your result.']
         ],
         model: 'claude-fable-5-1',
         toolChoice: ['type' => 'auto'],
         tools: [
             [
                 'name' => 'record_summary',
                 'description' => 'Record the structured summary of the document.',
                 'strict' => true,
                 'input_schema' => [
                     'type' => 'object',
                     'properties' => [
                         'summary' => ['type' => 'string']
                     ],
                     'required' => ['summary'],
                     'additionalProperties' => false
                 ]
             ]
         ],
     );

     echo $message;
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     message = client.messages.create(
       model: "claude-fable-5-1",
       max_tokens: 16000,
       tools: [
         {
           name: "record_summary",
           description: "Record the structured summary of the document.",
           strict: true,
           input_schema: {
             type: "object",
             properties: { summary: { type: "string" } },
             required: ["summary"],
             additionalProperties: false
           }
         }
       ],
       tool_choice: { type: "auto" },
       messages: [
         { role: "user", content: "Summarize: The meeting moved to Thursday. Call the record_summary tool with your result." }
       ]
     )
     puts message
     ```
   </CodeGroup>

   請參閱[嚴格工具使用](https://platform.claude.com/docs/zh-TW/agents-and-tools/tool-use/strict-tool-use)與[強制工具使用](https://platform.claude.com/docs/zh-TW/agents-and-tools/tool-use/define-tools#forcing-tool-use)。如果您強制使用工具只是為了取得符合 schema 的 JSON，請改用 [JSON 輸出](https://platform.claude.com/docs/zh-TW/build-with-claude/structured-outputs#usage)（`output_config.format`）。

   如果是您的應用程式（而非使用者）要求在多輪對話的當前輪次中呼叫特定工具，請在最新的 `user` 輪次之後附加一則[對話中途系統訊息](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages)。指名該工具，說明本輪次必須呼叫它，並告訴 Claude 以該呼叫開始其回應。由於該訊息是附加的，而非寫入頂層 `system` 提示中，先前的輪次保持位元組完全相同，並保留其[提示快取](https://platform.claude.com/docs/zh-TW/build-with-claude/prompt-caching)命中：

   <CodeGroup>
     ```bash cURL
     curl -sS https://api.anthropic.com/v1/messages \
       -H "content-type: application/json" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01" \
       -d '{
         "model": "claude-fable-5-1",
         "max_tokens": 16000,
         "system": "You are a customer support assistant for an online electronics store.",
         "tools": [
           {
             "name": "search_help_center",
             "description": "Search the help center for policy and troubleshooting articles.",
             "strict": true,
             "input_schema": {
               "type": "object",
               "properties": {"query": {"type": "string"}},
               "required": ["query"],
               "additionalProperties": false
             }
           }
         ],
         "messages": [
           {"role": "user", "content": "My headphones from order A1234 arrived yesterday."},
           {"role": "assistant", "content": "Thanks for confirming. How can I help with order A1234?"},
           {"role": "user", "content": "I opened the box. Can I still return them?"},
           {
             "role": "system",
             "content": "Tool-use requirement for the current turn: the application requires a call to the search_help_center tool in your response to the latest message from the user. Begin your response with the search_help_center tool call. Do not reply with text only."
           }
         ]
       }'
     ```

     ```bash CLI
     ant messages create <<'YAML'
     model: claude-fable-5-1
     max_tokens: 16000
     system: You are a customer support assistant for an online electronics store.
     tools:
       - name: search_help_center
         description: Search the help center for policy and troubleshooting articles.
         strict: true
         input_schema:
           type: object
           properties:
             query:
               type: string
           required: [query]
           additionalProperties: false
     messages:
       - role: user
         content: My headphones from order A1234 arrived yesterday.
       - role: assistant
         content: Thanks for confirming. How can I help with order A1234?
       - role: user
         content: I opened the box. Can I still return them?
       - role: system
         content: >-
           Tool-use requirement for the current turn: the application requires a call
           to the search_help_center tool in your response to the user's latest message.
           Begin your response with the search_help_center tool call. Do not reply with
           text only.
     YAML
     ```

     ```python Python
     client = anthropic.Anthropic()

     search_help_center_tool = {
         "name": "search_help_center",
         "description": "Search the help center for policy and troubleshooting articles.",
         "strict": True,
         "input_schema": {
             "type": "object",
             "properties": {"query": {"type": "string"}},
             "required": ["query"],
             "additionalProperties": False,
         },
     }

     response = client.messages.create(
         model="claude-fable-5-1",
         max_tokens=16000,
         system="You are a customer support assistant for an online electronics store.",
         tools=[search_help_center_tool],
         messages=[
             {
                 "role": "user",
                 "content": "My headphones from order A1234 arrived yesterday.",
             },
             {
                 "role": "assistant",
                 "content": "Thanks for confirming. How can I help with order A1234?",
             },
             {"role": "user", "content": "I opened the box. Can I still return them?"},
             # 此應用程式要求在回答任何政策相關問題之前，
             # 必須先查詢說明中心。將此要求以 system message（系統訊息）附加，
             # 可讓先前的對話輪次保持不變。
             {
                 "role": "system",
                 "content": "Tool-use requirement for the current turn: the application requires a call to the search_help_center tool in your response to the user's latest message. Begin your response with the search_help_center tool call. Do not reply with text only.",
             },
         ],
     )
     print(response.content)
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const response = await client.messages.create({
       model: "claude-fable-5-1",
       max_tokens: 16000,
       system: "You are a customer support assistant for an online electronics store.",
       tools: [
         {
           name: "search_help_center",
           description: "Search the help center for policy and troubleshooting articles.",
           strict: true,
           input_schema: {
             type: "object",
             properties: { query: { type: "string" } },
             required: ["query"],
             additionalProperties: false
           }
         }
       ],
       messages: [
         { role: "user", content: "My headphones from order A1234 arrived yesterday." },
         { role: "assistant", content: "Thanks for confirming. How can I help with order A1234?" },
         { role: "user", content: "I opened the box. Can I still return them?" },
         // 此應用程式要求在回答任何政策相關問題之前，
         // 先查詢說明中心。將此要求以 system message（系統訊息）附加，
         // 可讓先前的對話輪次維持不變。
         {
           role: "system",
           content:
             "Tool-use requirement for the current turn: the application requires a call to the search_help_center tool in your response to the user's latest message. Begin your response with the search_help_center tool call. Do not reply with text only."
         }
       ]
     });

     console.log(response.content);
     ```

     ```csharp C#
     AnthropicClient client = new();

     var parameters = new MessageCreateParams
     {
         Model = Model.ClaudeFable5_1,
         MaxTokens = 16000,
         System = "You are a customer support assistant for an online electronics store.",
         Tools = [
             new ToolUnion(new Tool()
             {
                 Name = "search_help_center",
                 Description = "Search the help center for policy and troubleshooting articles.",
                 Strict = true,
                 InputSchema = new InputSchema(new Dictionary<string, JsonElement>
                 {
                     ["properties"] = JsonSerializer.SerializeToElement(new Dictionary<string, object>
                     {
                         ["query"] = new { type = "string" },
                     }),
                     ["required"] = JsonSerializer.SerializeToElement(new[] { "query" }),
                     ["additionalProperties"] = JsonSerializer.SerializeToElement(false),
                 }),
             }),
         ],
         Messages = [
             new() { Role = Role.User, Content = "My headphones from order A1234 arrived yesterday." },
             new() { Role = Role.Assistant, Content = "Thanks for confirming. How can I help with order A1234?" },
             new() { Role = Role.User, Content = "I opened the box. Can I still return them?" },
             // 此應用程式要求在回答任何政策相關問題之前，
             // 必須先查詢說明中心。將此要求以系統訊息附加，可讓
             // 先前的對話輪次保持不變。
             new()
             {
                 Role = Role.System,
                 Content = "Tool-use requirement for the current turn: the application requires a call to the search_help_center tool in your response to the user's latest message. Begin your response with the search_help_center tool call. Do not reply with text only."
             }
         ]
     };

     var message = await client.Messages.Create(parameters);
     Console.WriteLine(message);
     ```

     ```go Go
     client := anthropic.NewClient()

     response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
     	Model:     anthropic.ModelClaudeFable5_1,
     	MaxTokens: 16000,
     	System: []anthropic.TextBlockParam{
     		{Text: "You are a customer support assistant for an online electronics store."},
     	},
     	Tools: []anthropic.ToolUnionParam{
     		{OfTool: &anthropic.ToolParam{
     			Name:        "search_help_center",
     			Description: anthropic.String("Search the help center for policy and troubleshooting articles."),
     			Strict:      anthropic.Bool(true),
     			InputSchema: anthropic.ToolInputSchemaParam{
     				Properties: map[string]any{
     					"query": map[string]any{"type": "string"},
     				},
     				Required: []string{"query"},
     				ExtraFields: map[string]any{
     					"additionalProperties": false,
     				},
     			},
     		}},
     	},
     	Messages: []anthropic.MessageParam{
     		anthropic.NewUserMessage(anthropic.NewTextBlock("My headphones from order A1234 arrived yesterday.")),
     		anthropic.NewAssistantMessage(anthropic.NewTextBlock("Thanks for confirming. How can I help with order A1234?")),
     		anthropic.NewUserMessage(anthropic.NewTextBlock("I opened the box. Can I still return them?")),
     		// 應用程式要求在回答任何政策相關問題之前，
     		// 必須先查詢說明中心。將此要求附加為系統訊息，可讓
     		// 先前的對話輪次保持不變。
     		{
     			Role: anthropic.MessageParamRoleSystem,
     			Content: []anthropic.ContentBlockParamUnion{
     				anthropic.NewTextBlock("Tool-use requirement for the current turn: the application requires a call to the search_help_center tool in your response to the user's latest message. Begin your response with the search_help_center tool call. Do not reply with text only."),
     			},
     		},
     	},
     })
     if err != nil {
     	log.Fatal(err)
     }
     fmt.Println(response.RawJSON())
     ```

     ```java Java

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         MessageCreateParams params = MessageCreateParams.builder()
             .model(Model.CLAUDE_FABLE_5_1)
             .maxTokens(16000L)
             .system("You are a customer support assistant for an online electronics store.")
             .addTool(Tool.builder()
                 .name("search_help_center")
                 .description("Search the help center for policy and troubleshooting articles.")
                 .inputSchema(InputSchema.builder()
                     .properties(JsonValue.from(Map.of("query", Map.of("type", "string"))))
                     .putAdditionalProperty("required", JsonValue.from(List.of("query")))
                     .putAdditionalProperty("additionalProperties", JsonValue.from(false))
                     .build())
                 .strict(true)
                 .build())
             .addUserMessage("My headphones from order A1234 arrived yesterday.")
             .addAssistantMessage("Thanks for confirming. How can I help with order A1234?")
             .addUserMessage("I opened the box. Can I still return them?")
             // 應用程式要求在回答任何政策相關問題之前
             // 先查詢說明中心。將此要求以系統訊息附加，可讓
             // 先前的對話輪次保持不變。
             .addMessage(MessageParam.builder()
                 .role(MessageParam.Role.SYSTEM)
                 .content("Tool-use requirement for the current turn: the application requires a call to the search_help_center tool in your response to the user's latest message. Begin your response with the search_help_center tool call. Do not reply with text only.")
                 .build())
             .build();

         Message response = client.messages().create(params);
         IO.println(response);
     }
     ```

     ```php PHP
     $client = new Client();

     $message = $client->messages->create(
         maxTokens: 16000,
         messages: [
             ['role' => 'user', 'content' => 'My headphones from order A1234 arrived yesterday.'],
             ['role' => 'assistant', 'content' => 'Thanks for confirming. How can I help with order A1234?'],
             ['role' => 'user', 'content' => 'I opened the box. Can I still return them?'],
             // 此應用程式要求在回答任何政策相關問題之前，
             // 先查詢說明中心。將此要求以 system message（系統訊息）附加，
             // 可讓先前的對話輪次保持不變。
             ['role' => 'system', 'content' => 'Tool-use requirement for the current turn: the application requires a call to the search_help_center tool in your response to the user\'s latest message. Begin your response with the search_help_center tool call. Do not reply with text only.']
         ],
         model: 'claude-fable-5-1',
         system: 'You are a customer support assistant for an online electronics store.',
         tools: [
             [
                 'name' => 'search_help_center',
                 'description' => 'Search the help center for policy and troubleshooting articles.',
                 'strict' => true,
                 'input_schema' => [
                     'type' => 'object',
                     'properties' => [
                         'query' => ['type' => 'string']
                     ],
                     'required' => ['query'],
                     'additionalProperties' => false
                 ]
             ]
         ],
     );

     echo $message;
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     message = client.messages.create(
       model: "claude-fable-5-1",
       max_tokens: 16000,
       system: "You are a customer support assistant for an online electronics store.",
       tools: [
         {
           name: "search_help_center",
           description: "Search the help center for policy and troubleshooting articles.",
           strict: true,
           input_schema: {
             type: "object",
             properties: { query: { type: "string" } },
             required: ["query"],
             additionalProperties: false
           }
         }
       ],
       messages: [
         { role: "user", content: "My headphones from order A1234 arrived yesterday." },
         { role: "assistant", content: "Thanks for confirming. How can I help with order A1234?" },
         { role: "user", content: "I opened the box. Can I still return them?" },
         # 此應用程式要求在回答任何政策相關問題之前，
         # 必須先查詢說明中心。將此要求附加為 system message（系統訊息），可讓
         # 先前的對話輪次保持不變。
         {
           role: "system",
           content: "Tool-use requirement for the current turn: the application requires a call to the search_help_center tool in your response to the user's latest message. Begin your response with the search_help_center tool call. Do not reply with text only."
         }
       ]
     )
     puts message
     ```
   </CodeGroup>

   在後續請求中，請將 `role: "system"` 訊息保留在歷史記錄中，如同任何其他輪次一樣。對話中途系統訊息不需要 beta 標頭。對於不得呼叫工具的輪次，`tool_choice: {"type": "none"}` 仍然有效。

2. **只有 Claude Fable 5.1 與 Claude Mythos 5.1 能讀取 Claude Fable 5.1 的思考區塊：**&#x6BCF;個 `thinking` 區塊都會記錄產生它的模型。Claude Fable 5.1 可讀取自己的區塊，以及來自 Claude Mythos 5.1、Claude Opus 5、Claude Fable 5、Claude Mythos 5 和更早 Claude 模型的區塊。從上述任一模型轉移到 `claude-fable-5-1` 的對話會保留其先前的推理。此條件是單向的：除了 Claude Mythos 5.1 之外，這些模型都無法讀取 Claude Fable 5.1 的區塊。

   在 Claude Fable 5.1 上執行過的對話，可能會透過路由器切換、用戶端重試或[分類器拒絕備援](https://platform.claude.com/docs/zh-TW/build-with-claude/refusals-and-fallback)（包括[伺服器端備援](https://platform.claude.com/docs/zh-TW/build-with-claude/refusals-and-fallback#server-side-fallback)）轉到另一個較舊或較新的模型。API 會在該模型看到之前移除它無法讀取的區塊，請求會成功，且您不會因被捨棄的輸入 token 而被計費。目標模型會在沒有該推理的情況下重新規劃，這可能會提高切換後第一個輪次的成本與「latency」（延遲）。若要查看被捨棄的內容，請傳送 `thinking-binding-controls-2026-08-01` [beta 標頭](https://platform.claude.com/docs/zh-TW/api/beta-headers)：回應將帶有一個 `input_transformations` 陣列，以 `reason: "model_binding_mismatch"` 列出每個被捨棄的區塊。請參閱[在對話中途切換模型](https://platform.claude.com/docs/zh-TW/build-with-claude/preserved-thinking#switching-models)。

3. **編輯先前的輪次會使思考區塊失效：**&#x4F86;自 Claude Fable 5.1 的每個 `thinking` 區塊僅對其之前的 `system` 提示、`tools` 與對話歷史有效。如果由 Claude Code、claude.ai、[Claude Managed Agents](https://platform.claude.com/docs/zh-TW/managed-agents/overview) 或 [Claude Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview) 管理您的對話歷史，它已經會保持該前綴完整。如果您的程式碼自行建構 `messages` 陣列，則本項目適用於您，而[保留的思考](https://platform.claude.com/docs/zh-TW/build-with-claude/preserved-thinking)是完整的整合指南。在強制執行此檢查的情況下，若在上述任一項變更後將區塊傳回，該請求會以 400 錯誤被拒絕：

   ```text wrap
   messages.5.content.0: Invalid `signature` in `thinking` block. The block is bound to a different conversation. Remove the block, or set `thinking.block_binding.prefix_mismatch_behavior` to "drop_block". That setting requires the `thinking-binding-controls-2026-08-01` value in the `anthropic-beta` header.
   ```

   API 會對 2026 年 8 月 31 日當天或之後建立的新帳戶強制執行此檢查。對於較早建立的帳戶，API 會記錄不符情況，但不會採取行動，除非請求設定了 `thinking.block_binding.prefix_mismatch_behavior`，以選擇加入強制執行。在這些帳戶上，如果您傳送 `thinking-binding-controls-2026-08-01` beta 標頭且未設定該欄位，回應會在 `input_transformations` 中以 `thinking_mismatch_allowed` 項目列出每個未通過檢查的區塊。無論您的帳戶建立時間為何，都請讓您的應用程式與此檢查相容：相同的模式可以保持提示快取處於暖狀態，而且您可以從任何帳戶傳送 `prefix_mismatch_behavior` 來針對此檢查進行測試。如果您發布的工具或框架是讓使用者以自己的「API key」（API 金鑰）執行，請在發布前以這種方式進行測試：您的金鑰很可能屬於較舊的帳戶，而使用新帳戶的使用者會比您更早遇到此檢查。若要確認您自己的帳戶是否預設強制執行，請在不帶 beta 標頭的情況下傳送一個編輯歷史記錄的請求：如果回傳指名該標頭的 400 錯誤，即表示已強制執行。

   對於該請求主體而言，此錯誤是永久性的：自動重試迴圈無法清除它。若要在沒有失效推理的情況下繼續而非失敗，請從歷史記錄中移除 `thinking` 區塊並重試一次，或傳送 `thinking-binding-controls-2026-08-01` [beta 標頭](https://platform.claude.com/docs/zh-TW/api/beta-headers)並將 `prefix_mismatch_behavior` 設為 `"drop_block"`（預設為 `"error"`）。使用 `"drop_block"` 時，API 會丟棄不符的區塊以及對話中其後的每個思考區塊，並在回應的 `input_transformations` 陣列中以 `reason: "prefix_binding_mismatch"` 回報每一個：

   <CodeGroup>
     ```bash cURL
     curl https://api.anthropic.com/v1/messages \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01" \
       -H "anthropic-beta: thinking-binding-controls-2026-08-01" \
       -H "content-type: application/json" \
       -d '{
         "model": "claude-fable-5-1",
         "max_tokens": 16000,
         "thinking": {
           "type": "adaptive",
           "block_binding": {
             "prefix_mismatch_behavior": "drop_block"
           }
         },
         "messages": [
           {
             "role": "user",
             "content": "What is the greatest common divisor of 1071 and 462?"
           }
         ]
       }'
     ```

     ```bash CLI
     ant beta:messages create \
       --beta thinking-binding-controls-2026-08-01 \
       --transform '{content.#(type=="text")#.text,input_transformations}' \
       --format yaml <<'YAML'
     model: claude-fable-5-1
     max_tokens: 16000
     thinking:
       type: adaptive
       block_binding:
         prefix_mismatch_behavior: drop_block
     messages:
       - role: user
         content: What is the greatest common divisor of 1071 and 462?
     YAML
     ```

     ```python Python
     client = anthropic.Anthropic()

     response = client.beta.messages.create(
         model="claude-fable-5-1",
         max_tokens=16000,
         thinking={
             "type": "adaptive",
             "block_binding": {"prefix_mismatch_behavior": "drop_block"},
         },
         messages=[
             {
                 "role": "user",
                 "content": "What is the greatest common divisor of 1071 and 462?",
             }
         ],
         betas=["thinking-binding-controls-2026-08-01"],
     )

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

     print(f"Input transformations: {len(response.input_transformations or [])}")
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const response = await client.beta.messages.create({
       model: "claude-fable-5-1",
       max_tokens: 16000,
       thinking: {
         type: "adaptive",
         block_binding: { prefix_mismatch_behavior: "drop_block" }
       },
       messages: [
         { role: "user", content: "What is the greatest common divisor of 1071 and 462?" }
       ],
       betas: ["thinking-binding-controls-2026-08-01"]
     });

     for (const block of response.content) {
       if (block.type === "text") {
         console.log(block.text);
       }
     }
     console.log(`Input transformations: ${response.input_transformations?.length ?? 0}`);
     ```

     ```csharp C#
     using Anthropic.Models.Beta;
     using Anthropic.Models.Beta.Messages;
     using Model = Anthropic.Models.Messages.Model;

     AnthropicClient client = new();

     var response = await client.Beta.Messages.Create(
         new()
         {
             Model = Model.ClaudeFable5_1,
             MaxTokens = 16000,
             Thinking = new BetaThinkingConfigAdaptive
             {
                 BlockBinding = new()
                 {
                     PrefixMismatchBehavior = BetaThinkingPrefixMismatchBehavior.DropBlock,
                 },
             },
             Messages =
             [
                 new()
                 {
                     Role = Role.User,
                     Content = "What is the greatest common divisor of 1071 and 462?",
                 },
             ],
             Betas = [AnthropicBeta.ThinkingBindingControls2026_08_01],
         }
     );

     foreach (var block in response.Content)
     {
         if (block.TryPickText(out var textBlock))
         {
             Console.WriteLine(textBlock.Text);
         }
     }

     Console.WriteLine($"Input transformations: {response.InputTransformations?.Count ?? 0}");
     ```

     ```go Go
     client := anthropic.NewClient()

     response, err := client.Beta.Messages.New(context.TODO(), anthropic.BetaMessageNewParams{
     	Model:     anthropic.ModelClaudeFable5_1,
     	MaxTokens: 16000,
     	Thinking: anthropic.BetaThinkingConfigParamUnion{
     		OfAdaptive: &anthropic.BetaThinkingConfigAdaptiveParam{
     			BlockBinding: anthropic.BetaThinkingBlockBindingParam{
     				PrefixMismatchBehavior: anthropic.BetaThinkingPrefixMismatchBehaviorDropBlock,
     			},
     		},
     	},
     	Messages: []anthropic.BetaMessageParam{
     		anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("What is the greatest common divisor of 1071 and 462?")),
     	},
     	Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaThinkingBindingControls2026_08_01},
     })
     if err != nil {
     	log.Fatal(err)
     }

     for _, block := range response.Content {
     	if textBlock, ok := block.AsAny().(anthropic.BetaTextBlock); ok {
     		fmt.Println(textBlock.Text)
     	}
     }
     fmt.Printf("Input transformations: %d\n", len(response.InputTransformations))
     ```

     ```java Java
     import com.anthropic.models.beta.AnthropicBeta;
     import com.anthropic.models.beta.messages.BetaMessage;
     import com.anthropic.models.beta.messages.BetaThinkingBlockBinding;
     import com.anthropic.models.beta.messages.BetaThinkingConfigAdaptive;
     import com.anthropic.models.beta.messages.BetaThinkingPrefixMismatchBehavior;
     import com.anthropic.models.beta.messages.MessageCreateParams;
     import com.anthropic.models.messages.Model;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         MessageCreateParams params = MessageCreateParams.builder()
             .model(Model.CLAUDE_FABLE_5_1)
             .maxTokens(16000L)
             .addBeta(AnthropicBeta.THINKING_BINDING_CONTROLS_2026_08_01)
             .thinking(BetaThinkingConfigAdaptive.builder()
                 .blockBinding(BetaThinkingBlockBinding.builder()
                     .prefixMismatchBehavior(BetaThinkingPrefixMismatchBehavior.DROP_BLOCK)
                     .build())
                 .build())
             .addUserMessage("What is the greatest common divisor of 1071 and 462?")
             .build();

         BetaMessage response = client.beta().messages().create(params);

         response.content().stream()
             .flatMap(block -> block.text().stream())
             .forEach(textBlock -> IO.println(textBlock.text()));
         IO.println("Input transformations: "
             + response.inputTransformations().map(List::size).orElse(0));
     }
     ```

     ```php PHP
     use Anthropic\Beta\AnthropicBeta;
     use Anthropic\Beta\Messages\BetaThinkingBlockBinding;
     use Anthropic\Beta\Messages\BetaThinkingConfigAdaptive;
     use Anthropic\Beta\Messages\BetaThinkingPrefixMismatchBehavior;
     use Anthropic\Client;

     $client = new Client();

     $response = $client->beta->messages->create(
         model: 'claude-fable-5-1',
         maxTokens: 16000,
         thinking: BetaThinkingConfigAdaptive::with(
             blockBinding: BetaThinkingBlockBinding::with(
                 prefixMismatchBehavior: BetaThinkingPrefixMismatchBehavior::DROP_BLOCK,
             ),
         ),
         messages: [
             ['role' => 'user', 'content' => 'What is the greatest common divisor of 1071 and 462?'],
         ],
         betas: [AnthropicBeta::THINKING_BINDING_CONTROLS_2026_08_01],
     );

     foreach ($response->content as $block) {
         if ($block->type === 'text') {
             echo $block->text, PHP_EOL;
         }
     }

     echo 'Input transformations: ', count($response->inputTransformations ?? []), PHP_EOL;
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     response = client.beta.messages.create(
       model: "claude-fable-5-1",
       max_tokens: 16_000,
       thinking: {
         type: "adaptive",
         block_binding: {prefix_mismatch_behavior: "drop_block"}
       },
       messages: [
         {role: "user", content: "What is the greatest common divisor of 1071 and 462?"}
       ],
       betas: [Anthropic::AnthropicBeta::THINKING_BINDING_CONTROLS_2026_08_01]
     )

     response.content.each do |block|
       puts block.text if block.type == :text
     end

     puts "Input transformations: #{response.input_transformations&.length || 0}"
     ```
   </CodeGroup>

   [token 計數](https://platform.claude.com/docs/zh-TW/build-with-claude/token-counting)端點執行相同的檢查。關於回應形狀與「streaming」（串流）中的位置，請參閱[未保留區塊的控制項（beta）](https://platform.claude.com/docs/zh-TW/build-with-claude/thinking#preserved-thinking-controls)。

   會使後續思考區塊失效的模式，以及替代做法：

   * 編輯、重新排序或移除較早的輪次。這包括刪除舊的工具結果、從對話記錄中間剪除輪次，以及在摘要後方逐字保留最近輪次及其思考區塊的用戶端「compaction」（壓縮）（包括在幾個輪次後才換入摘要的背景壓縮）。請改用伺服器端[壓縮](https://platform.claude.com/docs/zh-TW/build-with-claude/compaction)或「[context editing](https://platform.claude.com/docs/zh-TW/build-with-claude/context-editing)」（上下文編輯）（對舊工具結果使用[工具結果清除](https://platform.claude.com/docs/zh-TW/build-with-claude/context-editing#tool-result-clearing)），或使用[在伺服器上修剪上下文](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-trim-context)中的其中一種用戶端壓縮形式。
   * 注入您不會保存的內容，例如附加在 `tool_result` 區塊之後、並在下一個請求中移除的每輪提醒。請改為將提醒作為[輪次範圍系統訊息](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages#turn-scoped-system-messages)傳送，並將其保留在歷史記錄中。
   * 在同一對話的請求之間重建頂層 `system` 提示或 `tools` 陣列，例如為了更新目前日期，或新增或移除工具。請改為附加一則攜帶新指示（「目前日期是 2026-09-14。」）或 `tool_addition` 和 `tool_removal` 區塊的[對話中途系統訊息](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages)。 一開始未在 `tools` 中宣告的工具，可以[在 `tool_addition` 區塊內定義](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages#define-tools-in-a-message-beta)（beta 標頭 `inline-tools-2026-09-15`）。
   * 在後續請求中提供不同位元組的圖片或文件 URL。此檢查涵蓋的是位元組，而非 URL 字串，因此同一檔案的輪換簽署 URL 沒有問題。對於跨輪次引用的內容，請使用 [Files API](https://platform.claude.com/docs/zh-TW/build-with-claude/files) 上傳一次並傳送 `file_id`，或傳送 base64。

   每種替代做法也會保持先前輪次位元組完全相同，並保留編輯歷史記錄、`system` 提示或 `tools` 陣列會失去的[提示快取](https://platform.claude.com/docs/zh-TW/build-with-claude/prompt-caching)命中。

   持續有效的模式：

   * 僅附加的歷史記錄：新增輪次，並將先前的輪次完全按照傳送與接收時的樣子傳回，包括附加的 `role: "system"` 訊息。
   * 從先前的助理輪次中移除思考區塊，由最舊的開始。
   * 變更 `effort`、`max_tokens` 或 `system`、`tools` 與 `messages` 之外的任何其他請求參數，以及新增或移動 `cache_control` 標記。
   * 伺服器端壓縮與上下文編輯，包括[思考區塊清除](https://platform.claude.com/docs/zh-TW/build-with-claude/context-editing#thinking-block-clearing)。它們不算作編輯，因為此檢查比較的是您所傳送的對話。

   檢查現有整合的方法：

   1. 擷取它在幾個正常輪次中傳送的確切請求主體，如果您的產品有壓縮或工具變更，也請包含在內。對於每一對連續的請求，比較 `system` 提示、`tools` 陣列以及 `messages` 的共同前綴。在新附加的輪次之前，它們應該位元組完全相同。一個預期中的例外是換入來自[隨需壓縮](https://platform.claude.com/docs/zh-TW/build-with-claude/compaction-on-demand)之已簽署 `compaction` 區塊的請求：該區塊會取代 `messages` 開頭被其摘要的訊息，而其後的所有內容仍應一致。
   2. 使用 `thinking-binding-controls-2026-08-01` beta 標頭和 `prefix_mismatch_behavior: "drop_block"`，針對 `claude-fable-5-1` 執行一個正常的多輪工作階段，並記錄每個回應的 `input_transformations`。每個輪次都是空陣列，表示歷史記錄完整。帶有 `reason: "prefix_binding_mismatch"` 的項目，表示自上一個請求以來，位於 `path` 的區塊之前有內容發生了變更。帶有 `reason: "model_binding_mismatch"` 的項目，表示對話切換了模型，這並非您程式碼中的錯誤。這在任何帳戶上都有效，因為設定該欄位會讓請求選擇加入強制執行。在 CI 中，請改為設定 `"error"`，讓編輯導致執行失敗。
   3. 選擇正式環境的設定。如果前綴不符只可能代表您程式碼中的錯誤，請保留預設的 `"error"`；或設定 `"drop_block"` 以捨棄受影響的區塊而非失敗。無論哪種方式，都請監控 400 錯誤或 `input_transformations` 項目。

   僅丟棄一次思考區塊（例如在壓縮邊界處）影響甚微。若整合在每個請求上都使先前的思考失效，則每次都會重新啟動提示快取，這可能會提高每項任務的成本（請參閱[保持對話歷史僅附加](https://platform.claude.com/docs/zh-TW/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#keep-the-conversation-history-append-only)）。

### 行為變更

1. **長代理迴圈中的平行工具呼叫較少：**&#x5728;長時間執行的迴圈中，若下一批獨立讀取僅由任務隱含（自訂程式碼代理、bash 與編輯器框架、電腦使用），Claude Fable 5.1 可能每輪只發出一個工具呼叫。每個額外的輪次都會耗費 token、一次往返以及實際時間。請在每則使用者訊息之後附加一句批次處理指令，作為[輪次範圍系統訊息](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages#turn-scoped-system-messages)（`clear_at: "next_user_message"`，beta），或者在沒有 beta 的情況下，放在 `tool_result` 區塊之後的文字區塊中，並在後續請求中將先前的副本保留在歷史記錄中。請參閱[在代理迴圈中批次處理獨立工具呼叫](https://platform.claude.com/docs/zh-TW/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#batch-independent-tool-calls-in-agent-loops)。

2. **工具呼叫之間的進度訊息較少：**&#x8207; Claude Fable 5 相比，Claude Fable 5.1 在長工具序列期間撰寫的狀態更新較少，其代理式程式碼摘要也較短。如果您的介面會呈現這些更新，請將 `thinking.display` 設為 `"updates"`（beta）或 `"summarized"`，並明確提示要求它們。請參閱[工具呼叫之間的進度更新](https://platform.claude.com/docs/zh-TW/build-with-claude/thinking#progress-updates)與[要求面向使用者的進度更新](https://platform.claude.com/docs/zh-TW/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#ask-for-user-facing-progress-updates)。

3. **低 effort 下的搜尋與檢索呼叫較少：**&#x5728; `low` effort 下，Claude Fable 5.1 比 Claude Fable 5 更常憑記憶回答，而非呼叫搜尋或檢索工具。如果您的產品依賴低 effort 下的檢索，請為這些請求提高 effort，或告訴模型何時進行搜尋。請參閱[低 effort 下的搜尋觸發](https://platform.claude.com/docs/zh-TW/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#search-triggering-at-low-effort)。

關於散文密度、聊天格式、摘要中的引用以及檔案編輯方面的差異（這些不影響 API 整合），請參閱[相較於 Claude Fable 5 的變更](https://platform.claude.com/docs/zh-TW/models/fable-5-1/whats-new-fable-5-1#changed-from-claude-fable-5)。

### 建議變更

這些變更並非必要，但每一項都能降低成本或延遲，或消除一種失敗模式：

1. **在對話中途變更 effort（beta）：**&#x5728; Claude Fable 5 上，`output_config.effort` 是請求層級的，在請求之間變更它會丟棄先前輪次的快取前綴。在 `claude-fable-5-1` 上，僅攜帶 `output_config` 的 `role: "system"` 訊息可為困難步驟提高 effort，或為例行步驟降低 effort，而不會使[提示快取](https://platform.claude.com/docs/zh-TW/build-with-claude/prompt-caching)失效：

   <CodeGroup>
     ```bash cURL
     # 僅含 effort 的系統訊息：新等級將從下一個使用者回合起生效。
     curl https://api.anthropic.com/v1/messages \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01" \
       -H "anthropic-beta: mid-conversation-output-config-2026-07-01" \
       -H "content-type: application/json" \
       -d '{
         "model": "claude-fable-5-1",
         "max_tokens": 4096,
         "output_config": {"effort": "high"},
         "messages": [
           {"role": "user", "content": "Plan a migration from SQLite to PostgreSQL in three short steps."},
           {"role": "assistant", "content": "1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts."},
           {"role": "system", "content": [], "output_config": {"effort": "low"}},
           {"role": "user", "content": "Summarize the plan in one sentence."}
         ]
       }'
     ```

     ```bash CLI
     ant beta:messages create \
       --beta mid-conversation-output-config-2026-07-01 \
       --transform 'content.#(type=="text").text' \
       --raw-output <<'YAML'
     model: claude-fable-5-1
     max_tokens: 4096
     output_config:
       effort: high
     messages:
       - role: user
         content: Plan a migration from SQLite to PostgreSQL in three short steps.
       - role: assistant
         content: "1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts."
       # 僅含 effort 的系統訊息：新等級自下一個使用者回合起生效。
       - role: system
         content: []
         output_config:
           effort: low
       - role: user
         content: Summarize the plan in one sentence.
     YAML
     ```

     ```python Python
     client = anthropic.Anthropic()

     response = client.beta.messages.create(
         model="claude-fable-5-1",
         max_tokens=4096,
         output_config={"effort": "high"},
         messages=[
             {
                 "role": "user",
                 "content": "Plan a migration from SQLite to PostgreSQL in three short steps.",
             },
             {
                 "role": "assistant",
                 "content": "1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts.",
             },
             # 僅含 effort 的系統訊息：新等級將自下一個使用者回合起生效。
             {"role": "system", "content": [], "output_config": {"effort": "low"}},
             {"role": "user", "content": "Summarize the plan in one sentence."},
         ],
         betas=["mid-conversation-output-config-2026-07-01"],
     )

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

     ```typescript TypeScript
     const client = new Anthropic();

     const response = await client.beta.messages.create({
       model: "claude-fable-5-1",
       max_tokens: 4096,
       output_config: { effort: "high" },
       messages: [
         {
           role: "user",
           content: "Plan a migration from SQLite to PostgreSQL in three short steps."
         },
         {
           role: "assistant",
           content:
             "1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts."
         },
         // 僅含 effort 的系統訊息：新等級自下一個使用者回合起生效。
         { role: "system", content: [], output_config: { effort: "low" } },
         { role: "user", content: "Summarize the plan in one sentence." }
       ],
       betas: ["mid-conversation-output-config-2026-07-01"]
     });

     for (const block of response.content) {
       if (block.type === "text") {
         console.log(block.text);
       }
     }
     ```

     ```csharp C#
     using Anthropic.Models.Beta;
     using Anthropic.Models.Beta.Messages;
     using Model = Anthropic.Models.Messages.Model;

     AnthropicClient client = new();

     var response = await client.Beta.Messages.Create(new MessageCreateParams
     {
         Model = Model.ClaudeFable5_1,
         MaxTokens = 4096,
         OutputConfig = new() { Effort = Effort.High },
         Messages =
         [
             new() { Role = Role.User, Content = "Plan a migration from SQLite to PostgreSQL in three short steps." },
             new() { Role = Role.Assistant, Content = "1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts." },
             // 僅含 effort 的系統訊息：新等級將自下一個使用者回合起生效。
             new()
             {
                 Role = Role.System,
                 Content = new([]),
                 OutputConfig = new() { Effort = BetaSystemMessageOutputConfigEffort.Low },
             },
             new() { Role = Role.User, Content = "Summarize the plan in one sentence." },
         ],
         Betas = [AnthropicBeta.MidConversationOutputConfig2026_07_01],
     });

     foreach (var block in response.Content)
     {
         if (block.TryPickText(out var textBlock))
         {
             Console.WriteLine(textBlock.Text);
         }
     }
     ```

     ```go Go
     client := anthropic.NewClient()

     response, err := client.Beta.Messages.New(context.Background(), anthropic.BetaMessageNewParams{
     	Model:     anthropic.ModelClaudeFable5_1,
     	MaxTokens: 4096,
     	OutputConfig: anthropic.BetaOutputConfigParam{
     		Effort: anthropic.BetaOutputConfigEffortHigh,
     	},
     	Messages: []anthropic.BetaMessageParam{
     		anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Plan a migration from SQLite to PostgreSQL in three short steps.")),
     		{
     			Role:    anthropic.BetaMessageParamRoleAssistant,
     			Content: []anthropic.BetaContentBlockParamUnion{anthropic.NewBetaTextBlock("1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts.")},
     		},
     		// 僅含 effort 的系統訊息：新等級自下一個使用者回合起生效。
     		anthropic.NewBetaSystemMessage(anthropic.BetaSystemMessageOutputConfigParam{
     			Effort: anthropic.BetaSystemMessageOutputConfigEffortLow,
     		}),
     		anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("Summarize the plan in one sentence.")),
     	},
     	Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaMidConversationOutputConfig2026_07_01},
     })
     if err != nil {
     	log.Fatal(err)
     }

     for _, block := range response.Content {
     	if textBlock, ok := block.AsAny().(anthropic.BetaTextBlock); ok {
     		fmt.Println(textBlock.Text)
     	}
     }
     ```

     ```java Java
     import com.anthropic.models.beta.AnthropicBeta;
     import com.anthropic.models.beta.messages.BetaMessage;
     import com.anthropic.models.beta.messages.BetaMessageParam;
     import com.anthropic.models.beta.messages.BetaOutputConfig;
     import com.anthropic.models.beta.messages.BetaSystemMessageOutputConfig;
     import com.anthropic.models.beta.messages.MessageCreateParams;
     import com.anthropic.models.messages.Model;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         MessageCreateParams params = MessageCreateParams.builder()
             .model(Model.CLAUDE_FABLE_5_1)
             .maxTokens(4096L)
             .addBeta(AnthropicBeta.MID_CONVERSATION_OUTPUT_CONFIG_2026_07_01)
             .outputConfig(BetaOutputConfig.builder()
                 .effort(BetaOutputConfig.Effort.HIGH)
                 .build())
             .addUserMessage("Plan a migration from SQLite to PostgreSQL in three short steps.")
             .addAssistantMessage("1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts.")
             // 僅含 effort 的系統訊息：新等級自下一個使用者回合起生效。
             .addMessage(BetaMessageParam.builder()
                 .role(BetaMessageParam.Role.SYSTEM)
                 .contentOfBetaContentBlockParams(List.of())
                 .outputConfig(BetaSystemMessageOutputConfig.builder()
                     .effort(BetaSystemMessageOutputConfig.Effort.LOW)
                     .build())
                 .build())
             .addUserMessage("Summarize the plan in one sentence.")
             .build();

         BetaMessage response = client.beta().messages().create(params);
         response.content().stream()
             .flatMap(block -> block.text().stream())
             .forEach(textBlock -> IO.println(textBlock.text()));
     }
     ```

     ```php PHP
     use Anthropic\Beta\AnthropicBeta;
     use Anthropic\Beta\Messages\BetaMessageParam;
     use Anthropic\Beta\Messages\BetaOutputConfig;
     use Anthropic\Beta\Messages\BetaSystemMessageOutputConfig;
     use Anthropic\Client;

     $client = new Client();

     $response = $client->beta->messages->create(
         model: 'claude-fable-5-1',
         maxTokens: 4096,
         outputConfig: BetaOutputConfig::with(effort: 'high'),
         messages: [
             BetaMessageParam::with(role: 'user', content: 'Plan a migration from SQLite to PostgreSQL in three short steps.'),
             BetaMessageParam::with(role: 'assistant', content: '1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts.'),
             // 僅含 effort 的系統訊息：新等級自下一個使用者回合起生效。
             BetaMessageParam::with(
                 role: 'system',
                 content: [],
                 outputConfig: BetaSystemMessageOutputConfig::with(effort: 'low'),
             ),
             BetaMessageParam::with(role: 'user', content: 'Summarize the plan in one sentence.'),
         ],
         betas: [AnthropicBeta::MID_CONVERSATION_OUTPUT_CONFIG_2026_07_01],
     );

     foreach ($response->content as $block) {
         if ($block->type === 'text') {
             echo $block->text, PHP_EOL;
         }
     }
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     response = client.beta.messages.create(
       model: "claude-fable-5-1",
       max_tokens: 4096,
       output_config: {effort: :high},
       messages: [
         {role: "user", content: "Plan a migration from SQLite to PostgreSQL in three short steps."},
         {role: "assistant", content: "1. Export the SQLite data. 2. Create the PostgreSQL schema. 3. Import the data and verify row counts."},
         # 僅含 effort 的系統訊息：新等級將自下一個使用者回合起生效。
         {role: "system", content: [], output_config: {effort: :low}},
         {role: "user", content: "Summarize the plan in one sentence."}
       ],
       betas: [Anthropic::AnthropicBeta::MID_CONVERSATION_OUTPUT_CONFIG_2026_07_01]
     )

     response.content.each do |block|
       puts block.text if block.type == :text
     end
     ```
   </CodeGroup>

   如此處所示，放在 `assistant` 輪次與下一個 `user` 輪次之間時，該訊息會從該 `user` 輪次開始生效。直接放在帶有新輸入的 `user` 輪次之後時，它會設定 Claude 對該輪次回覆的等級。僅包含工具結果的 `user` 輪次不算作新輸入：變更會等到下一個帶有新輸入的 `user` 輪次。之後該等級會持續有效，直到另一則 `role: "system"` 訊息變更它。僅接受具名等級（`low`、`medium`、`high`、`xhigh`、`max`），且需要 `mid-conversation-output-config-2026-07-01` beta 標頭。請參閱[每則訊息的 effort](https://platform.claude.com/docs/zh-TW/build-with-claude/effort#change-effort-mid-conversation-beta)。

2. **使用對話中途系統訊息變更指示和工具：** 若要在工作階段中途變更指示或工具，請附加一則 [`role: "system"` 訊息](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages)，並使用 `tool_addition` 和 `tool_removal` 區塊進行工具變更（在 Claude API 上需使用 beta 標頭 `inline-tools-2026-09-15`）。`tool_addition` 區塊可以指名在工作階段開始時於 `tools` 中宣告的工具，或[攜帶該工具的完整定義](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages#define-tools-in-a-message-beta)，因此在工作階段開始時未知的工具不需要放在 `tools` 中。這可保留較早輪次的提示快取命中，並讓對話歷史記錄保持僅附加。較舊的 `mid-conversation-tool-changes-2026-07-01` 標頭仍適用於以參照方式指名工具的變更，可在 Claude API、Amazon Bedrock 和 Google Cloud 上使用。當特定工具必須在目前輪次執行時，同樣的訊息可取代強制 `tool_choice`（請參閱[重大變更](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-breaking-changes)）。對於僅適用於單一輪次的提醒，請將其作為帶有 `clear_at: "next_user_message"` 的獨立純文字 `role: "system"` 訊息傳送（[輪次範圍系統訊息](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages#turn-scoped-system-messages)，beta 標頭 `mid-conversation-system-clear-at-2026-08-21`），並將其保留在歷史記錄中：它會在下一則使用者訊息之後停止呈現，清除後不會耗費任何 token。攜帶 `tool_addition` 或 `tool_removal` 區塊的訊息不能設為輪次範圍。

3. **對拒絕使用 `fallbacks: "default"`：**&#x8ACB;繼續處理 `stop_reason: "refusal"`，並在讀取回應內容之前讀取 `stop_details.category`。若要自動在另一個模型上重新執行被拒絕的請求，請設定 `fallbacks: "default"`（beta，`server-side-fallback-2026-07-01` 標頭）。`"default"` 會在 Anthropic 針對該類別建議的模型上重試被拒絕的請求。Claude Fable 5.1 允許的備援目標為 Claude Opus 4.8（`claude-opus-4-8`）與 Claude Opus 5（`claude-opus-5`）。明確的 `fallbacks` 清單可以指名其中任一個。備援模型不會收到 Claude Fable 5.1 的思考區塊。`fallbacks` 參數在 Amazon Bedrock、Google Cloud 或 Microsoft Foundry 上無法使用。在這些平台上，請改用[用戶端備援](https://platform.claude.com/docs/zh-TW/build-with-claude/refusals-and-fallback#client-side-fallback)。如果您自行建構重試，[備援抵免](https://platform.claude.com/docs/zh-TW/build-with-claude/fallback-credit)的適用條件與 Claude Fable 5 相同。請參閱[拒絕與備援](https://platform.claude.com/docs/zh-TW/build-with-claude/refusals-and-fallback)。

4. **從 `high` effort 開始並進行掃描測試：**[effort 參數](https://platform.claude.com/docs/zh-TW/build-with-claude/effort)的預設值為 `high`，且支援全部五個等級。請保留 Claude Fable 5 的指引：大多數工作使用 `high`，而 `medium` 作為值得測試的成本控制手段。Claude Fable 5.1 相較於 Claude Fable 5 的提升在 `xhigh` 與 `max` 時最大，但這些等級也會增加思考時間與首次回應時間，因此請針對對能力最敏感的任務，以及您的評估顯示有提升之處，才升級至這些等級。請在您自己的評估上執行全新的掃描測試，而非沿用為 Claude Fable 5 調校的設定。請參閱 [Claude Fable 5.1 的建議 effort 等級](https://platform.claude.com/docs/zh-TW/build-with-claude/effort#recommended-effort-levels-for-claude-fable-5-1)。

5. **在伺服器上修剪上下文，或以不攜帶過時思考的形式進行壓縮：**&#x5982;果您的程式碼在用戶端截斷或摘要較舊的輪次，最簡單的修正方式是將這項工作移至伺服器端[壓縮](https://platform.claude.com/docs/zh-TW/build-with-claude/compaction)或[上下文編輯](https://platform.claude.com/docs/zh-TW/build-with-claude/context-editing)。兩者都不算是編輯，因為[歷史記錄檢查](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-preserved-thinking)比較的是您所傳送的對話，所以它們移除的任何內容都不會使後續的思考區塊失效，而且壓縮的 [`instructions` 參數](https://platform.claude.com/docs/zh-TW/build-with-claude/compaction-threshold#custom-summarization-instructions)接受您自己的摘要提示。如果您在摘要之後逐字保留最近的輪次，或在對話持續進行時於背景進行摘要，請使用[隨需壓縮](https://platform.claude.com/docs/zh-TW/build-with-claude/compaction-on-demand)（beta 標頭 `compact-2026-09-04`），而非用戶端撰寫的摘要。API 會寫入一個已簽署的摘要區塊，您將其放在被摘要的訊息位置。在[壓縮與保留思考](https://platform.claude.com/docs/zh-TW/build-with-claude/compaction-thinking-blocks#conditions-for-kept-thinking-to-stay-valid)所述的條件下，您保留的輪次中的思考區塊可以維持有效。如果您將壓縮保留在用戶端，請從以下三種形式中擇一：

   * **簡單壓縮（建議）：**&#x4EE5;一則摘要訊息加上新的使用者輪次取代整個歷史記錄，不重播任何其他內容。沒有思考區塊被帶過去，因此不會有任何失敗。Claude 模型以此方案在長時程任務上進行訓練，對於大多數工作負載，其表現與更複雜的方案相當。
   * **保留尾端壓縮：**&#x5982;果您在摘要之後逐字保留最近的輪次，請從這些輪次中移除 `thinking` 與 `redacted_thinking` 區塊（文字與工具呼叫可以保留），或設定 `prefix_mismatch_behavior: "drop_block"`。否則，它們的思考是針對完整歷史記錄產生的，在摘要之後會失敗。
   * **背景壓縮：**&#x5982;果您在關鍵路徑之外建構摘要並稍後換入，則在此期間產生的每一輪都攜帶早於換入的思考。請在每個仍攜帶換入前所產生思考區塊的請求上傳送 `"drop_block"`（或自行移除這些區塊；換入後第一個回應上的 `input_transformations` 會精確列出是哪些），或同步進行壓縮。

   請勿從對話記錄中間剪除個別輪次：這會使之後的每個思考區塊失效，且沒有任何用戶端形式可以避免。對於您原本要進行的指示變更，請使用[對話中途系統訊息](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages)；對於選擇性移除，請使用伺服器端[上下文編輯](https://platform.claude.com/docs/zh-TW/build-with-claude/context-editing)。請參閱[回傳壓縮區塊](https://platform.claude.com/docs/zh-TW/build-with-claude/compaction-threshold#passing-compaction-blocks-back)。

### 遷移檢查清單

* 將模型名稱從 `claude-fable-5` 更新為 `claude-fable-5-1`（或從 `claude-mythos-5` 更新為 `claude-mythos-5-1`）。
* 取代強制 `tool_choice`（`{type: "any"}` 或 `{type: "tool", ...}`）。它會傳回 400 錯誤。請使用 `{type: "auto"}` 加上明確指示和 `strict: true` 工具，或使用 JSON 輸出。將指示放在 `user` 輪次中，或在您的應用程式要求該呼叫時，放在對話中途的 `role: "system"` 訊息中。
* 在每個輪次持續原封不動地傳回 `thinking` 區塊，包括空的區塊。Claude Fable 5.1 可讀取來自 Claude Opus 5、Claude Fable 5、Claude Mythos 5 以及更早模型的區塊。將對話從 Claude Fable 5.1 移至 Claude Mythos 5.1 以外的任何模型，都會捨棄其區塊。
* 如果您的程式碼自行建構 `messages` 陣列，請檢查它是否會[編輯較早的輪次](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-preserved-thinking)：使用 `thinking-binding-controls-2026-08-01` beta 標頭和 `prefix_mismatch_behavior: "drop_block"` 執行一個工作階段，記錄 `input_transformations`，並修正每個 `prefix_binding_mismatch`。模型切換後出現 `model_binding_mismatch` 項目是預期的。
* 保持對話歷史記錄僅附加：在工作階段開始時凍結 `system` 和 `tools`，並將工作階段中途的變更移至 `role: "system"` 訊息以及 `tool_addition` / `tool_removal` 區塊；將每輪提醒作為您永不移除的輪次範圍系統訊息傳送；在伺服器端修剪上下文，或從您跨用戶端摘要沿用的任何輪次中移除思考區塊；並透過 `file_id` 引用跨輪次檔案。
* 選擇正式環境的 `prefix_mismatch_behavior`（預設為 `"error"`，或 `"drop_block"`）並加以監控。如果您維護的工具是讓他人以自己的 API 金鑰執行，請在設定此欄位的情況下進行測試：即使您的帳戶未預設強制執行，新帳戶也會預設強制執行。
* 檢查代理迴圈是否有每輪一個工具呼叫的行為，並加入批次處理指示。
* 如果您的介面會呈現工具呼叫之間的進度文字，請將 `thinking.display` 設定為 `"updates"`（beta）或 `"summarized"`，並提示要求更新。
* 如果您在請求之間變更 effort，請將變更移至[每則訊息 effort](https://platform.claude.com/docs/zh-TW/build-with-claude/effort#change-effort-mid-conversation-beta) 的 `role: "system"` 訊息（beta），以保留快取命中。
* 處理 `stop_reason: "refusal"` 並讀取 `stop_details.category`。考慮使用 `fallbacks: "default"`（beta）。
* 以新的掃描重新評估 `effort`，從 `high` 開始，並在您自己的工作負載上重新建立成本和延遲基準。tokenizer 未變更。提示快取讀取的成本為 Claude Fable 5 費率的四分之一。

## 從 Claude Opus 5 遷移至 Claude Fable 5.1

Claude Fable 5.1 使用與 Claude Opus 5 相同的 [Messages API](https://platform.claude.com/docs/zh-TW/build-with-claude/working-with-messages) 與[工具使用](https://platform.claude.com/docs/zh-TW/agents-and-tools/tool-use/overview)模式。它預設保留 [1M token 上下文視窗](https://platform.claude.com/docs/zh-TW/build-with-claude/context-windows)、[128k 最大輸出 token](https://platform.claude.com/docs/zh-TW/models/overview)、512 token 的提示快取最低門檻，以及[對話中途系統訊息](https://platform.claude.com/docs/zh-TW/build-with-claude/mid-conversation-system-messages)支援。預填（prefill）限制、取樣參數限制，以及 `thinking.display` 的 `"omitted"` 預設值也同樣沿用。請套用[從 Claude Fable 5 遷移至 Claude Fable 5.1](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#migrating-from-claude-fable-5-to-claude-fable-5-1) 中的所有內容，再加上以下項目。

### 更新您的模型名稱

```python
model = "claude-opus-5"  # Before
model = "claude-fable-5-1"  # After

# 或者，若使用 Claude Mythos 5.1（為經驗證的組織提供相同功能）：
model = "claude-mythos-5-1"  # After
```

### 變更內容

1. **思考無法再被停用：** Claude Opus 5 在 [effort](https://platform.claude.com/docs/zh-TW/build-with-claude/effort) 等級為 `high` 或更低時接受 `thinking: {type: "disabled"}`。在 `claude-fable-5-1` 與 `claude-mythos-5-1` 上，[自適應思考](https://platform.claude.com/docs/zh-TW/build-with-claude/thinking)永遠開啟，且 `thinking: {type: "disabled"}` 在任何 effort 等級下都會回傳 400 錯誤。請移除該欄位，以較低的 effort 等級控制 token 花費，並針對原本在停用思考下執行的工作負載重新檢視 `max_tokens`。

2. **不支援強制工具選擇：** Claude Opus 5 接受 `tool_choice` 的 `any` 與 `tool`。`claude-fable-5-1` 會回傳 400 錯誤。請參閱[重大變更](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-breaking-changes)。

3. **跨模型保留的思考：** Claude Fable 5.1 可讀取 Claude Opus 5 的 thinking 區塊：從 `claude-opus-5` 移至 `claude-fable-5-1` 的對話會保留其推理。Claude Opus 5 無法讀取 Claude Fable 5.1 的區塊。Claude Fable 5.1 的區塊也會[在較早輪次變更時失效](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-preserved-thinking)：如果您的程式碼在請求之間編輯較早的訊息、重建 `system` 或 `tools`，或在用戶端進行壓縮，Claude Opus 5 不會有異議，但 `claude-fable-5-1` 會拒絕或丟棄之後的每一個 thinking 區塊。在切換流量之前，請執行該章節中的三步驟檢查。請參閱[重大變更](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-breaking-changes)。

4. **工具呼叫之間的文字會以 thinking 區塊回傳：** 在 Claude Opus 5 上，模型在工具呼叫之間撰寫的文字會以 `text` 區塊回傳。在 `claude-fable-5-1` 上，如同 Claude Fable 5，該敘述會以進度更新 `thinking` 區塊回傳，每次工具呼叫前各一個。在 `thinking.display` 預設為 `"omitted"` 的情況下，它們不含可讀文字。如果您的介面會呈現該敘述，請設定 `display: "updates"`（beta）以文字形式接收進度更新，同時推理保持隱藏；或設定 `"summarized"` 以同時接收兩者。然後在 `tool_use` 區塊之間呈現非空的 `thinking` 區塊。請參閱[工具呼叫之間的進度更新](https://platform.claude.com/docs/zh-TW/build-with-claude/thinking#progress-updates)。

5. **安全分類器與備援路由：**&#x43;laude Fable 5.1 執行的安全分類器涵蓋與 Claude Fable 5 相同的 `stop_details` 類別，範圍比 Claude Opus 5 的分類器更廣。預期會出現額外的 `stop_details.category` 值，例如 `"bio"`；完整集合請參閱[拒絕類別表](https://platform.claude.com/docs/zh-TW/build-with-claude/refusals-and-fallback#refusal-response)。關於 `fallbacks` 設定與允許的目標，請參閱[對拒絕使用 `fallbacks: "default"`](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-recommended-changes)。

6. **定價：** 每百萬輸入 token 10 美元，每百萬輸出 token 50 美元，相較於 Claude Opus 5 的 5 美元與 25 美元。提示快取讀取為每百萬 token 0.25 美元，為 Claude Opus 5 費率的一半。請參閱 [Claude 定價](https://platform.claude.com/docs/zh-TW/about-claude/pricing)。

7. **資料保留：** Claude Fable 5.1 與 Claude Mythos 5.1 需要 30 天的資料保留，除非經 Anthropic 明確授權，否則無法在零資料保留（ZDR）安排下使用，且被指定為 Covered Models。Claude Opus 5 可在 ZDR 下使用。請參閱[特定模型的資料保留要求](https://platform.claude.com/docs/zh-TW/manage-claude/api-and-data-retention#model-specific-data-retention-requirements)。

### 遷移檢查清單

* 如果您的組織有「zero data retention」（零資料保留），即 ZDR 安排，請先確認資格：除非獲得 Anthropic 明確授權，否則這些模型無法在 ZDR 下使用。請參閱[特定模型的資料保留要求](https://platform.claude.com/docs/zh-TW/manage-claude/api-and-data-retention#model-specific-data-retention-requirements)。
* 將模型名稱從 `claude-opus-5` 更新為 `claude-fable-5-1`（或 `claude-mythos-5-1`）。
* 移除任何 `thinking: {type: "disabled"}` 設定：它在 `claude-fable-5-1` 上會傳回 400 錯誤。請使用較低的 [effort](https://platform.claude.com/docs/zh-TW/build-with-claude/effort) 等級來控制 token 用量，並重新檢視 `max_tokens`。
* 將強制的 `tool_choice`（`any` 或 `tool`）替換為 `auto` 加上明確的指示（`user` 輪次或對話中途的系統訊息）以及 `strict: true` 工具，或改用 JSON 輸出。
* 如果您的介面會呈現工具呼叫之間的文字，請設定 `display: "updates"`（beta）或 `"summarized"`，並呈現非空的 `thinking` 區塊。
* 套用 [Claude Fable 5 檢查清單](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#migration-checklist-fable-5-1-from-fable-5)中關於保留思考、歷史編輯、行為、effort 和備援的項目。
* 在您自己的工作負載上重新建立成本基準。「Tokenizer」（分詞器）沒有變更。每個 token 的定價有所不同。

## 從 Claude Opus 4.8 或更早版本遷移至 Claude Fable 5.1

請依照下方的檢查清單進行。若使用 Claude Opus 4.7 或更早版本，請先從對應的 [Claude Opus 5.5 遷移指南](https://platform.claude.com/docs/zh-TW/models/opus-5-5/migration-guide)章節開始。

### 更新您的模型名稱

```python
model = "claude-opus-4-8"  # Before
model = "claude-fable-5-1"  # After

# 或者，若使用 Claude Mythos 5.1（為經驗證的組織提供相同功能）：
model = "claude-mythos-5-1"  # After
```

### 遷移檢查清單

* 如果您的組織有零資料保留（ZDR）安排，請先確認資格：除非經 Anthropic 明確授權，否則這些模型無法在 ZDR 下使用。Claude Opus 4.8 可在 ZDR 下使用。
* 將模型名稱從 `claude-opus-4-8` 更新為 `claude-fable-5-1`（或 `claude-mythos-5-1`）。
* 移除任何 `thinking: {type: "disabled"}` 設定並重新檢視 `max_tokens`。沒有 `thinking` 欄位的請求會以自適應思考執行。
* 更新依位置讀取內容的回應解析，例如 `content[0].text`：回應現在可能以 `thinking` 區塊開頭，因此請改為依 `type` 選取內容區塊。
* 將強制的 `tool_choice`（`any` 或 `tool`）替換為 `auto` 搭配明確的指示（`user` 輪次或對話中途系統訊息）與 `strict: true` 工具，或替換為 JSON 輸出。
* 原封不動地傳回 `thinking` 區塊，並將其文字視為僅供顯示。Claude Fable 5.1 可讀取 Claude Opus 4.8 的 thinking 區塊：移至 `claude-fable-5-1` 的對話會保留其較早的推理。Claude Opus 4.8 無法讀取 Claude Fable 5.1 的區塊。
* 如果您的程式碼自行建構 `messages` 陣列，請檢查它是否[編輯了較早的輪次](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-preserved-thinking)。為 Claude Opus 4.8 及更早版本撰寫的整合經常會截斷舊輪次、移除或重建較早的訊息，或在每次請求時重新整理 `system` 提示，而 Claude Opus 4.8 從未有異議。在 `claude-fable-5-1` 上，上述每一項都會使之後的 thinking 區塊失效。
* 處理 `stop_reason: "refusal"`、讀取 `stop_details.category`，並考慮使用 `fallbacks: "default"`（beta）。
* 套用 [Claude Fable 5 檢查清單](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#migration-checklist-fable-5-1-from-fable-5)中的保留思考、歷史編輯、行為、每則訊息 effort 與進度更新項目。
* 重新評估 `effort`（從 `high` 開始），檢視接近 512 token [快取最低門檻](https://platform.claude.com/docs/zh-TW/build-with-claude/prompt-caching#cache-limitations)（Claude Opus 4.8 上為 1,024 token）的提示，並重新建立成本與延遲基準。每 token 定價不同，且思考 token 以輸出 token 計費，因此在 Claude Opus 4.8 上未使用思考執行的工作負載，每次請求可能會產生更多輸出 token。

## 從 Claude Mythos 5 遷移至 Claude Mythos 5.1

[Claude Mythos 5.1](https://platform.claude.com/docs/zh-TW/models/mythos-5-1/overview) 是 Claude Fable 5.1 的對應版本，適用於透過 Anthropic 驗證計畫（例如 [Cyber Verification Program](https://support.claude.com/en/articles/14604842)）驗證的組織。在切換模型 ID 之前，請確認您的組織有權存取 Claude Mythos 5.1。

API 層級的差異與[從 Claude Fable 5 遷移至 Claude Fable 5.1](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#migrating-from-claude-fable-5-to-claude-fable-5-1) 相同：強制工具選擇會傳回 400 錯誤，且只有 Claude Mythos 5.1 和 Claude Fable 5.1 能讀取 Claude Mythos 5.1 的思考區塊（Claude Mythos 5.1 可讀取 Claude Mythos 5 的區塊，反之則不行）。與 Claude Fable 5.1 不同，Claude Mythos 5.1 不會執行對話檢查，因此編輯先前的輪次不會[使思考區塊失效](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#fable-5-1-preserved-thinking)，但仍會重新啟動提示快取。

### 更新您的模型名稱

```python
model = "claude-mythos-5"  # Before
model = "claude-mythos-5-1"  # After
```

### 遷移檢查清單

* 將模型名稱從 `claude-mythos-5` 更新為 `claude-mythos-5-1`。
* 將強制的 `tool_choice`（`any` 或 `tool`）替換為 `auto` 搭配明確的指示（`user` 輪次或對話中途系統訊息）與 `strict: true` 工具，或替換為 JSON 輸出。
* 在處理回應內容之前，先處理 `stop_reason: "refusal"` 並讀取 `stop_details.category`。請參閱[拒絕與備援](https://platform.claude.com/docs/zh-TW/build-with-claude/refusals-and-fallback)。
* 在每一輪次中持續原封不動地傳回 `thinking` 區塊，包括空的區塊。
* 如果您的程式碼自行建構 `messages` 陣列，請保持對話歷史僅能附加，以維持提示快取處於暖狀態。Claude Mythos 5.1 不執行[對話檢查](https://platform.claude.com/docs/zh-TW/build-with-claude/thinking#preserved-in-conversation)，因此編輯不會使其 thinking 區塊失效。
* 套用 [Claude Fable 5 章節](https://platform.claude.com/docs/zh-TW/models/fable-5-1/migration-guide#migrating-from-claude-fable-5-to-claude-fable-5-1)中的行為與建議變更，但歷史編輯項目除外，這些項目不適用於 Claude Mythos 5.1。
* 以全新的掃描重新評估 `effort`，並重新建立成本與延遲基準。提示快取讀取的費用為 Claude Mythos 5 費率的四分之一。
