跳转至

Claude Messages

本节列出该能力下当前已实现的接口。

Claude 聊天

POST /v1/messages

Anthropic Claude Messages API 格式的请求。 需要在请求头中包含 anthropic-version

鉴权

  • Bearer Token (Authorization: Bearer <token>)

参数

名称 位置 类型 必填 说明
anthropic-version header string yes Anthropic API 版本
x-api-key header string no Anthropic API Key (可选,也可使用 Bearer Token)

请求体

  • Content-Type: application/json
  • Schema: ClaudeRequest
字段 类型 必填 说明
model string yes -
messages array[ClaudeMessage] yes -
system - no -
max_tokens integer yes -
temperature number no -
top_p number no -
top_k integer no -
stream boolean no -
stop_sequences array[string] no -
tools array[object] no -
tool_choice - no -
thinking object no -
metadata object no -

返回

状态码 说明 Schema
200 成功创建响应 ClaudeResponse