• Messages
  • Managed Agents
  • 管理

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

  • Claude on AWS
  • 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
API 參考/支援與設定

版本

發送 API 請求時,您必須傳送 anthropic-version 請求標頭。例如,anthropic-version: 2023-06-01。如果您使用的是用戶端 SDK,系統會自動為您處理此設定。

對於 Messages API 的任何指定版本,Anthropic 會保留:

  • 現有的輸入參數
  • 現有的輸出參數

然而,Anthropic 可能會進行以下變更:

  • 新增額外的選用輸入
  • 在輸出中新增額外的值
  • 變更特定錯誤類型的觸發條件
  • 為類列舉的輸出值新增變體(例如,串流事件類型)

一般而言,如果您依照本參考文件所述的方式使用 API,Anthropic 不會破壞您的使用方式。

版本歷史

Anthropic 建議盡可能使用最新的 API 版本。先前的版本被視為已棄用,新使用者可能無法使用。

  • 2023-06-01
    • 串流伺服器傳送事件(server-sent events,SSE)採用新格式:
      • 補全內容為增量式。例如," Hello"、" my"、" name"、" is"、" Claude." ,而非 " Hello"、" Hello my"、" Hello my name"、" Hello my name is"、" Hello my name is Claude."。
      • 所有事件皆為具名事件,而非僅含資料的事件。
      • 移除不必要的 data: [DONE] 事件。
    • 移除回應中舊有的 exception 和 truncated 值。
  • 2023-01-01:初始版本。

Was this page helpful?

  • 版本歷史