Skip to main content

聊天 (Chat) - 原生 Claude 格式

Anthropic Claude Messages API 格式的请求。需要在请求头中包含 anthropic-version
  • 接口地址: POST /v1/messages
  • 基础 URL (示例): https://www.ominiapi.com

认证与请求头 (Headers)

  • Authorization (必选): 使用 Bearer Token 认证。格式: Bearer sk-xxxxxx
  • anthropic-version (必选): Anthropic API 版本,例如 2023-06-01
  • x-api-key (可选): Anthropic API Key (也可使用 Bearer Token 替代)
  • Content-Type: application/json

请求参数 (Request Body)

示例代码 (cURL)

响应体结构 (Response - 200 OK)

成功请求返回 JSON 格式结果。