Send Chat Message (Sync)
Synchronous version of the chat endpoint for testing. Runs the AI processor inline and returns the full response directly in the HTTP response instead of via WebSocket.
Authentication: Required — Bearer token.
Prerequisites: LoyalStream connector must be enabled on the app.
Request body:
client_id(optional) — Client ID for conversation tracking (auto-generated if not provided)message(required) — The user’s message text
Response:
client_id— Conversation tracking IDmodel— The AI model usedmessages— Full message history including the AI responseresponse— Raw AI response object with choices and usagethinking_steps— Array of processing steps (intent analysis, context gathering, response generation)total_time_ms— Total processing time in millisecondstimestamp— Response timestamp
Note: This endpoint may take 5-30 seconds to respond depending on the AI model and message complexity. Use this for testing only — production clients should use the async POST /ai/chat endpoint.
Errors:
403— LoyalStream connector not available
Authentication
AuthorizationBearer
Bearer authentication of the form Bearer <token>, where token is your auth token.
Request
This endpoint expects an object.
client_id
message
Response
OK