curl --request POST \
--url https://api.example.com/api/ai/v1/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"action": "send",
"message": {
"input": {
"input": "Hello, introduce yourself briefly."
}
}
},
"options": {
"xpertId": "YOUR_PUBLISHED_XPERT_ID"
}
}
'"data: {\"type\":\"event\",\"event\":\"on_conversation_start\",\"data\":{\"id\":\"conversation-id\"}}\n\ndata: {\"type\":\"message\",\"data\":\"Hello\"}\n\ndata: {\"type\":\"event\",\"event\":\"on_conversation_end\",\"data\":{\"id\":\"conversation-id\",\"status\":\"idle\",\"error\":null}}\n\n""data: {\"type\":\"event\",\"event\":\"on_conversation_start\",\"data\":{\"id\":\"conversation-id\"}}\n\ndata: {\"type\":\"message\",\"data\":\"Hello\"}\n\ndata: {\"type\":\"event\",\"event\":\"on_conversation_end\",\"data\":{\"id\":\"conversation-id\",\"status\":\"idle\",\"error\":null}}\n\n"AI/v1
Chat with an agent
POST a message to a published agent and receive SSE. Authenticate with Authorization: Bearer <API_KEY> or x-api-key. Save on_conversation_start.data.id for continuation. Each SSE data field contains JSON with type, optional event, and data. Text deltas have type=message; lifecycle events have type=event. Inspect on_conversation_end.data.status/error and SSE error events: HTTP success alone does not mean the agent succeeded. Internal runtime options are not public caller fields.
POST
/
api
/
ai
/
v1
/
chat
curl --request POST \
--url https://api.example.com/api/ai/v1/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"request": {
"action": "send",
"message": {
"input": {
"input": "Hello, introduce yourself briefly."
}
}
},
"options": {
"xpertId": "YOUR_PUBLISHED_XPERT_ID"
}
}
'"data: {\"type\":\"event\",\"event\":\"on_conversation_start\",\"data\":{\"id\":\"conversation-id\"}}\n\ndata: {\"type\":\"message\",\"data\":\"Hello\"}\n\ndata: {\"type\":\"event\",\"event\":\"on_conversation_end\",\"data\":{\"id\":\"conversation-id\",\"status\":\"idle\",\"error\":null}}\n\n""data: {\"type\":\"event\",\"event\":\"on_conversation_start\",\"data\":{\"id\":\"conversation-id\"}}\n\ndata: {\"type\":\"message\",\"data\":\"Hello\"}\n\ndata: {\"type\":\"event\",\"event\":\"on_conversation_end\",\"data\":{\"id\":\"conversation-id\",\"status\":\"idle\",\"error\":null}}\n\n"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
SSE stream. A connection close without on_conversation_end is incomplete. Ignore heartbeat comments and data frames whose trimmed value is : keep-alive before parsing JSON. Ignore unrelated lifecycle events.
The response is of type string.