黄奕彬

外部精选

Building with Claude Sonnet 5.5

本文来自外部来源,不是黄奕彬的原创文章。本站提供原文入口,并在采集端生成 AI 结构化摘要、解读与中文翻译(如有),一切以原文为准。

阅读原文(claude.dev)
来源
claude.dev Blog ↗
作者 / 署名
Addy Osmani、Addy Osmani
发布日期
本站收录时间
原文域名
claude.dev

以上时间均为北京时间;来源更新时间由来源提供,不代表首次发布时间。

结构化摘要 AI 生成

背景与问题

Anthropic 于 2026 年 9 月发布 Claude 5.5 系列第二款模型 Sonnet 5.5(继 Opus 5.5 之后)。

文章面向需要从 Sonnet 5(或更早版本)迁移、或在 Sonnet 5.5 与 Opus 5.5 之间选型的开发者,回答「新模型如何调用、相对此前什么变了、现有代码怎么改、参数怎么调」的工程落地问题。

方法或内容

内容为一篇开发者构建指南,附 Python 调用示例。

包含:Sonnet 5.5 与 Opus 5.5 选型对照表;每百万 token 定价表;模型规格明细(模型 ID、上下文窗口、输出上限、知识截止、effort 等级、缓存阈值等);从 Sonnet 5 迁移的 5 个破坏性变更与 1 个响应结构变更及对应代码;调优建议(重跑 effort 扫描、移除旧 workaround、要求真实检查、缓存策略);拒答与回退处理;各平台可用性与 Claude Code 集成说明。

关键发现 / 结果

  • 相比 Sonnet 5:更聪明、更高效、快 30%;单 token 价格不变,但通常耗 token 更少,多数工作总成本最多降 30%。
  • 每百万 token:输入 $2、输出 $10、5 分钟缓存写 $2.50、1 小时缓存写 $4、缓存读 $0.20;美国境内推理为标准价 1.1 倍。
  • 上下文 1M token 原生;最大输出 128k,Batches API 加 output-300k-2026-03-24 beta 头可到 300k;知识截止 2026 年 6 月。
  • 思考默认开启;effort 等级为 low/medium/high/xhigh/max,API 默认 high、Claude Code 默认 medium;最小可缓存提示降至 512 token(Sonnet 5 为 1,024)。
  • 高分辨率图像层:最长边最高 2576 像素,2000×1500 图像约为此前模型的 2.5 倍 token。
  • 拒答返回 HTTP 200 与 refusal 停止原因,分 cyber、bio、frontier_llm、reasoning_extraction、general_harms 五类。

结论与意义

作者结论:Sonnet 5.5 最适合有明确规格且能验证结果的任务——修 bug、快速迭代功能、制作文档/幻灯/表格、重复执行的 agent 任务;最难、需谨慎判断的长程工作仍应选 Opus 5.5。

边界:xhigh/max 会思考更久、成本更高,可能损失质量/速度/成本平衡;低 effort 时模型有时跳过验证性检查,需系统提示约束;Claude Code 中不可关闭思考、无 fast mode;Haiku 5.5 将在未来数周加入。

AI 解读 AI 生成

方法:按「时空变量」分析(时间 / 空间 / 变量,严格区分包含、相关与因果),对象包括原文作者、署名人员与关键技术及其实际原理;结论用「元反空」(元思考、反思考、空思考、综合)整理。

时间:何时发生,现在是否仍成立

发布时点为来源日期北京时间 2026-09-28 20:00,文中「今日可用」以该日为准;知识截止 2026 年 6 月。「Haiku 5.5 未来数周加入」「Cyber Verification Program 即将扩展到 Sonnet 5.5」为前瞻表述,原文未说明具体日期。

价格表、模型 ID、beta 头(如 output-300k-2026-03-24、thinking-display-updates-2026-08-18)均为发布时快照,此后可能调整,现在是否仍成立需以官方当前文档核对。

空间:谁的环境 / 场景

适用对象:通过 Claude API、Claude Platform on AWS、Google Cloud、Microsoft Foundry(仅 Global Standard 部署)使用 claude-sonnet-5-5,或在 Amazon Bedrock 使用 anthropic.claude-sonnet-5-5 的开发者;Claude Code 需 v2.1.284+(Agent SDK for TypeScript v0.3.284+)。

部署形态含标准推理与美国境内推理。平台差异:computer_20251124 在 Amazon Bedrock 仍被接受,在 Claude API 与 Google Cloud 返回 400;服务器端回退仅 Claude API(beta)。

变量:实际改变了什么

  • 行为:快 30%、单任务 token 更少;思考默认开启,thinking 设为 disabled 改为返回 400,新增 between_tools;强制 tool_choice(any/tool)返回 400,改用 auto 加 strict: true。
  • 接口:计算机使用改走 computer_toolset_20260801;advisor 拒绝 Opus 4.8、Opus 4.7 与 Sonnet 5。
  • 结构:工具调用间文本改以 thinking 块返回;effort 等级重新校准,同等级思考量与 Sonnet 5 不同。
  • 价格与限制:token 单价与 Sonnet 5 持平;最小可缓存提示 1,024→512;图像改高分辨率层(约 2.5 倍 token);速率限制与 Sonnet 5 分开。

区分:包含 ≠ 相关 ≠ 因果

有明确因果证据:具体参数组合返回 400(thinking disabled、强制 tool_choice、旧 computer use 声明、between_tools 配 xhigh/max 等);缓存读为输入价 1/10;顶层 effort 变化使缓存失效;思考计入 max_tokens;高分辨率图像层使 token 消耗约增至 2.5 倍。

属相关或厂商自述而非可验证因果:「快 30%」「成本最多降 30%」「多数工作」及对齐/诚实度「提升或持平」均无原文数据与测试方法;Epic 引语为单一客户早期测试的相关佐证。

对象:作者/署名与关键技术原理

作者:Addy Osmani(结构化作者字段重复出现两次,为同一署名)。关键技术按原文描述:

  • 自适应思考:默认开启,响应可始于 thinking 块,需按 block.type 遍历读取,读 content[0].text 会出错。
  • between_tools:关闭前置思考、仅在工具调用间思考,限 low/medium/high,不能与 display、budget_tokens、block_binding 同用,会话中 effort 不可变。
  • strict: true 工具:配合 tool_choice 为 auto 使工具输入匹配 schema,需每个 object 加 additionalProperties: false。
  • computer_toolset_20260801:新的计算机使用工具集,取代 computer_20251124 及对应 beta 头。
  • advisor 工具:Sonnet 5.5 作为 executor 时接受 Opus 5.5、Opus 5 与 Sonnet 5.5,建议以加密的 advisor_redacted_result 块返回,代码不可读。
  • 服务器端回退 fallbacks: default(beta、Claude API):对 cyber 与 frontier_llm 拒答在 Sonnet 5 上重试,其余三类不重试。

元反空综合结论

元:本文本质是新模型的「上手 + 迁移」工程文档,解决开发者从 Sonnet 5 切换时的行为差异、成本结构与代码改法问题,核心价值在可执行的迁移清单。

  • 反:最可能失效或有边界的部分——「快 30%」「最多省 30%」为厂商自述,无基准数据且以「通常/多数工作」限定,具体负载未必复现;Epic 为单一客户早期测试;beta 功能(per-message effort、thinking.display、服务器回退、300k 输出)行为可变;前瞻项(Haiku 5.5、Cyber Verification 扩展)无时间表。
  • 空:去掉宣传后剩下的必要事实——各平台模型 ID 与可用性;价格表与 1.1 倍美区价;规格(1M 上下文、128k 输出、512 token 缓存阈值、高分辨率图像层多耗 token);6 项明确 API 变更及 400 错误触发条件;effort 需重新调优且思考计入 max_tokens。
  • 综合:作为迁移操作文档可信且具体(400 条件可直接验证);对性能与省钱宣称,应先用自己的 eval 复核再纳入预算假设。

中文译文 AI 生成

Claude Sonnet 5.5 是我们在 Claude 5.5 系列中继 Opus 5.5 之后推出的第二款模型。它是对 Sonnet 5 的一次明显升级,更聪明、更高效,速度提升 30%。

每 token 价格保持不变,而且由于 Sonnet 5.5 完成同样的工作通常需要少得多的 token,对大多数工作而言成本最多可降低 30%。

图 A Lance Martin 的代码作画演示:每个模型编写代码来重绘同一张照片。从左到右依次为:原照片、Claude Sonnet 5、Claude Sonnet 5.5 和 Claude Opus 5.5。

感谢 @jkeatn 提供与 code-to-painting 相关的想法,感谢 @IceSolst 提供参考图片。

本指南介绍如何使用该模型进行构建。想试用的话,请按原样运行以下请求:

import anthropic client = anthropic.Anthropic() response = client.messages.create( model="claude-sonnet-5-5", max_tokens=4096, messages=[ { "role": "user", "content": "Analyze the trade-offs between microservices and monolithic architectures", } ], output_config={"effort": "medium"}, ) for block in response.content: if block.type == "text": print(block.text)

这个循环按类型读取每个 block,因为 Sonnet 5.5 默认会思考(thinking),响应可能以一个 thinking block 开头,而读取 content[0].text 的代码会出错。

在 Sonnet 5.5 与 Opus 5.5 之间选择

在 Claude 5.5 系列中,Opus 5.5 专为需要审慎判断的复杂工作而生。可将 Sonnet 5.5 用于范围明确的日常任务,比如修复 bug 和快速迭代功能。它还能创建精致的文档、幻灯片和电子表格,并且对设计有很强的眼光。

它的速度使其非常适合快速迭代。Claude Haiku 5.5 将在未来几周加入该系列,用于大批量、低延迟的工作流。

你的工作负载 / 首选模型:

  • 范围明确的日常编码:修复 bug、快速迭代功能、根据需求进行验证 —— Sonnet 5.5
  • 大批量的日常开发 —— Sonnet 5.5
  • 精致的文档、幻灯片和电子表格,例如单页文档、图示、摘要幻灯片、文档编辑和电子表格清理,这些场景下对设计的审美很有帮助 —— Sonnet 5.5
  • 你反复运行的明确定义的 agent 任务:调查、审查、起草 —— Sonnet 5.5
  • 需要审慎判断的复杂工作,包括长程 agentic coding 和知识型工作 —— Opus 5.5
  • 最困难的问题,即你需要最强智能的场景 —— Opus 5.5

“在 Epic 的早期测试中,Claude Sonnet 5.5 达到了你对更高层级模型所期望的同等质量标准,在系统设计审查和数据流评审中经受住了考验。新模型管理了游戏玩法系统架构的数万行代码,保持了响应的敏捷,处理了长达数小时的任务,并且在提示中指令性要求更少的情况下完成了交付。

”(Daniel Vogel,Epic Games 首席运营官)

当任务有明确的规格说明且有办法检查结果时,Sonnet 5.5 最能发挥优势。正如提示指南所说:“对于最困难的长程工作,Opus 模型是更好的选择。”

定价

每百万 token:

  • 输入:Sonnet 5.5 $2;Opus 5.5 $4
  • 输出:Sonnet 5.5 $10;Opus 5.5 $20
  • 缓存写入,5 分钟:Sonnet 5.5 $2.50;Opus 5.5 $5
  • 缓存写入,1 小时:Sonnet 5.5 $4;Opus 5.5 $8
  • 缓存读取:Sonnet 5.5 $0.20;Opus 5.5 $0.20

Sonnet 5.5 的所有价格(包括批处理和 prompt caching)都与 Sonnet 5 一致,因此更换模型 ID 不会改变你的每 token 账单。仅限美国的推理(inference_geo: "us")价格为标准价格的 1.1 倍。

虽然每 token 价格没有变化,但总账单会变,因为如前所述,Sonnet 5.5 每个任务通常比 Sonnet 5 使用更少的 token。

请注意,不同界面可能为 Sonnet 提供不同的默认 effort,例如 Claude Platform 上为 high,Claude Code 中为 medium。

Sonnet 5.5 使用高分辨率图像档位,长边最高 2576 像素;一张 2000×1500 的图像消耗的 token 约为 Sonnet 4.6、Sonnet 4.5 或 Haiku 4.5 上的 2.5 倍。如果不需要这种细节,请先缩小再发送。

模型详情

  • 模型 ID:在 Claude API、AWS 上的 Claude Platform、Google Cloud 和 Microsoft Foundry 上为 claude-sonnet-5-5;在 Amazon Bedrock 上为 anthropic.claude-sonnet-5-5
  • 上下文窗口:1M token,原生支持,无需 beta header
  • 最大输出:128k token;在 Message Batches API 上配合 output-300k-2026-03-24 beta header 最多可达 300k
  • 知识截止时间:2026 年 6 月
  • 思考(Thinking):默认开启(自适应思考);between_tools 会关闭前置思考
  • Effort 级别:low、medium、high、xhigh、max
  • 默认 effort:Claude API 上为 high;Claude Code 中为 medium
  • 分词器:与 Sonnet 5 相同
  • 最小可缓存提示:512 token(Sonnet 5 上为 1,024)
  • 速率限制:与 Sonnet 5 相互独立,默认层级数值相同
  • Priority Tier:在 Claude API 上可用
  • 数据留存:符合条件的客户可使用零数据留存

Claude API 默认使用 high,让你从强劲的结果起步。从这里开始,进行评估,然后选择你的工作负载所需的 effort 级别。如果你想使用 xhigh 或 max effort,请记住 Sonnet 5.5 会思考更久、成本更高。

在某些任务上,你可能会失去让 Sonnet 有用的一部分特质:质量、速度与成本之间的平衡。在这种情况下,可以考虑 Opus 5.5。

从 Sonnet 5 迁移

思考(thinking)默认开启。如果你之前是关闭 thinking 运行 Sonnet 5 的,可以使用 between_tools 关闭前置思考。下面的第 1 步展示了具体做法。

将模型 ID 改为 claude-sonnet-5-5,然后处理五项破坏性变更和一处响应结构的变化。Sonnet 5.5 迁移指南对每一项都有完整说明。

Claude Code 也可以替你完成迁移。运行 /claude-api migrate this project to claude-sonnet-5-5 即可调用内置的 Claude API skill,在你的代码库中应用模型 ID 替换和破坏性参数变更。

  1. 使用 between_tools 关闭前置思考

在 Sonnet 5.5 上,不带 thinking 字段的请求会以自适应思考运行,而 thinking: {"type": "disabled"} 会返回 400 错误。请改为发送新的 between_tools 设置。使用 between_tools 时,思考只发生在工具调用之间,总响应时间相同或更快。

# Before: Claude Sonnet 5 client.messages.create( model="claude-sonnet-5", max_tokens=16000,

thinking={"type": "disabled"}, output_config={"effort": "xhigh"}, messages=[{"role": "user", "content": "..."}], ) # After: Claude Sonnet 5.5 client.messages.create( model="claude-sonnet-5-5", max_tokens=16000, thinking={"type": "between_tools"}, output_config={"effort": "high"}, messages=[{"role": "user", "content": "..."}], )

这个示例还把 effort 从 xhigh 降到 high,因为 between_tools 有以下限制:

  • between_tools 在 low、medium 和 high effort 下可用。在 xhigh 或 max 下它会返回 400 错误;要在这些级别运行,请使用 adaptive thinking。
  • 它不接受任何其他字段。与它一起发送 display、budget_tokens 或 block_binding 会返回 400 错误。
  • 使用 between_tools 时,effort 无法在对话中途改变。要按轮次调整 effort,请使用 adaptive thinking。

模型在工具调用之间写下的简短进度更新仍会作为 thinking blocks 返回,其中带有摘要文本。请按类型读取内容块,并把这些块与其余 assistant 回合一起原样传回。没有工具时,响应只包含文本。

它在提供 Sonnet 5.5 的每个平台上都可用,不需要 beta header。如果你的 SDK 版本没有定义 between_tools,请更新它。

如果你用 between_tools 关闭了前置 thinking,那么对于没有工具但需要几步推演的请求,请改用 adaptive thinking。

  1. 将强制的 tool_choice 替换为 auto 加 strict 工具

类型为 any 或 tool 的 tool_choice 会返回 400 错误,包括在 token 计数端点上。请发送 auto,将该工具标记为 strict: true 以使其输入符合 schema,并在 prompt 中说明何时使用它:

CODEPython weather_tool = { "name": "get_weather", "description": "Get the current weather in a given location", "input_schema": { "type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"], "additionalProperties": False, }, "strict": True, }

client.messages.create( model="claude-sonnet-5-5", max_tokens=1024, tools=[weather_tool], tool_choice={"type": "auto"}, # was {"type": "tool", "name": "get_weather"} messages=[ {"role": "user", "content": "What's the weather in Paris? Use the get_weather tool."} ], )

严格工具使用要求每个 object 上都设置 additionalProperties: false。

  1. 保持对话只追加

Sonnet 5.5 的 thinking blocks 与模型及对话绑定。Sonnet 5.5 可以读取 Sonnet 5 的 thinking blocks,因此从 Sonnet 5 切换到 Sonnet 5.5 的对话会保留其推理。没有其他模型能读取 Sonnet 5.5 的块。

  1. 将 computer use 迁移到 toolset

在 Claude API 和 Google Cloud 上,Sonnet 5.5 仅通过 {"type": "computer_toolset_20260801"} 支持 computer use;声明 computer_20251124 的请求会返回 400 错误。

请从请求中去掉 anthropic-beta: computer-use-2025-11-24 header,并在 SDK 中移除 betas 参数,通过标准客户端而非 beta 命名空间调用 Messages API。替换 tools 条目,并更新你的 agent 循环以处理成员 tool_use 块、批量动作以及结果上的 toolset_name。

如果你发送 fine-grained-tool-streaming-2025-05-14 beta header,也请一并移除,因为它与 toolset 条目一起会返回 400 错误;改为在需要它的每个工具上设置 eager_input_streaming: true。Amazon Bedrock 仍接受 computer_20251124。

  1. 检查你的 advisor 搭配

使用 advisor 工具时,Sonnet 5.5 executor 会拒绝 Opus 4.8、Opus 4.7 和 Sonnet 5 作为 advisor。被接受的 advisor 包括 Opus 5.5、Opus 5 以及 Sonnet 5.5 本身。

来自每个被接受 advisor 的建议会以加密形式返回,作为一个 advisor_redacted_result 块,因此你的代码无法读取建议文本。

  1. 从 thinking blocks 读取工具调用之间的文本

这一变化不会导致错误,但 UI 可能会停止显示模型在工具调用之间的笔记。当这些笔记超过一两句时,会作为 progress-update thinking blocks 返回,在默认 display 下它们是空的。

使用 adaptive thinking 时,将 thinking.display 设为 updates(beta,需带 thinking-display-updates-2026-08-18 header)或 summarized,并在紧随其后的 tool_use 块之前渲染每个非空的 thinking 块。使用 between_tools 时,文本会不带 display 返回。

Sonnet 5.5 还新增了 per-message effort(beta)、对话中途的 system 消息以及对话中途的工具变更(beta)。如果你是从 Sonnet 4.6 或更早版本迁移,或从 Haiku 4.5 迁移,迁移指南为每个起始模型提供了检查清单。

调优

重新运行你的 effort 扫描

Effort 级别经过了重新校准,因此同一级别产生的 thinking 量与在 Sonnet 5 上不同,你的旧设置也不会沿用。除非你的工作负载是 agentic 的或对延迟敏感,否则从 high 开始。

对于 agentic coding 和多步工具使用,任务定义明确时从 medium 开始,更难或更长的任务则改用 high。对于聊天和其他延迟敏感的工作,从 medium 或 low 开始。仅在你的 evals 显示质量提升时才使用 xhigh 或 max。

Thinking 计入 max_tokens,因此要留出余量。对于 agentic coding,把 max_tokens 设为 128,000(模型的最大值),并对响应进行流式传输。想减少 thinking,请降低 effort 级别,因为在 system prompt 中要求模型少思考并不能可靠地减少 thinking。

移除 Sonnet 5 的变通方案

现有的 Sonnet 5 prompts 无需修改就应该表现良好。如果你的 prompts 带有诸如 refusal steering、tool-call retry shim 或「do not be lazy」之类的变通方案,请移除它们,并在调整其他任何内容之前重新运行你的 evals。

在低 effort 下要求真实检查

Sonnet 5.5 通常会在报告一项变更完成之前检查其工作,但在低 effort 下它有时会跳过能实际检验该变更的检查。如果你看到变更被报告为已完成,却没有测试或构建输出,prompting 指南建议使用这个 system-prompt 段落:

CODEText When you change code that can be run, built, or type-checked, run a real check that exercises the change before reporting it done: the project's tests, type-checker, or build, or the changed command itself. A syntax-only

检查,或未能启动的检查命令,不计入;如果缺少的只是项目声明的依赖项,请使用项目自己的包管理器和 lockfile 安装它们(例如 npm install、pip install -r requirements.txt),绝不通过 sudo 或系统包管理器,除非被告知不要这样做。只有当此处无法运行任何真正的检查时,才说明你未运行哪一项以及原因,而不是将更改报告为已完成。

使用 thinking.display 显示进度

不要让模型在响应中写出它的推理,因为这会引发 reasoning_extraction 拒绝。改为阅读 summarized thinking:

CODEPythonthinking={"type": "adaptive", "display": "summarized"}

若需要单独呈现的面向用户的进度说明,请使用 display: "updates"(beta)。如果你希望在可预测的时间点获得更新,例如在第一次工具调用前输出一行、在结尾给出简短回顾,请在 system prompt 中说明。

缓存你提示词的更多内容

可缓存提示词的最小长度降至 512 tokens,因此更短的 system prompts 和工具定义现在也符合缓存条件。缓存读取的成本为输入价格的十分之一。在请求之间更改顶层 effort 会使缓存失效;要以不同级别运行某一轮,请使用 per-message effort(beta),它可以保留缓存。

拒绝与回退

在我们的自动化行为审计中,Sonnet 5.5 在大多数对齐与诚实度指标上优于或持平于 Sonnet 5。它也是首个具备与我们最强大模型类似的网络安全防护措施的 Sonnet 模型。大多数常规软件开发不受影响。

被拒绝的请求会返回 HTTP 200,附带 stop_reason: "refusal",且 stop_details 会指明五个类别之一:cyber、bio、frontier_llm、reasoning_extraction 或 general_harms。

服务端回退(fallbacks: "default",beta,Claude API)会在 Sonnet 5 上重试 cyber 和 frontier_llm 拒绝。它不会重试其他三类。你也可以使用 SDK 中间件或你自己的重试。

对于合法的安全工作,Cyber Verification Program 即将扩展以纳入 Sonnet 5.5。

可用性

Claude Sonnet 5.5 今天即可在以下平台使用。在开发者平台上,请使用这些 model ID:

  • Claude API,即 claude-sonnet-5-5
  • Amazon Bedrock,即 anthropic.claude-sonnet-5-5
  • Claude Platform on AWS,即 claude-sonnet-5-5
  • Google Cloud,即 claude-sonnet-5-5
  • Microsoft Foundry,即 claude-sonnet-5-5,仅限 Global Standard 部署

在 Claude Code 中

从 Claude Code v2.1.284(Agent SDK for TypeScript v0.3.284 或更高版本)起,sonnet 别名在 Claude API 上解析为 Sonnet 5.5。它默认以 medium effort 运行,原生具备 1M 上下文窗口。

在 Claude Code 中,你无法为 Sonnet 5.5 关闭 thinking,effort 决定模型思考的程度。Sonnet 5.5 没有 fast mode。默认模型仍为 Opus 5.5,因此对于范围明确的任务,请使用 /model sonnet 切换。

我们希望你会喜欢试用 Sonnet 5.5,也一如既往地欢迎随时分享反馈。

展开原文提取正文(采集端自动提取,可能有缺失)

Claude Sonnet 5.5 is our second model in the Claude 5.5 family after Opus 5.5. It's a clear upgrade over Sonnet 5 and is smarter, more efficient and 30% faster. The per-token price is unchanged and because Sonnet 5.5 typically needs far fewer tokens to do the same work, it costs up to 30% less for most work. FIG ALance Martin's code-to-painting demo: each model writes code that repaints the same photograph. From left: the photograph, Claude Sonnet 5, Claude Sonnet 5.5 and Claude Opus 5.5. Credit to @jkeatn for ideas related to code-to-painting and @IceSolst for the reference image. This guide is about building with the model. To try it, run this request as written: CODEPythonimport anthropic

client = anthropic.Anthropic()

response = client.messages.create( model="claude-sonnet-5-5", max_tokens=4096, messages=[ { "role": "user", "content": "Analyze the trade-offs between microservices and monolithic architectures", } ], output_config={"effort": "medium"}, )

for block in response.content: if block.type == "text": print(block.text) The loop reads each block by type because Sonnet 5.5 thinks by default, so a response can begin with a thinking block, and code that reads content[0].text breaks. CHOOSING BETWEEN SONNET 5.5 AND OPUS 5.5 In the Claude 5.5 family, Opus 5.5 is built for complex work requiring careful judgment. Use Sonnet 5.5 for well-scoped everyday tasks like fixing bugs and quickly iterating on features. It also creates polished documents, slides and spreadsheets, and it has a strong eye for design. Its speed makes it well suited to fast iteration. Claude Haiku 5.5 will join the family in the coming weeks for high-volume, low-latency workflows. Your workloadStart withWell-scoped everyday coding: fixing bugs, quickly iterating on features, verifying against requirementsSonnet 5.5High-volume everyday developmentSonnet 5.5Polished documents, slides and spreadsheets, such as one-pagers, diagrams, summary slides, document edits and spreadsheet cleanup, where an eye for design helpsSonnet 5.5Well-defined agent tasks you run repeatedly: investigation, review, draftingSonnet 5.5Complex work requiring careful judgment, including long-horizon agentic coding and knowledge workOpus 5.5The hardest problems, where you need the most intelligenceOpus 5.5

"In Epic's early testing, Claude Sonnet 5.5 cleared the same quality bar you'd expect from a higher-tier model, holding up on a system design audit and a data-flow review. The new model managed tens of thousands of lines of code for gameplay system architecture, kept responses snappy, handled multi-hour tasks, and delivered with less prescriptive prompting." (Daniel Vogel, COO, Epic Games)

Sonnet 5.5 fits best when the task has a clear spec and a way to check the result. As the prompting guide puts it, "for the hardest long-horizon work, an Opus model is the better choice." PRICING Per million tokensSonnet 5.5Opus 5.5Input$2$4Output$10$20Cache write, 5 minutes$2.50$5Cache write, 1 hour$4$8Cache read$0.20$0.20 All Sonnet 5.5 prices, including batch processing and prompt caching, match Sonnet 5's, so swapping the model ID doesn't change your per-token bill. US-only inference (inference_geo: "us") costs 1.1 times the standard price. While the per-token price doesn't change, the overall bill will change because, as previously mentioned, Sonnet 5.5 typically uses fewer tokens per task than Sonnet 5. Note that surfaces can ship with different default efforts for Sonnet, such as high on Claude Platform and medium in Claude Code. Sonnet 5.5 uses the high-resolution image tier, up to 2576 pixels on the long edge, and a 2000×1500 image costs about 2.5 times as many tokens as on Sonnet 4.6, Sonnet 4.5 or Haiku 4.5. If you don't need the detail, downscale before you send. MODEL DETAILS DetailSonnet 5.5Model IDclaude-sonnet-5-5 on the Claude API, Claude Platform on AWS, Google Cloud and Microsoft Foundry; anthropic.claude-sonnet-5-5 on Amazon BedrockContext window1M tokens, native, no beta headerMax output128k tokens; up to 300k on the Message Batches API with the output-300k-2026-03-24 beta headerKnowledge cutoffJune 2026ThinkingOn by default (adaptive thinking); between_tools turns off upfront thinkingEffort levelslow, medium, high, xhigh, maxDefault efforthigh on the Claude API; medium in Claude CodeTokenizerSame as Sonnet 5Minimum cacheable prompt512 tokens (1,024 on Sonnet 5)Rate limitsSeparate from Sonnet 5, with the same default tier valuesPriority TierAvailable on the Claude APIData retentionAvailable with zero data retention for eligible customers The Claude API defaults to high so you start from strong results. Start there, evaluate, and then pick the effort level your workload needs. If you're tempted to use xhigh or max effort, keep in mind that Sonnet 5.5 will think longer and cost more. On some tasks, you may lose some of what makes Sonnet useful: its balance of quality, speed, and cost. In that case, consider Opus 5.5. MIGRATING FROM SONNET 5 Thinking is on by default. If you ran Sonnet 5 with thinking off, you can use between_tools to turn off upfront thinking. Step 1 below shows how. Change the model ID to claude-sonnet-5-5, then work through five breaking changes and one change to the response shape. The Sonnet 5.5 migration guide covers each one in full. Claude Code can also do the migration for you. Run /claude-api migrate this project to claude-sonnet-5-5 to invoke the bundled Claude API skill, which applies the model ID swap and the breaking parameter changes across your code base.

  1. Turn off upfront thinking with between_tools

On Sonnet 5.5, a request with no thinking field runs with adaptive thinking, and thinking: {"type": "disabled"} returns a 400 error. Send the new between_tools setting instead. With between_tools, thinking only happens between tool calls, and total response time is the same or faster. CODEPython# Before: Claude Sonnet 5 client.messages.create( model="claude-sonnet-5", max_tokens=16000, thinking={"type": "disabled"}, output_config={"effort": "xhigh"}, messages=[{"role": "user", "content": "..."}], )

# After: Claude Sonnet 5.5 client.messages.create( model="claude-sonnet-5-5", max_tokens=16000, thinking={"type": "between_tools"}, output_config={"effort": "high"}, messages=[{"role": "user", "content": "..."}], ) The example also drops effort from xhigh to high, because between_tools has these limits:

between_tools works at low, medium and high effort. At xhigh or max it returns a 400 error; to run there, use adaptive thinking. It takes no other field. Sending display, budget_tokens or block_binding with it returns a 400 error. With between_tools, effort can't change mid-conversation. To vary effort per turn, use adaptive thinking. The short progress updates the model writes between tool calls still come back as thinking blocks, with summary text. Read content blocks by type, and pass these blocks back unchanged with the rest of the assistant turn. Without tools, the response contains only text. It works on every platform that offers Sonnet 5.5, with no beta header. If your SDK version doesn't define between_tools, update it.

If you turn upfront thinking off with between_tools, use adaptive thinking instead for requests without tools that need a few steps of working out.

  1. Replace forced tool_choice with auto plus strict tools

tool_choice of type any or tool returns a 400 error, including on the token counting endpoint. Send auto, mark the tool strict: true so its input matches the schema, and say in the prompt when to use it: CODEPythonweather_tool = { "name": "get_weather", "description": "Get the current weather in a given location", "input_schema": { "type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"], "additionalProperties": False, }, "strict": True, }

client.messages.create( model="claude-sonnet-5-5", max_tokens=1024, tools=[weather_tool], tool_choice={"type": "auto"}, # was {"type": "tool", "name": "get_weather"} messages=[ {"role": "user", "content": "What's the weather in Paris? Use the get_weather tool."} ], ) Strict tool use needs additionalProperties: false on every object.

  1. Keep conversations append-only

Sonnet 5.5 thinking blocks are tied to the model and the conversation. Sonnet 5.5 reads Sonnet 5's thinking blocks, so a conversation you switch from Sonnet 5 to Sonnet 5.5 keeps its reasoning. No other model reads Sonnet 5.5's blocks.

  1. Move computer use to the toolset

On the Claude API and Google Cloud, Sonnet 5.5 supports computer use only through {"type": "computer_toolset_20260801"}; a request that declares computer_20251124 returns a 400 error. Drop the anthropic-beta: computer-use-2025-11-24 header from your requests, and in the SDKs, remove the betas parameter and call the Messages API through the standard client rather than the beta namespace. Replace the tools entry, and update your agent loop for member tool_use blocks, batch actions and toolset_name on results. If you send the fine-grained-tool-streaming-2025-05-14 beta header, remove it too, because alongside a toolset entry it returns a 400 error; set eager_input_streaming: true on each tool that needs it instead. Amazon Bedrock still accepts computer_20251124.

  1. Check your advisor pairing

With the advisor tool, a Sonnet 5.5 executor rejects Opus 4.8, Opus 4.7 and Sonnet 5 as advisors. Accepted advisors include Opus 5.5, Opus 5 and Sonnet 5.5 itself. Advice from every accepted advisor comes back encrypted, as an advisor_redacted_result block, so your code can't read the advice text.

  1. Read text between tool calls from thinking blocks

This change causes no errors, but a UI can stop showing the model's notes between tool calls. Those notes, when longer than a sentence or two, come back as progress-update thinking blocks, which are empty at the default display. With adaptive thinking, set thinking.display to "updates" (beta, with the thinking-display-updates-2026-08-18 header) or "summarized", and render each non-empty thinking block before the tool_use block that follows it. With between_tools, the text comes back without display. Sonnet 5.5 also adds per-message effort (beta), mid-conversation system messages and mid-conversation tool changes (beta). If you're moving from Sonnet 4.6 or earlier, or from Haiku 4.5, the migration guide has a checklist for each starting model. TUNING Re-run your effort sweep Effort levels are recalibrated, so a level doesn't produce the same amount of thinking as it did on Sonnet 5, and your old setting won't carry over. Start with high unless your workload is agentic or latency-sensitive. For agentic coding and multistep tool use, start with medium for well-specified tasks and move to high for harder or longer ones. For chat and other latency-sensitive work, start with medium or low. Use xhigh or max only where your evals show a quality gain. Thinking counts toward max_tokens, so leave room. For agentic coding, set max_tokens to 128,000, the model's maximum, and stream the response. To get less thinking, lower the effort level, because asking the model in the system prompt to think less doesn't reliably reduce it. Remove Sonnet 5 workarounds Existing Sonnet 5 prompts should perform well without changes. If your prompts carry workarounds such as refusal steering, tool-call retry shims, or "do not be lazy," remove them and re-run your evals before tuning anything else. Ask for real checks at low effort Sonnet 5.5 generally checks its work before reporting a change as done, but at low effort it sometimes skips a check that exercises the change. If you see changes reported as done without test or build output, the prompting guide recommends this system-prompt paragraph: CODETextWhen you change code that can be run, built, or type-checked, run a real check that exercises the change before reporting it done: the project's tests, type-checker, or build, or the changed command itself. A syntax-only check, or a check command that failed to start, does not count; if all that is missing is the project's declared dependencies, install them with its own package manager and lockfile (e.g. npm install, pip install -r requirements.txt), never via sudo or the system package manager, unless told not to. Only if no real check can run here, say which one you did not run and why instead of reporting the change as done. Use thinking.display for progress Don't ask the model to write out its reasoning in the response, because that invites reasoning_extraction declines. Read summarized thinking instead: CODEPythonthinking={"type": "adaptive", "display": "summarized"} For user-facing progress notes on their own, use display: "updates" (beta). If you want updates at predictable points, such as a line before the first tool call and a short recap at the end, say so in the system prompt. Cache more of your prompt The minimum cacheable prompt drops to 512 tokens, so shorter system prompts and tool definitions now qualify. A cache read costs a tenth of the input price. Changing the top-level effort between requests invalidates the cache; to run one turn at a different level, use per-message effort (beta), which keeps the cache. REFUSALS AND FALLBACK On our automated behavioral audit, Sonnet 5.5 improves on or matches Sonnet 5 on most measures of alignment and honesty. It's also the first Sonnet model with cybersecurity safeguards similar to those on our most capable models. Most routine software development is unaffected. A declined request returns HTTP 200 with stop_reason: "refusal", and stop_details names one of five categories: cyber, bio, frontier_llm, reasoning_extraction or general_harms. Server-side fallback (fallbacks: "default", beta, Claude API) retries cyber and frontier_llm declines on Sonnet 5. It doesn't retry the other three. You can also use the SDK middleware or your own retry. For legitimate security work, the Cyber Verification Program will soon expand to include Sonnet 5.5. AVAILABILITY Claude Sonnet 5.5 is available today on the platforms below. On the developer platforms, use these model IDs:

Claude API, as claude-sonnet-5-5 Amazon Bedrock, as anthropic.claude-sonnet-5-5 Claude Platform on AWS, as claude-sonnet-5-5 Google Cloud, as claude-sonnet-5-5 Microsoft Foundry, as claude-sonnet-5-5, on Global Standard deployments only

In Claude Code From Claude Code v2.1.284 (Agent SDK for TypeScript v0.3.284 or later), the sonnet alias resolves to Sonnet 5.5 on the Claude API. It runs at medium effort by default, with the 1M context window native. You can't turn thinking off for Sonnet 5.5 in Claude Code, and effort sets how much the model thinks. Sonnet 5.5 has no fast mode. The default model stays Opus 5.5, so switch with /model sonnet for well-scoped tasks. We hope you'll enjoy trying out Sonnet 5.5 and as always feel free to share feedback.

原文入口

阅读原文(claude.dev)

原文将在新窗口打开。收录时间不是内容更新时间;正文、译文与解读的版权归原作者/来源所有,本站仅作个人阅读辅助并保留原文入口;页面时间均为北京时间。

作者/署名来自原文结构化字段(Atom/RSS/HTML meta/JSON-LD;GitHub release 显示的是发布者账号),未经模型补充。

了解来源批准与收录规则