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)

定價

快速模式的定價為整個上下文視窗標準 Opus 費率的 6 倍,包括超過 200k 輸入 token 的請求。下表顯示 Claude Opus 4.6 快速模式的定價:

輸入輸出
$30 / MTok$150 / MTok

快速模式定價與其他定價修飾符疊加:

  • 提示快取乘數在快速模式定價之上適用
  • 資料駐留乘數在快速模式定價之上適用

如需完整定價詳情,請參閱定價頁面。

速率限制

快速模式有專屬的速率限制,與標準 Opus 速率限制分開。當您的快速模式速率限制超出時,API 會返回帶有 retry-after 標頭的 429 錯誤,指示何時將有可用容量。

回應包含指示您快速模式速率限制狀態的標頭:

標頭說明
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 會返回帶有 retry-after 標頭的 429 錯誤。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。
  • 優先層級: 快速模式不適用於優先層級。

後續步驟

定價

查看詳細的快速模式定價資訊。

速率限制

查看快速模式的速率限制層級。

Effort 參數

使用 effort 參數控制 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,
)