Loading...
  • 构建
  • 管理
  • 模型与定价
  • 客户端 SDK
  • API 参考
Search...
⌘K
Log in
快速模式(测试版:研究预览)
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Solutions

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

Partners

  • Amazon Bedrock
  • Google Cloud's Vertex AI

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
构建/模型能力

快速模式(测试版:研究预览)

为 Claude Opus 4.6 提供更高的输出速度,显著提升对延迟敏感和智能体工作流的 token 生成速率。

Was this page helpful?

快速模式为 Claude Opus 4.6 提供显著更快的输出 token 生成速度。通过在 API 请求中设置 speed: "fast",您可以从同一模型获得高达 2.5 倍的每秒输出 token 数,但需支付高级定价。

快速模式处于测试版(研究预览)阶段。加入候补名单以申请访问权限。在 Anthropic 收集反馈期间,可用性有限。

This feature is eligible for Zero Data Retention (ZDR). When your organization has a ZDR arrangement, data sent through this feature is not stored after the API response is returned.

支持的模型

快速模式支持以下模型:

  • Claude Opus 4.6 (claude-opus-4-6)

快速模式的工作原理

快速模式以更快的推理配置运行相同的模型。智能和能力不会发生变化。

  • 与标准速度相比,每秒输出 token 数最高提升 2.5 倍
  • 速度优势集中在每秒输出 token 数(OTPS),而非首 token 时间(TTFT)
  • 相同的模型权重和行为(不是不同的模型)

基本用法

client = anthropic.Anthropic()

response = client.beta.messages.create(
    model="claude-opus-4-6",
    max_tokens=4096,
    speed="fast",
    betas=["fast-mode-2026-02-01"],
    messages=[
        {"role": "user", "content": "Refactor this module to use dependency injection"}
    ],
)

print(response.content[0].text)

定价

快速模式在整个上下文窗口(包括超过 200k 输入 token 的请求)按标准 Opus 费率的 6 倍计费。下表显示了 Claude Opus 4.6 快速模式的定价:

输入输出
$30 / MTok$150 / MTok

快速模式定价与其他定价修饰符叠加:

  • 提示缓存乘数在快速模式定价基础上叠加
  • 数据驻留乘数在快速模式定价基础上叠加

有关完整定价详情,请参阅定价页面。

速率限制

快速模式有专用速率限制,与标准 Opus 速率限制分开。当您的快速模式速率限制被超出时,API 会返回 429 错误,并附带 retry-after 标头,指示何时将有可用容量。

响应包含指示您快速模式速率限制状态的标头:

标头描述
anthropic-fast-input-tokens-limit每分钟最大快速模式输入 token 数
anthropic-fast-input-tokens-remaining剩余快速模式输入 token 数
anthropic-fast-input-tokens-reset快速模式输入 token 限制重置时间
anthropic-fast-output-tokens-limit每分钟最大快速模式输出 token 数
anthropic-fast-output-tokens-remaining剩余快速模式输出 token 数
anthropic-fast-output-tokens-reset快速模式输出 token 限制重置时间

有关特定层级的速率限制,请参阅速率限制页面。

检查使用的速度

响应的 usage 对象包含一个 speed 字段,指示使用了哪种速度,值为 "fast" 或 "standard":

Output
{
  "id": "msg_01XFDUDYJgAACzvnptvVoYEL",
  "type": "message",
  "role": "assistant",
// ...
  "usage": {
    "input_tokens": 523,
    "output_tokens": 1842,
    "speed": "fast"
  }
}

要跟踪整个组织的快速模式使用情况和费用,请参阅使用量和费用 API。

重试与回退

自动重试

当快速模式速率限制被超出时,API 会返回 429 错误,并附带 retry-after 标头。Anthropic SDK 默认自动重试这些请求最多 2 次(可通过 max_retries 配置),在每次重试前等待服务器指定的延迟时间。由于快速模式使用连续 token 补充,retry-after 延迟通常很短,一旦容量可用,请求即可成功。

回退到标准速度

如果您希望回退到标准速度而不是等待快速模式容量,请捕获速率限制错误并在不使用 speed: "fast" 的情况下重试。在初始快速请求中将 max_retries 设置为 0,以跳过自动重试并在速率限制错误时立即失败。

从快速速度回退到标准速度将导致提示缓存未命中。不同速度的请求不共享缓存前缀。

由于将 max_retries 设置为 0 也会禁用其他瞬态错误(过载、内部服务器错误)的重试,以下示例会针对这些情况以默认重试重新发出原始请求。

注意事项

  • 提示缓存: 在快速速度和标准速度之间切换会使提示缓存失效。不同速度的请求不共享缓存前缀。
  • 支持的模型: 快速模式目前仅支持 Opus 4.6。对不支持的模型发送 speed: "fast" 会返回错误。
  • TTFT: 快速模式的优势集中在每秒输出 token 数(OTPS),而非首 token 时间(TTFT)。
  • 批处理 API: 快速模式不适用于批处理 API。
  • 优先级层: 快速模式不适用于优先级层。

后续步骤

定价

查看详细的快速模式定价信息。

速率限制

查看快速模式的速率限制层级。

努力参数

使用努力参数控制 token 使用量。

response = client.beta.messages.create(
    model="claude-opus-4-6",
    max_tokens=1024,
    speed="fast",
    betas=["fast-mode-2026-02-01"],
    messages=[{"role": "user", "content": "Hello"}],
)

print(response.usage.speed)  # "fast" or "standard"
client = anthropic.Anthropic()


def create_message_with_fast_fallback(max_retries=None, max_attempts=3, **params):
    try:
        return client.beta.messages.create(**params, max_retries=max_retries)
    except anthropic.RateLimitError:
        if params.get("speed") == "fast":
            del params["speed"]
            return create_message_with_fast_fallback(**params)
        raise
    except (
        anthropic.InternalServerError,
        anthropic.OverloadedError,
        anthropic.APIConnectionError,
    ):
        if max_attempts > 1:
            return create_message_with_fast_fallback(
                max_attempts=max_attempts - 1, **params
            )
        raise


message = create_message_with_fast_fallback(
    model="claude-opus-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
    betas=["fast-mode-2026-02-01"],
    speed="fast",
    max_retries=0,
)