Claude Sonnet 4 API 最高支持 100 万 token 上下文窗口
Anthropic 宣布其模型 Claude Sonnet 4 现已在 Anthropic API、Amazon Bedrock 以及即将上线的 Google Cloud Vertex AI 中全面支持 100 万 token 的上下文窗口。这一容量是此前 20 万 token 的五倍,使得模型能够一次性处理超过 7.5 万行代码或数百份文档。
定价方面,Anthropic 采用了分级策略。配合提示缓存与批处理技术,成本还可进一步降低 50%。要使用 1M token 上下文窗口,开发者需要在 API 请求中加入 context-1m-2025-08-07betas 标头。此外,长上下文请求将有独立的速率限制。
| Input | Output | |
|---|---|---|
| Prompts ≤ 200K | $3 / MTok | $15 / MTok |
| Prompts > 200K | $6 / MTok | $22.50 / MTok |
Claude Sonnet 4 pricing on the Anthropic API
该功能目前向 API Tier 4 用户及定制速率限制的客户开放公测,并计划在未来数周内逐步扩大开放范围。
https://docs.anthropic.com/en/docs/build-with-claude/context-windows#1m-token-context-window

