Send a message; the answer streams as server-sent events
Generated from the OpenAPI contract. Sessions send the CSRF header on writes; API keys use a Bearer token. Authentication
POST
/api/v1/tenants/{tid}/assistant/conversations/{cid}/messagesSend a message; the answer streams as server-sent events. Tools run as the caller through these same routes; changes wait for the user (event action). Errors before the stream starts are ordinary problems (ASSISTANT_RATE_LIMITED, ASSISTANT_BUSY)
Authentication: API key (Authorization: Bearer …) or session cookie __Host-panel_session.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tid | path | string | required | |
cid | path | string | required | |
X-CSRF-Token | header | string | optional | Required on unsafe requests authenticated by session cookie; API keys do not use it. |
Request body
required
Content type: application/json
object
- no other properties
textstring required- max length 4000
langstring optionalAllowed values:"vi""en"contextobject optional- no other properties
pathstring optionalsite_idstring optionalserver_idstring optional
Example
{
"text": "string",
"lang": "vi",
"context": {
"path": "string",
"site_id": "string",
"server_id": "string"
}
}Responses
200 Events
Content type: text/event-stream
One server-sent event (data: <json>) of a turn
typestring requiredAllowed values:"text""tool""action""usage""waiting""done""error"textstring optionalidstring requirednamestring requiredstatestring requiredAllowed values:"running""done""error"codestring optional
idstring requiredtoolstring requiredstatestring requiredAllowed values:"pending""done""failed""denied""expired"codestring optionalpreviewobject requiredtoolstring requiredtargetstring requiredfieldstring requiredfromstring requiredtostring required
usageobject optionalinput_tokensinteger optionaloutput_tokensinteger optionalcache_read_tokensinteger optionalcache_write_tokensinteger optional
codestring optionalmessagestring optional
default Error
Content type: application/json
codestring requiredmessagestring requireddetails_redactedboolean requiredcorrelation_idstring requiredretryableboolean required