REST API
Talk to Agent
Request the following API
https://rest.agentweave.ai/api/v1/chat/agent/${agentId}
You need to replace the ${agentId} in the above address with the id of the agent that created the API key.
Include in the request header
Authorization: {Access Token OR Api Key}
Request Body
{
"content": "string", // Conversation content
"id": "string", // Conversation id
"type": "string", // Ask for content type, text
"thread_id": "string" // Conversation id. You can leave it blank for the first conversation. For subsequent conversations, you need to fill in the thread_id returned by the API.
}
Response body
{
"result": {
"code": 201000, // result code
"message": "Success" // result message
},
"data": {
"message": {
"id": "be98451f-6080-43f4-9b28-b097743efcb4", // message id
"content": "Hello!", // Agent reply content
"type": "text", // content type
"user_id": "microsoft_ai_rag_9e8ac8be-6313-477f-8ead-845a704c6ef4", // agent id
"timestamp": 1746596042399, // reply time stamp
"thread_id": "01JTMKS277ZGX7TS3J5WKSPDKS", // conversation id
"agent_id": "microsoft_ai_rag_9e8ac8be-6313-477f-8ead-845a704c6ef4", // agent id
"from": "assistant",
"usage": "{\"prompt_tokens\":3097,\"completion_tokens\":12,\"total_tokens\":3109}", // token statistics
"references": [],
"client_message_id": "cf89ed62ee014e8dd9a4746" // client content id
},
"agent_id": "microsoft_ai_rag_9e8ac8be-6313-477f-8ead-845a704c6ef4"
}
}
