Loading...
    • 開發者指南
    • API 參考
    • MCP
    • 資源
    • 發行說明
    Search...
    ⌘K
    入門
    Claude 簡介快速開始
    模型與定價
    模型概覽選擇模型Claude 4.6 新功能遷移指南模型棄用定價
    使用 Claude 構建
    功能概覽使用 Messages API處理停止原因提示詞最佳實踐
    上下文管理
    上下文視窗壓縮上下文編輯
    功能
    提示詞快取延伸思考自適應思考思考力度串流訊息批次處理引用多語言支援Token 計數嵌入視覺PDF 支援Files API搜尋結果結構化輸出
    工具
    概覽如何實作工具使用細粒度工具串流Bash 工具程式碼執行工具程式化工具呼叫電腦使用工具文字編輯器工具網頁擷取工具網頁搜尋工具記憶工具工具搜尋工具
    Agent Skills
    概覽快速開始最佳實踐企業級 Skills透過 API 使用 Skills
    Agent SDK
    概覽快速開始TypeScript SDKTypeScript V2(預覽版)Python SDK遷移指南
    API 中的 MCP
    MCP 連接器遠端 MCP 伺服器
    第三方平台上的 Claude
    Amazon BedrockMicrosoft FoundryVertex AI
    提示詞工程
    概覽提示詞產生器使用提示詞範本提示詞改進器清晰直接使用範例(多範例提示)讓 Claude 思考(CoT)使用 XML 標籤賦予 Claude 角色(系統提示詞)串聯複雜提示詞長上下文技巧延伸思考技巧
    測試與評估
    定義成功標準開發測試案例使用評估工具降低延遲
    強化防護機制
    減少幻覺提高輸出一致性防範越獄攻擊串流拒絕減少提示詞洩漏讓 Claude 保持角色
    管理與監控
    Admin API 概覽資料駐留工作區用量與成本 APIClaude Code Analytics API零資料保留
    Console
    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
    • Catalog
    • 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
    • Catalog
    • 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 4.6 的新功能

    Claude Opus 4.6 新功能與能力概覽。

    Claude 4.6 代表了 Claude 模型的下一代,帶來了重大的新功能和 API 改進。本頁面總結了發布時所有可用的新功能。

    新模型

    模型API 模型 ID描述
    Claude Opus 4.6claude-opus-4-6我們最智慧的模型,用於建構代理和編碼

    Claude Opus 4.6 支援 200K 上下文視窗(1M token 上下文視窗以 beta 形式提供)、128K 最大輸出 token、延伸思考,以及所有現有的 Claude API 功能。

    如需完整的定價和規格,請參閱模型概覽。

    新功能

    自適應思考模式

    自適應思考(thinking: {type: "adaptive"})是 Opus 4.6 推薦的思考模式。Claude 會動態決定何時思考以及思考多少。在預設的努力程度(high)下,Claude 幾乎總是會進行思考。在較低的努力程度下,它可能會跳過較簡單問題的思考。

    thinking: {type: "enabled"} 和 budget_tokens 在 Opus 4.6 上已棄用。它們仍然可以運作,但將在未來的模型版本中移除。請改用自適應思考和努力程度參數來控制思考深度。自適應思考也會自動啟用交錯思考。

    response = client.messages.create(
        model="claude-opus-4-6",
        max_tokens=16000,
        thinking={"type": "adaptive"},
        messages=[{"role": "user", "content": "Solve this complex problem..."}]
    )

    努力程度參數正式發布

    努力程度參數現已正式發布(不需要 beta 標頭)。新的 max 努力程度在 Opus 4.6 上提供最高的能力。將努力程度與自適應思考結合使用,以獲得最佳的成本與品質權衡。

    壓縮 API(beta)

    壓縮提供自動的伺服器端上下文摘要,實現實質上無限的對話。當上下文接近視窗限制時,API 會自動摘要對話的早期部分。

    細粒度工具串流(正式發布)

    細粒度工具串流現已在所有模型和平台上正式發布。不需要 beta 標頭。

    128K 輸出 token

    Opus 4.6 支援最多 128K 輸出 token,是先前 64K 限制的兩倍。這使得更長的思考預算和更全面的回應成為可能。SDK 要求對具有較大 max_tokens 值的請求使用串流,以避免 HTTP 逾時。如果您不需要增量處理事件,請使用 .stream() 搭配 .get_final_message() 來取得完整回應——詳情請參閱串流訊息。

    資料駐留控制

    資料駐留控制允許您使用 inference_geo 參數指定模型推論執行的位置。您可以為每個請求選擇 "global"(預設)或 "us" 路由。僅限美國的推論在 Claude Opus 4.6 和更新的模型上定價為 1.1 倍。

    棄用項目

    type: "enabled" 和 budget_tokens

    thinking: {type: "enabled", budget_tokens: N} 在 Opus 4.6 上已棄用。它仍然可以運作,但將在未來的模型版本中移除。請遷移至 thinking: {type: "adaptive"} 並搭配努力程度參數。

    interleaved-thinking-2025-05-14 beta 標頭

    interleaved-thinking-2025-05-14 beta 標頭在 Opus 4.6 上已棄用。如果包含該標頭,它會被安全地忽略,但不再需要。自適應思考會自動啟用交錯思考。在使用 Opus 4.6 時,請從您的請求中移除 betas=["interleaved-thinking-2025-05-14"]。

    output_format

    用於結構化輸出的 output_format 參數已移至 output_config.format。舊參數仍然可以運作,但已棄用,將在未來的模型版本中移除。

    # 之前
    response = client.messages.create(
        output_format={"type": "json_schema", "schema": {...}},
        ...
    )
    
    # 之後
    response = client.messages.create(
        output_config={"format": {"type": "json_schema", "schema": {...}}},
        ...
    )

    重大變更

    移除預填

    預填助手訊息(最後一輪助手預填)在 Opus 4.6 上不受支援。包含預填助手訊息的請求會返回 400 錯誤。

    替代方案:

    • 結構化輸出用於控制回應格式
    • 系統提示指令用於引導回應風格
    • output_config.format 用於 JSON 輸出

    工具參數引號處理

    Opus 4.6 可能在工具呼叫參數中產生略有不同的 JSON 字串跳脫(例如,對 Unicode 跳脫或正斜線跳脫的不同處理)。標準 JSON 解析器會自動處理這些差異。如果您將工具呼叫的 input 作為原始字串解析,而不是使用 json.loads() 或 JSON.parse(),請驗證您的解析邏輯是否仍然有效。

    遷移指南

    如需逐步遷移說明,請參閱遷移至 Claude 4.6。

    後續步驟

    自適應思考

    了解如何使用自適應思考模式。

    模型概覽

    比較所有 Claude 模型。

    壓縮

    探索伺服器端上下文壓縮。

    遷移指南

    逐步遷移說明。

    Was this page helpful?

    • 壓縮 API(beta)
    • 128K 輸出 token
    • type: "enabled" 和 budget_tokens
    • interleaved-thinking-2025-05-14 beta 標頭
    • output_format