GPT-Image 2.6 Flare、Sunburst 已上线低至 $0.025 一张图

Claude Sonnet 4.5 下线了怎么办?报错原因和换到 Sonnet 5.5 的改法

从 2026 年 11 月 30 日起,请求里还写 Claude Sonnet 4.5 的都会在 Claude API 上失败,Anthropic 给出的替代模型是 Claude Sonnet 5.5。

Kiki, OmniaKey COO8 分钟阅读
本页内容

Claude Sonnet 4.5 已于 2026 年 11 月 30 日在 Claude API 下线。现在请求里还写 claude-sonnet-4-5 或 claude-sonnet-4-5-20250929,会收到 404 not_found_error。改法是改发 Claude Sonnet 5.5 的 ID claude-sonnet-5-5(Anthropic 弃用页面,2026 年 12 月 2 日核对)。

简短答案

  • 2026 年 11 月 30 日在 Claude API 下线,不带日期的 claude-sonnet-4-5 一起下线。
  • 旧请求返回 HTTP 404,错误类型是 not_found_error。
  • Amazon Bedrock 为老客户保留到 2027 年 4 月 8 日。Google 托管的 Google Cloud 在 2026 年 11 月 30 日关停。
  • 要改的不只是模型 ID,还有几个 Sonnet 5.5 会拒绝的请求设置。

Claude Sonnet 4.5 还能用吗?

不能,Claude API 上已经不能用。Anthropic 的弃用页面把 claude-sonnet-4-5-20250929 标为 Retired。这个 ID 在 2026 年 9 月 30 日弃用,2026 年 11 月 30 日下线。页面还写明,这次下线包含 claude-sonnet-4-5,也就是同一个模型不带日期的 ID(2026 年 12 月 2 日核对)。2026 年 11 月 30 日的发布说明说,发到 Claude API 的请求现在都会报错。

11 月 30 日这个日期管的是 Anthropic 自己运营的平台,合作云厂商各有自己的时间表。

平台状态日期
Claude API下线2026 年 11 月 30 日
Claude Platform on AWS下线2026 年 11 月 30 日
Google Cloud(Anthropic 托管)下线2026 年 11 月 30 日
Microsoft Foundry下线2026 年 11 月 30 日
Amazon BedrockLegacy,仅老客户2027 年 4 月 8 日结束
Google Cloud(Google 托管)已关停2026 年 11 月 30 日

如果你的代码或工具还在发 4.5 的两个 Claude API ID 之一,今天调用的就是一个已下线的模型。想看哪些 API Key 在下线前还在调它,可以打开 Claude Console 的 Usage 页面。Anthropic 的弃用页面指向这里:点 Export,再读导出的 CSV,里面按 API Key 和模型拆开了用量。

旧请求会收到什么报错?

Messages API 对已下线的模型返回 HTTP 404。错误类型是 not_found_error(Anthropic 弃用页面,2026 年 12 月 2 日核对)。

报错是 JSON,顶层一个 error 对象,里面有 type 和 message。另有一个顶层 request_id,它和响应头 request-id 的值一致(Anthropic API 报错页面,2026 年 12 月 2 日核对)。

Anthropic 给的 not_found_error 示例用的是通用文案 "The requested resource could not be found."。实际返回的 message 更长。两份公开的 GitHub 构建日志在下线当天和第二天早上记下了它。一个是 onestudytoday 仓库 的定时构建(2026 年 11 月 30 日 23:58 UTC)。另一个是 SolidAxisGroup/luubu-guide 的文档监控(2026 年 12 月 1 日 03:59 UTC)。两个 issue 都是机器人账号开的。

json
{
  "type": "error",
  "error": {
    "type": "not_found_error",
    "message": "model: claude-sonnet-4-5 was not found. It was retired on 2026-11-30. See https://platform.claude.com/docs/en/about-claude/model-deprecations"
  },
  "request_id": "req_011ChaKf7Dtv3TGJLeKTS2ou"
}

要读的是 message 那一段:它写了模型名和下线日期,所以带着这段文字的 404 就是下线本身,不是模型名写错了。message 不一样的 404 指别的地方。去查接口路径和 URL 里的资源 ID(Anthropic API 报错页面,2026 年 12 月 2 日核对)。

会失败的请求长这样:

bash
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Summarize this changelog."}]
  }'

这个报错不是我们自己遇到的。OmniaKey 不提供 Claude Sonnet 4.5,上面的报错内容来自那些构建日志。

Sonnet 4.5 现在还能在哪里跑?

Amazon Bedrock 上还能用,面向老客户,到 2027 年 4 月 8 日。Google 托管的 Google Cloud 已在 2026 年 11 月 30 日关停 Sonnet 4.5。

Anthropic 的 Bedrock 页面把 Sonnet 4.5 列为弃用。基础模型 ID 是 anthropic.claude-sonnet-4-5-20250929-v1:0,另有 global、us、eu、jp 四个推理配置文件(2026 年 12 月 2 日核对)。AWS 的生命周期页面列出三个日期。Legacy 是 2026 年 10 月 8 日,EOL 是 2027 年 4 月 8 日。public extended access 从 2027 年 1 月 8 日开始。US GovCloud 的 Legacy 是 2026 年 10 月 27 日。EOL 是 2027 年 4 月 27 日(2026 年 12 月 2 日核对)。

Legacy 是一段很窄的窗口。新客户不能用 Legacy 模型。老客户连续 15 天不用,也可能失去访问(AWS 生命周期页面,2026 年 12 月 2 日核对)。从 2027 年 1 月 8 日起进入 public extended access。AWS 说活跃用户可以用到 EOL 日期,但要预期模型提供方设定的更高价格。2027 年 4 月 8 日当天或之后不久,发到这个版本的请求就会失败。

Google 的 Sonnet 4.5 页面把 Google 托管版本标为自 2026 年 9 月 29 日起弃用。它只对老客户开放,关停日期是 2026 年 11 月 30 日(页面最后更新于 2026 年 12 月 1 日)。Anthropic 的 Google 托管表格里已经没有 Sonnet 4.5 这一行。这个日期以 Google 的页面为准。

怎么换到 Sonnet 5.5?

如果请求只发 messages,把模型 ID 改成 claude-sonnet-5-5,再看 token 上限。Sonnet 5.5 默认开启 thinking,思考也算进这个上限。生产环境的请求大多不只发 messages,下面这些设置也要一起看。

Sonnet 5.5 每 token 更便宜,上下文窗口也更大。输入每百万 token $2,输出每百万 token $10,Sonnet 4.5 是 $3 和 $15。缓存读取 $0.10 对 $0.30。上下文窗口 1M token 对 200K。最大输出 128K 对 64K(Anthropic 价格页和模型总览,2026 年 12 月 2 日核对)。

模型输入输出缓存读取
Sonnet 4.5$3$15$0.30
Sonnet 5.5$2$10$0.10

Anthropic 的 Sonnet 5.5 迁移指南列出了按 4.5 写的代码要改的地方(2026 年 12 月 2 日核对):

如果 Sonnet 4.5 的代码在 Sonnet 5.5 上
写 claude-sonnet-4-5 或带日期的 ID改成 claude-sonnet-5-5
预填最后一条 assistant 消息返回 400;把指令放进 system prompt,或用结构化输出
发 temperature、top_p 或 top_k删掉;API 版本 2026-10-21 上每个都会返回 400
用 thinking 配 budget_tokens改成 effort 级别;thinking 默认开启并计入 max_tokens
不设 effort 级别设 output_config.effort;默认是 high
发旧的 beta header删掉或替换(列表见下)
发 output_format移到 output_config.format
发 computer use 的 computer_20250124Sonnet 5.5 不接受

要清掉的 beta header:

  • interleaved-thinking-2025-05-14:删掉,adaptive thinking 会自动交错。
  • 任何上下文窗口的 beta header:删掉。
  • fine-grained-tool-streaming-2025-05-14:换成在每个需要它的工具上写 eager_input_streaming: true。

采样参数最容易让调好的提示词翻车。Anthropic 的弃用页面说,非默认的 temperature、top_p 或 top_k 在 Claude 4.7 及之后的模型上返回 400。API 版本 2026-10-21 上任何值都会返回 400,默认值也一样(2026 年 12 月 2 日核对)。去掉之后,请求按 1.0 的温度采样,也没有别的设置能替代调低的温度(Anthropic API 迁移页面)。

leninworld 在 awesome-llm-apps 的 issue #1376(2026 年 11 月 28 日)里讲了三个仍默认用 Sonnet 4.5 的应用,说得很直接:“只换模型 ID 是不够的。”同一份报告说,非默认 temperature 在 Sonnet 5.5 上返回 400。

改好的请求:新的模型 ID,加上更大的 max_tokens,因为现在 thinking 也计入其中。

bash
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "max_tokens": 16000,
    "messages": [{"role": "user", "content": "Summarize this changelog."}]
  }'

按这个顺序重测:

  1. 在 Sonnet 5.5 上发一个真实请求,记下返回的模型 ID。
  2. 去掉采样参数和预填的 assistant 消息。
  3. 提高 max_tokens:thinking 默认开启并计入其中。
  4. 去掉旧 beta header,移动输出格式设置,替换旧的 computer use 工具版本。

Claude Code 用户还有第二个地方藏着旧 ID。Anthropic 的模型配置页面(2026 年 12 月 2 日核对)说,sonnet 别名在 Amazon Bedrock 上仍然指向 Sonnet 4.5。在 v2.1.332 之前的 Google Cloud Agent Platform 和 Microsoft Foundry 上也是如此。改法是配置里凡是写 Sonnet 4.5 的地方都换掉。这些地方包括 ANTHROPIC_DEFAULT_SONNET_MODEL、ANTHROPIC_MODEL、--model 参数和 availableModels 白名单。在 Bedrock 上还要指定更新的 Sonnet,因为 AWS 在 2027 年 4 月 8 日结束 Sonnet 4.5。

在 Claude API 上,把 Claude Code 升到 v2.1.284 或更高版本,这是第一个支持 Sonnet 5.5 的版本。升级后再设置模型。通过我们的网关,Claude Code 2.0.76 在 2026 年 10 月 31 日没有设置模型时会请求 claude-sonnet-4-5-20250929,然后失败。加上 --model claude-sonnet-5-5 就正常了(Claude Code 2.0 实测,含命令和结果)。

如果你想换一种方式跑新模型,OmniaKey 上有 Claude Sonnet 5.5。我们在 2026 年 12 月 2 日 02:42 UTC 通过 OmniaKey 发了一个请求。返回 HTTP 200、stop reason 为 end_turn、33 个输入 token 和 61 个输出 token,耗时 1.9 秒:

bash
curl https://api.omniakey.com/v1/messages \
  -H "x-api-key: $OMNIAKEY_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-5-5",
    "max_tokens": 16000,
    "messages": [
      {"role": "user", "content": "In one sentence, explain what an HTTP 404 status code tells an API client."}
    ]
  }'

响应只保留关键字段:

json
{
  "model": "claude-sonnet-5-5",
  "stop_reason": "end_turn",
  "usage": {"input_tokens": 33, "output_tokens": 61}
}

回复里写的是新的模型 ID。任务适合更小或更大的模型时,OmniaKey 也提供 Claude Haiku 5.5 和 Claude Opus 5.5。想看 Sonnet 5.5 的跑分和单任务成本,读 Sonnet 5.5 评测;当前价格在价格页。

常见问题

Claude Sonnet 4.5 是什么时候下线的?

Claude Sonnet 4.5 在 2026 年 11 月 30 日下线,范围包括 Claude API 和 Anthropic 运营的其它平台。距离 Anthropic 在 9 月 30 日通知开发者,过了 61 天(Anthropic 弃用页面,2026 年 12 月 2 日核对)。Anthropic 对公开模型至少提前 60 天通知。

我还能用 Claude Sonnet 4.5 吗?

在 Claude API、Claude Platform on AWS、Google Cloud(Anthropic 托管)和 Microsoft Foundry 上不能用了。这些平台的请求都会失败,Claude API 返回 404 not_found_error。Amazon Bedrock 的老客户可以用到 2027 年 4 月 8 日。AWS 说从 2027 年 1 月 8 日起要预期更高的价格,连续 15 天不用访问可能失效。Google 托管的 Google Cloud 已在 2026 年 11 月 30 日关停。

弃用(deprecated)和下线(retired)有什么区别?

弃用的模型还能用,只是不再推荐,Anthropic 会给出替代模型和下线日期。下线的模型已经不可用,请求会失败(Anthropic 弃用页面,2026 年 12 月 2 日核对)。Sonnet 4.5 从 2026 年 9 月 30 日弃用,到 2026 年 11 月 30 日下线。它现在的状态是 Retired。

Sonnet 4.5 在 Amazon Bedrock 上什么时候下线?

商业区域是 2027 年 4 月 8 日,US GovCloud 是 2027 年 4 月 27 日(AWS 生命周期页面,2026 年 12 月 2 日核对)。Bedrock 的 Legacy 日期是 2026 年 10 月 8 日,public extended access 从 2027 年 1 月 8 日开始。从 EOL 日期起,发到这个版本的请求会失败。

Claude Opus 4.5 也会下线吗?

会。claude-opus-4-5-20251101 在 2026 年 11 月 23 日弃用,2027 年 1 月 22 日下线,替代模型是 claude-opus-5-5。不带日期的 ID 也在其中(Anthropic 弃用页面,2026 年 12 月 2 日核对)。2026 年 12 月 2 日它的状态是 Deprecated,所以还能响应。

核验来源

下面的来源都在 2026 年 12 月 2 日核对过。

更新于 2026 年 12 月 2 日。云厂商改动 Sonnet 4.5 的下线日期时,我们会更新这些日期。

文中提到的模型

Claude Sonnet 4.5Claude Sonnet 5.5Anthropic模型弃用API 报错

相关文章

最新文章

热门指南