定价
了解 Anthropic 的模型和功能定价结构
本页面提供了 Anthropic 模型和功能的详细定价信息。所有价格均以美元计价。
如需最新的定价信息,请访问 anthropic.com/pricing。
模型定价
下表显示了所有 Claude 模型在不同使用层级的定价:
Model | Base Input Tokens | 5m Cache Writes | 1h Cache Writes | Cache Hits & Refreshes | Output Tokens |
---|---|---|---|---|---|
Claude Opus 4.1 | $15 / MTok | $18.75 / MTok | $30 / MTok | $1.50 / MTok | $75 / MTok |
Claude Opus 4 | $15 / MTok | $18.75 / MTok | $30 / MTok | $1.50 / MTok | $75 / MTok |
Claude Sonnet 4 | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok |
Claude Sonnet 3.7 | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok |
Claude Sonnet 3.5 (deprecated) | $3 / MTok | $3.75 / MTok | $6 / MTok | $0.30 / MTok | $15 / MTok |
Claude Haiku 3.5 | $0.80 / MTok | $1 / MTok | $1.6 / MTok | $0.08 / MTok | $4 / MTok |
Claude Opus 3 (deprecated) | $15 / MTok | $18.75 / MTok | $30 / MTok | $1.50 / MTok | $75 / MTok |
Claude Haiku 3 | $0.25 / MTok | $0.30 / MTok | $0.50 / MTok | $0.03 / MTok | $1.25 / MTok |
MTok = 百万令牌。“基础输入令牌”列显示标准输入定价,“缓存写入”和”缓存命中”特定于提示缓存,“输出令牌”显示输出定价。提示缓存提供 5 分钟(默认)和 1 小时缓存持续时间,以优化不同用例的成本。
上表反映了提示缓存的以下定价倍数:
- 5 分钟缓存写入令牌价格为基础输入令牌价格的 1.25 倍
- 1 小时缓存写入令牌价格为基础输入令牌价格的 2 倍
- 缓存读取令牌价格为基础输入令牌价格的 0.1 倍
功能特定定价
批处理
Batch API 允许异步处理大量请求,输入和输出令牌均享受 50% 折扣。
Model | Batch input | Batch output |
---|---|---|
Claude Opus 4.1 | $7.50 / MTok | $37.50 / MTok |
Claude Opus 4 | $7.50 / MTok | $37.50 / MTok |
Claude Sonnet 4 | $1.50 / MTok | $7.50 / MTok |
Claude Sonnet 3.7 | $1.50 / MTok | $7.50 / MTok |
Claude Sonnet 3.5 (deprecated) | $1.50 / MTok | $7.50 / MTok |
Claude Haiku 3.5 | $0.40 / MTok | $2 / MTok |
Claude Opus 3 (deprecated) | $7.50 / MTok | $37.50 / MTok |
Claude Haiku 3 | $0.125 / MTok | $0.625 / MTok |
有关批处理的更多信息,请参阅我们的批处理文档。
长上下文定价
当使用启用了1M 令牌上下文窗口的 Claude Sonnet 4 时,超过 200K 输入令牌的请求将自动按高级长上下文费率收费:
1M 令牌上下文窗口目前对使用层级 4 的组织和具有自定义速率限制的组织开放测试。1M 令牌上下文窗口仅适用于 Claude Sonnet 4。
≤ 200K 输入令牌 | > 200K 输入令牌 |
---|---|
输入:$3 / MTok | 输入:$6 / MTok |
输出:$15 / MTok | 输出:$22.50 / MTok |
长上下文定价与其他定价修饰符叠加:
- Batch API 50% 折扣适用于长上下文定价
- 提示缓存倍数在长上下文定价基础上应用
即使启用了测试标志,少于 200K 输入令牌的请求仍按标准费率收费。如果您的请求超过 200K 输入令牌,所有令牌都将产生高级定价。
200K 阈值仅基于输入令牌(包括缓存读取/写入)。输出令牌数量不影响定价层级选择,但当超过输入阈值时,输出令牌按更高费率收费。
要检查您的 API 请求是否按 1M 上下文窗口费率收费,请检查 API 响应中的 usage
对象:
通过求和计算总输入令牌:
input_tokens
cache_creation_input_tokens
(如果使用提示缓存)cache_read_input_tokens
(如果使用提示缓存)
如果总数超过 200,000 个令牌,整个请求将按 1M 上下文费率计费。
有关 usage
对象的更多信息,请参阅 API 响应文档。
工具使用定价
Tool use requests are priced based on:
- The total number of input tokens sent to the model (including in the
tools
parameter) - The number of output tokens generated
- For server-side tools, additional usage-based pricing (e.g., web search charges per search performed)
Client-side tools are priced the same as any other Claude API request, while server-side tools may incur additional charges based on their specific usage.
The additional tokens from tool use come from:
- The
tools
parameter in API requests (tool names, descriptions, and schemas) tool_use
content blocks in API requests and responsestool_result
content blocks in API requests
When you use tools
, we also automatically include a special system prompt for the model which enables tool use. The number of tool use tokens required for each model are listed below (excluding the additional tokens listed above). Note that the table assumes at least 1 tool is provided. If no tools
are provided, then a tool choice of none
uses 0 additional system prompt tokens.
Model | Tool choice | Tool use system prompt token count |
---|---|---|
Claude Opus 4.1 | auto , none any , tool | 346 tokens 313 tokens |
Claude Opus 4 | auto , none any , tool | 346 tokens 313 tokens |
Claude Sonnet 4 | auto , none any , tool | 346 tokens 313 tokens |
Claude Sonnet 3.7 | auto , none any , tool | 346 tokens 313 tokens |
Claude Sonnet 3.5 (Oct) (deprecated) | auto , none any , tool | 346 tokens 313 tokens |
Claude Sonnet 3.5 (June) (deprecated) | auto , none any , tool | 294 tokens 261 tokens |
Claude Haiku 3.5 | auto , none any , tool | 264 tokens 340 tokens |
Claude Opus 3 (deprecated) | auto , none any , tool | 530 tokens 281 tokens |
Claude Sonnet 3 | auto , none any , tool | 159 tokens 235 tokens |
Claude Haiku 3 | auto , none any , tool | 264 tokens 340 tokens |
These token counts are added to your normal input and output tokens to calculate the total cost of a request.
有关当前每个模型的价格,请参考上面的模型定价部分。
有关工具使用实现和最佳实践的更多信息,请参阅我们的工具使用文档。
特定工具定价
Bash 工具
The bash tool adds 245 input tokens to your API calls.
Additional tokens are consumed by:
- Command outputs (stdout/stderr)
- Error messages
- Large file contents
完整定价详情请参阅工具使用定价。
代码执行工具
The code execution tool usage is tracked separately from token usage. Execution time is a minimum of 5 minutes. If files are included in the request, execution time is billed even if the tool is not used due to files being preloaded onto the container.
Pricing: $0.05 per session-hour.
文本编辑器工具
The text editor tool uses the same pricing structure as other tools used with Claude. It follows the standard input and output token pricing based on the Claude model you’re using.
In addition to the base tokens, the following additional input tokens are needed for the text editor tool:
Tool | Additional input tokens |
---|---|
text_editor_20250429 (Claude 4) | 700 tokens |
text_editor_20250124 (Claude Sonnet 3.7) | 700 tokens |
text_editor_20241022 (Claude Sonnet 3.5 (deprecated)) | 700 tokens |
完整定价详情请参阅工具使用定价。
网络搜索工具
Web search usage is charged in addition to token usage:
Web search is available on the Anthropic API for $10 per 1,000 searches, plus standard token costs for search-generated content. Web search results retrieved throughout a conversation are counted as input tokens, in search iterations executed during a single turn and in subsequent conversation turns.
Each web search counts as one use, regardless of the number of results returned. If an error occurs during web search, the web search will not be billed.
计算机使用工具
Computer use follows the standard tool use pricing. When using the computer use tool:
System prompt overhead: The computer use beta adds 466-499 tokens to the system prompt
Computer use tool token usage:
Model | Input tokens per tool definition |
---|---|
Claude 4 / Sonnet 3.7 | 735 tokens |
Claude Sonnet 3.5 (deprecated) | 683 tokens |
Additional token consumption:
- Screenshot images (see Vision pricing)
- Tool execution results returned to Claude
If you’re also using bash or text editor tools alongside computer use, those tools have their own token costs as documented in their respective pages.
智能体用例定价示例
在使用 Claude 构建时,了解智能体应用程序的定价至关重要。这些真实世界的示例可以帮助您估算不同智能体模式的成本。
客户支持智能体示例
在构建客户支持智能体时,成本可能如下分解:
处理 10,000 个支持工单的示例计算:
- 每次对话平均约 3,700 个令牌
- 使用 Claude Sonnet 4,输入 15/MTok
- 总成本:每 10,000 个工单约 $22.20
有关此计算的详细演练,请参阅我们的客户支持智能体指南。
通用智能体工作流定价
对于具有多个步骤的更复杂智能体架构:
-
初始请求处理
- 典型输入:500-1,000 个令牌
- 处理成本:每个请求约 $0.003
-
内存和上下文检索
- 检索的上下文:2,000-5,000 个令牌
- 每次检索成本:每次操作约 $0.015
-
行动规划和执行
- 规划令牌:1,000-2,000
- 执行反馈:500-1,000
- 合计成本:每次行动约 $0.045
有关智能体定价模式的综合指南,请参阅我们的智能体用例指南。
成本优化策略
在使用 Claude 构建智能体时:
- 使用适当的模型:为简单任务选择 Haiku,为复杂推理选择 Sonnet
- 实施提示缓存:减少重复上下文的成本
- 批量操作:对非时间敏感任务使用 Batch API
- 监控使用模式:跟踪令牌消耗以识别优化机会
对于高容量智能体应用程序,请考虑联系我们的企业销售团队获取定制定价安排。
其他定价考虑因素
速率限制
速率限制因使用层级而异,影响您可以发出的请求数量:
- 层级 1:具有基本限制的入门级使用
- 层级 2:为增长中的应用程序提高限制
- 层级 3:为成熟应用程序提供更高限制
- 层级 4:最大标准限制
- 企业级:可提供自定义限制
有关详细的速率限制信息,请参阅我们的速率限制文档。
如需更高的速率限制或自定义定价安排,请联系我们的销售团队。
批量折扣
大批量用户可能享受批量折扣。这些折扣按个案协商。
- 标准层级使用上述定价
- 企业客户可以联系销售获取自定义定价
- 可能提供学术和研究折扣
企业定价
对于有特定需求的企业客户:
- 自定义速率限制
- 批量折扣
- 专门支持
- 自定义条款
请通过 sales@anthropic.com 或通过 Anthropic Console 联系我们的销售团队讨论企业定价选项。
计费和付款
- 计费基于实际使用情况按月计算
- 付款以美元处理
- 提供信用卡和发票选项
- 在 Anthropic Console 中可进行使用跟踪
常见问题
如何计算令牌使用量?
令牌是模型处理的文本片段。粗略估计,1 个令牌大约相当于 4 个字符或英语中的 0.75 个单词。确切数量因语言和内容类型而异。
是否有免费层级或试用?
新用户会收到少量免费积分来测试 API。联系销售了解企业评估的延长试用信息。
折扣如何叠加?
Batch API 和提示缓存折扣可以组合使用。例如,同时使用这两个功能与标准 API 调用相比可以显著节省成本。
接受哪些付款方式?
我们接受标准账户的主要信用卡。企业客户可以安排发票和其他付款方式。
如有关于定价的其他问题,请联系 support@anthropic.com。