Skip to main content
POST
/
v1
/
messages
Claude 风格消息
curl --request POST \
  --url https://aiapi.xiaoliu.fun/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "max_tokens": 123,
  "messages": [
    {
      "content": "<string>"
    }
  ],
  "system": "<string>",
  "temperature": 123,
  "stream": true
}
'
{
  "id": "<string>",
  "type": "<string>",
  "role": "<string>",
  "model": "<string>",
  "content": [
    {
      "type": "<string>",
      "text": "<string>"
    }
  ],
  "stop_reason": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
model
string
required

模型名称,如 claude-sonnet-4-5

max_tokens
integer
required

最大输出 token 数

messages
object[]
required
system
string

系统提示词

temperature
number
stream
boolean

Response

200 - application/json

成功响应

id
string
type
string
role
string
model
string
content
object[]
stop_reason
string
usage
object