Send Message for Stream

POST /messages/stream

Send a message and get back a SSE (Server-Sent Events) stream for the AI response.

An example of how to handle SSE stream in Javascript.

let message = ''
const evtSource = new EventSource('')
evtSource.onmessage = (event) => {
  const data =
  if (data === '[END]') {
    // Request is closed by our servers once `[END]` is sent,
    // you must close the request otherwise the browser will keep retrying the URL.
  } else if (data !== '[START]') {
    message += JSON.parse(data).chunk


  • content string

    Content can be upto 2000 characters.

  • redirect boolean

    By default, your request will be redirected to another url that will be a SSE stream. You can disable that and get the url in a json object instead.

    Default value is true.


  • 200 application/json

    When redirect is set to false

    Hide response attribute Show response attribute object
  • 302

    When redirect is set to true.

    Hide headers attribute Show headers attribute
  • 402 application/json

    When 30 days message limit of your subscription plan is reached.

    Hide response attribute Show response attribute object
POST /messages/stream
curl \
 -X POST \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"content":"string","conversation_id":"string","redirect":true}'
Request example
  "content": "string",
  "conversation_id": "string",
  "redirect": true
Response examples (200)
  "data": {
    "stream_url": ""
Response examples (402)
  "message": "You have reached the message limit for last 30 days, please wait till tomorrow or upgrade your plan."