API DocsAPI Docs
post/api/ai/chat
post/api/ai/chat
与AI进行对话
Basic Information
Request Method:
post
Request URL:
https://www.lycoo.com/api/ai/chat
Tags:
AI
Description
发送消息到AI服务并获取回复,支持流式响应
Header Parameters
Header Parameters Explanation
Header parameters are used to pass additional information, such as authentication credentials, content type, etc.
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
Authorization | string | Required | Bearer sha_1234567890abcdef... | The authentication header is used to verify the identity of API requests, containing an access token Format: Bearer {token} |
Request Body Parameters
Request Body Parameters Explanation
Request body parameters are used to pass complex structured data, typically using the following format: application/json
Parameter Details
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
messages | array | Required | 25 | - |
stream | boolean | Optional | true | - |
model | string | Optional | example | 要使用的AI模型 |
temperature | number | Optional | 42 | - |
max_tokens | number | Optional | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... | - |
JSON Example
{
"stream": true,
"model": "string",
"temperature": 0,
"max_tokens": 0
}
Response Example
200成功获取回复
{
"success": true,
"message": "string"
}
400
401
500