跳转到主要内容
POST
创建 Claude 消息
使用支持 Messages 协议的模型。Authorization: Bearer 和 x-api-key 两种认证方式均可。

其他支持的模型

  • anthropic/claude-fable-5.1
  • anthropic/claude-opus-4.8
  • anthropic/claude-sonnet-4.6
  • anthropic/claude-opus-4.6
  • anthropic/claude-opus-5.5
  • anthropic/claude-sonnet-5.5
  • anthropic/claude-haiku-5.5
  • anthropic/claude-opus-4.7
  • anthropic/claude-opus-4.5
  • anthropic/claude-sonnet-4.5
  • anthropic/claude-haiku-4.5
  • deepseek/deepseek-v4.1-flash
在根级发送协议字段,不需要生成接口的 input 包装。messages 必须是非空数组,max_tokens 必须是正整数。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
string
必填
示例:

"anthropic/claude-fable-5.1"

messages
object[]
必填
Minimum array length: 1
max_tokens
integer
必填
必填范围: x >= 1
stream
boolean
默认值:false

响应

Message 或 SSE 流

The response is of type object.