Claude Platform Docs
  • 消息
  • 托管智能体
  • 管理

Search...
⌘K

Log in
服务层级
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Claude Platform Docs

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Claude on AWS
  • Claude on Google Cloud

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
API 参考/支持与配置

服务层级

不同的服务层级让您能够根据应用程序的需求,在可用性、性能和可预测的成本之间取得平衡。

Anthropic 提供三种服务层级:

  • 优先层级(Priority Tier): 最适合部署在生产环境中的工作流,这类场景对时效性、可用性和可预测的定价有较高要求
  • 标准层级(Standard): 默认层级,适用于试点项目以及日常用例的规模化扩展
  • 批处理层级(Batch): 最适合可以等待的异步工作流,或希望在常规容量之外运行以获益的场景

标准层级

标准层级是所有 API 请求的默认服务层级。API 会将这些请求与所有其他请求一同按优先级处理,并尽力提供可用性。

优先层级

API 会将此层级的请求优先于所有其他请求进行处理。这种优先级处理有助于最大限度地减少"服务器过载"错误,即使在高峰时段也是如此。

如需了解更多信息,请参阅开始使用优先层级

请求如何被分配层级

在处理请求时,Anthropic 会在以下情况下将请求分配到优先层级:

  • 您的组织拥有足够的优先层级输入令牌每分钟容量
  • 您的组织拥有足够的优先层级输出令牌每分钟容量

Anthropic 按以下方式计算优先层级容量的使用量:

输入令牌

  • 缓存读取按每个从缓存读取的令牌计 0.1 个令牌
  • 缓存写入(5 分钟 TTL)按每个写入缓存的令牌计 1.25 个令牌
  • 缓存写入(1 小时 TTL)按每个写入缓存的令牌计 2.00 个令牌
  • 对于在 Claude Opus 4.6、Claude Sonnet 4.6 及更高版本模型上使用仅限美国推理(inference_geo: "us")的请求,输入令牌按每个令牌计 1.1 个令牌
  • 所有其他输入令牌按每个令牌计 1 个令牌

输出令牌

  • 对于在 Claude Opus 4.6、Claude Sonnet 4.6 及更高版本模型上使用仅限美国推理(inference_geo: "us")的请求,输出令牌按每个令牌计 1.1 个令牌
  • 所有其他输出令牌按每个令牌计 1 个令牌

否则,请求将按标准层级处理。



这些消耗率反映了每种令牌类型的相对定价。例如,在 Opus 4.6、Sonnet 4.6 及更高版本模型上,仅限美国推理的定价为 1.1 倍,因此使用 inference_geo: "us" 消耗的每个令牌会从您的优先层级容量中扣除 1.1 个令牌。



被分配到优先层级的请求会同时消耗优先层级容量和常规速率限制。 如果处理该请求会超出速率限制,则该请求将被拒绝。

使用服务层级

您可以通过设置 service_tier 参数来控制请求可以使用哪些服务层级:

Python
message = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello, Claude!"}],
    service_tier="auto",  # Automatically use Priority Tier when available, fallback to standard
)
print(message.usage.service_tier)

service_tier 参数接受以下值:

  • "auto"(默认)- 如果优先层级容量可用则使用,否则回退到您的其他容量
  • "standard_only" - 仅使用标准层级容量,当您不想使用优先层级容量时非常有用

响应中的 usage 对象也包含分配给该请求的服务层级:

{
  "usage": {
    "input_tokens": 410,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "output_tokens": 585,
    "service_tier": "priority"
  }
}

这使您能够确定该请求被分配到了哪个服务层级。

当对已承诺优先层级的模型请求 service_tier="auto" 时,以下响应标头可提供相关信息:

anthropic-priority-input-tokens-limit: 10000
anthropic-priority-input-tokens-remaining: 9618
anthropic-priority-input-tokens-reset: 2025-01-12T23:11:59Z
anthropic-priority-output-tokens-limit: 10000
anthropic-priority-output-tokens-remaining: 6000
anthropic-priority-output-tokens-reset: 2025-01-12T23:12:21Z

您可以通过这些标头的存在来检测您的请求是否符合优先层级的条件,即使该请求已超出限制。

开始使用优先层级

如果您对以下方面感兴趣,可以考虑承诺购买优先层级容量:

  • 更高的可用性: 目标 99.5% 的正常运行时间,并享有优先分配的计算资源
  • 成本控制: 可预测的支出,以及更长承诺期带来的折扣
  • 灵活的溢出处理: 当超出已承诺的容量时,自动回退到标准层级

承诺购买优先层级需要确定以下内容:

  • 每分钟输入令牌数
  • 每分钟输出令牌数
  • 承诺期限(1、3、6 或 12 个月)
  • 特定的模型版本


您购买的输入与输出令牌的比例非常重要。根据您的实际流量模式来确定优先层级容量的规模,有助于最大限度地利用您已购买的令牌。

支持的模型

优先层级支持所有可用的 Claude 模型(包括 Claude Fable 5 和 Claude Opus 4.8),但 Claude Mythos Preview 和 Claude Mythos 5 除外。

有关可用模型的更多详细信息,请查看模型概览。

如何访问优先层级

要开始使用优先层级:

  1. 联系销售团队以完成配置。
  2. (可选)更新您的 API 请求,将 service_tier 参数设置为 auto。
  3. 通过响应标头和 Claude Console 监控您的使用情况。

Was this page helpful?

  • 标准层级
  • 优先层级
  • 请求如何被分配层级
  • 使用服务层级
  • 开始使用优先层级
  • 支持的模型
  • 如何访问优先层级