返回模型列表

Claude Sonnet 4

anthropicanthropic/claude-sonnet-4

Claude Sonnet 4 balances impressive performance for coding with the right speed and cost for high-volume use cases: Coding: Handle everyday development tasks with enhanced performance-power code reviews, bug fixes, API integrations, and feature development with immediate feedback loops. AI Assistants: Power production-ready assistants for real-time applications—from customer support automation to operational workflows that require both intelligence and speed. Efficient research: Perform focused analysis across multiple data sources while maintaining fast response times. Ideal for rapid business intelligence, competitive analysis, and real-time decision support. Large-scale content: Generate and analyze content at scale with improved quality. Create customer communications, analyze user feedback, and produce marketing materials with the right balance of quality and throughput.

Claude Sonnet 4 于 2025 年 5 月 22 日发布,是 Anthropic 面向高吞吐生产负载的中端混合推理模型。它以 $3/$15 每百万 token 的价格提供前沿级编码能力(SWE-bench Verified 72.7 %,高算力下达 80.2 %)与均衡推理,是 Sonnet 3.7 在日常开发、agent 子任务和实时面向客户应用场景的实用升级。

从 TheRouter 路由层视角看,关键运营特性包括:即时响应 + 扩展思考的混合模式;1 M 上下文窗口(beta,2026 年 4 月 30 日下线);以及优秀的指令遵循能力,使其成为多代理系统中的可靠子代理。Sonnet 4 的继任者是 2025 年底发布的 Sonnet 4.5 和 2026 年 2 月发布的 Sonnet 4.6,它们保持相同定价的同时增强了长上下文与计算机使用能力。

适合使用
  • • 对价格敏感的大规模代码审查、缺陷分流和增量功能开发场景
  • • 作为 Claude Code 或多代理流水线中的子代理(搜索、检索、独立重构)
  • • 需要强指令遵循与 memory file 能力的生产级客服与内部效率助手
  • • 通过 Claude Code SDK 驱动的 CI/CD 自动化与 GitHub Actions 后台任务
不适合使用
  • • 跨越百万 token 的长程单代理任务——请路由到 Opus 4.x 或 Sonnet 4.6 以获得 1 M 上下文与更高持续一致性
  • • 需要最高编码前沿表现(SWE-bench >80 %)的场景——Sonnet 4.6 或 Opus 4.6/4.7 提供更高分数但成本更高

供应商自营与 TheRouter 服务形态的差异

供应商自己运营时

Anthropic 生命周期表将原生 Claude API id 'claude-sonnet-4-20250514' 标记为已在 Anthropic 运营平台退役,时间线为 2026-04-14 宣布废弃、2026-06-15 退役。Anthropic 建议迁移到 'claude-sonnet-4-6'。

在 TheRouter 上

TheRouter 仍保留公开模型页和 OpenAI 兼容 id 'anthropic/claude-sonnet-4',方便需要稳定引用的客户核对;但新集成应路由到 'anthropic/claude-sonnet-4.6',因为上游退役会影响实时可用性和支持保障。

上下文长度
1M
最大输出
64K
输入价格每百万 tokens
$3.24每百万 Tokens
输出价格每百万 tokens
$16.20每百万 Tokens

模态能力

文本图像PDF→文本

能力

视觉理解

价格明细

类型费率
输入$3.24 每百万 Tokens
输出$16.20 每百万 Tokens

支持参数

temperaturemax_tokenstop_ptoolstool_choiceresponse_formatreasoningstop

模型规格

发布日期2025-05-22www.anthropic.com ↗已核实
Anthropic 模型 idclaude-sonnet-4-20250514aws.amazon.com ↗已核实
训练数据截止未公开披露未知
上下文窗口标准 200 k;通过 context-1m-2025-08-07 beta 可达 1 M(2026-04-30 下线)platform.claude.com ↗已核实
最大输出 token64 000www.anthropic.com ↗已核实
推理模式即时响应(默认)+ 扩展思考(最高 64 k token)www.anthropic.com ↗已核实
部署平台Anthropic API、Amazon Bedrock、Google Cloud Vertex AIaws.amazon.com ↗已核实
许可Anthropic Usage Policy(闭源,仅 API)已核实

基准成绩

BenchmarkDistributionScoreSource
SWE-bench Verified
未使用扩展思考;高算力并行采样可达 80.2 %。
72.7%%www.anthropic.com ↗
GPQA Diamond
未使用扩展思考;启用扩展思考后更高。
70.0%%www.anthropic.com ↗
MMMLU
未使用扩展思考。
85.4%%www.anthropic.com ↗
MMMU
未使用扩展思考。
72.6%%www.anthropic.com ↗
AIME
未使用扩展思考。
33.1%%www.anthropic.com ↗
OSWorld
计算机使用基准;Sonnet 4.5 后续将此提升至 61.4 %。
42.2%%www.anthropic.com ↗

API 使用示例

所有新集成都应使用下方示例中的全球端点 api.therouter.ai;旧中国加速端点已下线。

cURL
curl https://api.therouter.ai/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer $THE_ROUTER_API_KEY"   -d '{
    "model": "anthropic/claude-sonnet-4",
    "messages": [
      {"role": "user", "content": "Summarize the key points from this input."}
    ]
  }'

API 使用指南

完整 API 参考 →

Chat 调用

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"anthropic/claude-sonnet-4","messages":[{"role":"user","content":"Hello"}]}'

anthropic 其他模型

同类模型

跨供应商的相似能力档位

动态与变更

2026-04-14

Anthropic 在 Claude API 上废弃 Claude Sonnet 4

Anthropic 废弃表显示 Claude Sonnet 4 于 2026-04-14 废弃、2026-06-15 退役,建议替代模型为 Claude Sonnet 4.6。TheRouter 此页应作为兼容性参考,而不是新部署推荐。

2025-09-29

Claude Sonnet 4.5 以相同 $3/$15 Sonnet 价格层发布

Anthropic 推出 Sonnet 4.5,在保持 Sonnet 4 输入/输出价格不变的同时增强编码、计算机使用和长程代理能力。它先成为实际升级路径,随后 Sonnet 4.6 被指定为退役替代。

TheRouter 编辑重写anthropic.com/news ↗

近期动态

常见问题

新的 TheRouter 集成还应该选择 Claude Sonnet 4 吗?

不应该。Anthropic 已将原生 Sonnet 4 API 模型列为已退役,并建议使用 Claude Sonnet 4.6。Sonnet 4 只适合兼容性核对、历史比较,或已经验证实时上游可用性的受控迁移。

TheRouter 编辑重写platform.claude.com ↗
与 Sonnet 4 最初发布页相比,后续有什么变化?

发布信息仍适合查看能力历史:Sonnet 4 发布时具备即时响应加扩展思考混合模式、$3/$15 定价、64k 最大输出和 72.7% SWE-bench Verified。后续变化在生命周期上:Anthropic 已退役原生 API 模型,并指向 Sonnet 4.6。

TheRouter 编辑重写www.anthropic.com ↗
TheRouter 的 OpenAI 兼容接口会改变 Anthropic 的退役状态吗?

不会。TheRouter 可以统一请求/响应格式、模型 id 和路由行为,但不能把 Anthropic 运营侧已退役的上游模型变成 active 模型。请用本页的差异说明区分 TheRouter 兼容性与供应商生命周期支持。

TheRouter 编辑重写platform.claude.com ↗
事实档案 — 本页每条断言可在此回溯来源
来源URL采集于
发布日期www.anthropic.com ↗2026-05-25已核实
Anthropic 模型 idaws.amazon.com ↗2026-05-25已核实
训练数据截止——未知
上下文窗口platform.claude.com ↗2026-09-10已核实
最大输出 tokenwww.anthropic.com ↗2026-05-25已核实
推理模式www.anthropic.com ↗2026-05-25已核实
部署平台aws.amazon.com ↗2026-05-25已核实
许可——已核实
SWE-bench Verifiedwww.anthropic.com ↗2026-05-25已核实
GPQA Diamondwww.anthropic.com ↗2026-05-25已核实
MMMLUwww.anthropic.com ↗2026-05-25已核实
MMMUwww.anthropic.com ↗2026-05-25已核实
AIMEwww.anthropic.com ↗2026-05-25已核实
OSWorldwww.anthropic.com ↗2026-05-25已核实
Anthropic 在 Claude API 上废弃 Claude Sonnet 4platform.claude.com/model-deprecations ↗2026-09-10已核实
Claude Sonnet 4.5 以相同 $3/$15 Sonnet 价格层发布anthropic.com/news ↗2026-09-10已核实
新的 TheRouter 集成还应该选择 Claude Sonnet 4 吗?platform.claude.com ↗2026-09-10待核实
与 Sonnet 4 最初发布页相比,后续有什么变化?www.anthropic.com ↗2026-09-10待核实
TheRouter 的 OpenAI 兼容接口会改变 Anthropic 的退役状态吗?platform.claude.com ↗2026-09-10待核实
帮助与联系