Claude Platform Docs
  • 消息
  • 托管智能体
  • 管理

Search...
⌘K

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
API 参考/支持与配置

版本

在发起 API 请求时,您必须发送 anthropic-version 请求头。例如,anthropic-version: 2023-06-01。如果您使用的是客户端 SDK,这将自动为您处理。

对于 Messages API 的任何给定版本,Anthropic 会保留:

  • 现有的输入参数
  • 现有的输出参数

但是,Anthropic 可能会执行以下操作:

  • 添加额外的可选输入
  • 向输出添加额外的值
  • 更改特定错误类型的触发条件
  • 向类枚举的输出值添加新的变体(例如,流式传输事件类型)

一般来说,如果您按照本参考文档中的说明使用 API,Anthropic 不会破坏您的使用。

版本历史

Anthropic 建议尽可能使用最新的 API 版本。之前的版本被视为已弃用,新用户可能无法使用。

  • 2023-06-01
    • 流式传输服务器发送事件(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?

  • 版本历史