Claude Platform Docs
  • Messages
  • 託管代理
  • 管理

Search...
⌘K
第一步
Claude 簡介快速入門
使用 Claude 進行建構
功能概覽使用 Messages API停止原因與備援拒絕與備援備援額度
模型能力
擴展思考自適應思考Effort任務預算(測試版)快速模式(研究預覽)結構化輸出引用串流 Messages批次處理搜尋結果串流拒絕多語言支援嵌入
工具
概覽工具使用的運作方式教學:建構使用工具的代理定義工具處理工具呼叫平行工具使用Tool Runner (SDK)嚴格工具使用伺服器工具網頁搜尋工具網頁擷取工具程式碼執行工具顧問工具工具搜尋工具記憶工具Bash 工具文字編輯器工具電腦使用工具疑難排解
工具基礎架構
工具參考管理工具上下文工具組合工具使用與提示快取程式化工具呼叫細粒度工具串流
上下文管理
上下文視窗壓縮上下文編輯提示快取對話中系統訊息建構協調模式快取診斷(測試版)Token 計數
處理檔案
Files APIPDF 支援
技能
概覽快速入門最佳實踐企業技能API 中的技能
MCP
遠端 MCP 伺服器MCP 連接器
雲端平台上的 Claude
Amazon BedrockAmazon Bedrock(舊版)AWS 上的 Claude PlatformGoogle CloudMicrosoft Foundry

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
Messages/模型能力

快速模式(研究預覽)

從支援的 Claude Opus 模型獲得高達 2.5 倍的每秒輸出 token 速度。

快速模式可讓 Claude Opus 4.8 和 Claude Opus 4.7 以高達 2.5 倍的每秒輸出 token 速度運作,並採用進階定價。在您的請求中設定 speed: "fast" 並加上 fast-mode-2026-02-01 beta 標頭即可啟用。



快速模式目前處於研究預覽階段。請聯絡您的客戶經理以申請存取權限。如果您沒有客戶經理,請加入等候名單以申請快速模式。



此功能符合「Zero Data Retention」(零資料保留),即 ZDR 的資格。當您的組織具有 ZDR 安排時,透過此功能傳送的資料在 API 回應返回後不會被儲存。

支援的模型

快速模式支援以下模型:

  • Claude Opus 4.8(claude-opus-4-8)
  • Claude Opus 4.7(claude-opus-4-7)


Claude Opus 4.8 的快速模式僅在 Claude API(包括 Claude Managed Agents)上以研究預覽形式推出,不適用於 Amazon Bedrock、Google Cloud 或 Microsoft Foundry。



Claude Opus 4.7 的快速模式已於 2026 年 6 月 25 日棄用,並將於 2026 年 7 月 24 日移除。移除後,對 claude-opus-4-7 發送帶有 speed: "fast" 的請求將回傳錯誤;與 Claude Opus 4.6 不同(請參閱下方說明),Claude Opus 4.7 不會回退至標準速度。模型本身仍可以標準速度使用。若要繼續使用快速模式,請遷移至 Claude Opus 4.8。



自 2026 年 6 月 29 日起,Claude Opus 4.6 不再提供快速模式。對 claude-opus-4-6 發送帶有 speed: "fast" 的請求不會回傳錯誤:這些請求會以標準速度執行,並按標準費率計費,而非快速模式的進階費率,且回應會回報 usage.speed: "standard"。若要繼續使用快速模式,請遷移至 Claude Opus 4.8。

快速模式的運作方式

快速模式以更快的推論設定執行相同的模型,智慧或能力不會有任何變化。

  • 與標準速度相比,每秒輸出 token 速度最高可提升 2.5 倍
  • 速度優勢主要體現在「output tokens per second」(每秒輸出 token 數),即 OTPS,而非「time to first token」(首個 token 時間),即 TTFT
  • 相同的模型權重和行為(並非不同的模型)
  • 與串流相容,在串流中 OTPS 的提升最為明顯

基本用法

client = anthropic.Anthropic()

response = client.beta.messages.create(
    model="claude-opus-4-8",
    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)

定價

快速模式的定價是在標準費率基礎上,依各模型套用倍數,適用於整個上下文視窗,包括超過 20 萬個輸入 token 的請求。下表顯示各支援模型的快速模式定價:

模型輸入輸出
Claude Opus 4.8$10 / MTok$50 / MTok
Claude Opus 4.7$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"。在支援的模型上,快速模式不會因速率限制或容量不足而靜默回退至標準速度(您會收到 429 或 529 錯誤),因此當您在 Claude Opus 4.8 或 Claude Opus 4.7 上請求 speed: "fast" 時,usage.speed 會是 "fast"。在 Claude Opus 4.6 上,由於快速模式不可用,帶有 speed: "fast" 的請求會以標準速度執行並回傳 usage.speed: "standard"。請檢查此欄位以確認請求是以哪種速度處理的。

client = anthropic.Anthropic()

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

print(response.usage.speed)  # "fast" or "standard"
Output
{
  "id": "msg_01XFDUDYJgAACzvnptvVoYEL",
  "type": "message",
  "role": "assistant",
// ...
  "usage": {
    "input_tokens": 8,
    "output_tokens": 12,
    "speed": "fast"
  }
}

若要追蹤整個組織的快速模式使用量和成本,請參閱 Usage and Cost API。

重試與回退

自動重試

當超過快速模式速率限制時,API 會回傳 429 錯誤並附帶 retry-after 標頭。Anthropic SDK 預設會自動重試這些請求最多 2 次(可透過 max_retries 設定),並在每次重試前等待伺服器指定的延遲時間。由於快速模式採用連續 token 補充機制,retry-after 延遲通常很短,一旦有可用容量,請求即可成功。

回退至標準速度



本節介紹的是當快速模式受到速率限制時,可選擇啟用的用戶端回退機制。這與 Claude Opus 4.6 上的行為不同,在該模型上快速模式不可用,請求會自動以標準速度執行。

如果您希望回退至標準速度,而不是等待快速模式容量恢復,請捕捉速率限制錯誤並在不帶 speed: "fast" 的情況下重試。在初始的快速請求上將 max_retries 設為 0,以跳過自動重試並在遇到速率限制錯誤時立即失敗。



從快速速度回退至標準速度會導致提示快取未命中。不同速度的請求不會共用快取的前綴。

由於將 max_retries 設為 0 也會停用其他暫時性錯誤(過載、內部伺服器錯誤)的重試,以下範例會針對這些情況以預設重試設定重新發出原始請求。

client = anthropic.Anthropic()


def create_message_with_fast_fallback(max_retries=0, max_attempts=3, **params):
    try:
        return client.with_options(max_retries=max_retries).beta.messages.create(
            **params
        )
    except anthropic.RateLimitError:
        if params.get("speed") == "fast":
            del params["speed"]
            return create_message_with_fast_fallback(max_retries=max_retries, **params)
        raise
    except (
        anthropic.APIStatusError,
        anthropic.APIConnectionError,
    ) as error:
        if isinstance(error, anthropic.APIStatusError) and error.status_code < 500:
            raise
        if max_attempts > 1:
            return create_message_with_fast_fallback(
                max_retries=max_retries, max_attempts=max_attempts - 1, **params
            )
        raise


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

注意事項

  • 提示快取: 在快速和標準速度之間切換會使提示快取失效。不同速度的請求不會共用快取的前綴。
  • 支援的模型: 快速模式支援 Claude Opus 4.8 和 Claude Opus 4.7(快速模式已棄用;將於 2026 年 7 月 24 日移除,模型本身不受影響)。在 Claude Opus 4.6 上,帶有 speed: "fast" 的請求不會回傳錯誤:這些請求會以標準速度執行並按標準費率計費。在任何其他模型上,發送 speed: "fast" 會回傳錯誤。
  • TTFT: 快速模式的優勢主要體現在每秒輸出 token 數(OTPS),而非首個 token 時間(TTFT)。
  • Batch API: 快速模式不適用於 Batch API。
  • Priority Tier: 快速模式不適用於 Priority Tier 承諾方案。
  • Claude Platform on AWS: 快速模式目前不適用於 Claude Platform on AWS。

後續步驟


結構化輸出

從代理工作流程取得經過驗證的 JSON 結果。

定價

了解 Anthropic 針對模型和功能的定價結構。

Effort

透過 effort 參數控制 Claude 回應時使用的 token 數量,在回應完整度與 token 效率之間取得平衡。


串流訊息

使用伺服器傳送事件逐步串流 Messages API 回應,包括文字、工具使用和擴展思考的增量內容。

Was this page helpful?

  • 支援的模型
  • 快速模式的運作方式
  • 基本用法
  • 定價
  • 速率限制
  • 檢查使用了哪種速度
  • 重試與回退
  • 自動重試
  • 回退至標準速度
  • 注意事項
  • 後續步驟