Start Agent conversation
POST/v1/aibot/bots/:botId/send-message
Start Agent conversation
Request
Path Parameters
Agent ID
- application/json
Body
required
- Array [
- ]
User message
history object[]
Conversation history
Role in the conversation history
Content of the conversation history
Whether to enable web search. Only enabled when both the Agent configuration and this field are true.
Fields required for file-related conversations. You can upload files to Cloud Storage and use the cloud storage link (cloud://xxx.xxx) or a publicly accessible link (https://xxxx.xxxx).
Conversation ID. Takes effect after multi-conversation is enabled and marks the conversation to which this interaction belongs. You can obtain the ID from conversation-related APIs.
Responses
- 200
- default
Returned when the Agent conversation succeeds (SSE format)
Response Headers
X-Request-Id string
Request ID
- application/json
- Schema
- Example (from schema)
Schema
- Array [
- ]
Conversation timestamp
Conversation record ID
Large model type
Large model version
Response type: text for the main answer, thinking for reasoning process, search for search results, knowledge for knowledge base
Conversation role, fixed as assistant in responses
Conversation content
Conversation termination flag; continue means not finished, stop means finished
Deep reasoning content (only non-empty for deepseek-r1)
usage object
Token usage
Number of prompt tokens; remains constant across multiple responses
Total completion tokens. In streaming responses, this accumulates across chunks.
Sum of promptTokens and completionTokens
Knowledge bases used in the conversation
search_info object
Search results (requires web search to be enabled)
search_results undefined[]
Search citation information
Citation index
Citation title
Citation URL
{
"created": "1726030224",
"record_id": "record-427d3652",
"model": "hunyuan",
"version": "202407241700",
"type": "assistant",
"role": "assistant",
"content": "Hello",
"finish_reason": "continue",
"reasoning_content": "",
"usage": {
"promptTokens": 10,
"completionTokens": 20,
"totalTokens": 30
},
"knowledge_base": [
""
],
"search_info": {
"search_results": [
{
"index": "[1]",
"title": "Title",
"url": "Link"
}
]
}
}
Returned when the Agent conversation fails
- application/json
- Schema
- Example (from schema)
Schema
Error code
Error message
Request ID
{
"code": "INVALID_CREDENTIALS",
"message": "Credentials are invalid",
"requestId": "6360ba4b-f672-434b-9dee-35686a5589a4"
}