Get a chat reply for a stream

Runs the built-in demo conversational agent over the supplied message history and returns its reply. Backs the interactive demo on the Elai site; it is not a general-purpose chat API and the prompt/persona is fixed server-side.

The reply is returned to the caller — it is not automatically spoken. Pass the text to POST /streams/render/{streamId} if you want the avatar to say it.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
curl -X POST 'https://apis.elai.io/api/v1/streams/chat/66a1f0c2b7cd13032a9c6200' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "messages": [
    {
      "role": "user",
      "content": "What can Elai do?"
    }
  ],
  "firstMessage": true
}'
Path Params
string
required

Stream id returned by POST /streams.

Body Params
messages
array of objects

Conversation so far, oldest first.

messages
boolean

Marks the opening turn, which uses a different prompt.

Responses

streamId is not a valid ObjectId, there is no such stream, it belongs to another workspace, or it is already closed. All four cases return 400.

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json