Guide

Interactive Chat

How to create a chat session, stream the agent response, post more user messages, add feedback to an agent message, and load the saved transcript later.

Chat Flow

  1. Create a session with the first user message.
  2. Immediately subscribe to the returned stream_url.
  3. Post more user turns to the same session when needed.
  4. Attach feedback to an agent message when you want to rate the reply.
  5. Load the session and message history later from the saved URLs.
POST /api/v1/sessions

Start a Session

Send the first user message to create a new session. If you leave title blank, Genie will generate the session title later.

Auth

Required. Accepts Authorization: Bearer <blast_access_token> or a session cookie.

Request Example

POST /api/v1/sessions
Content-Type: application/json
Authorization: Bearer <blast_access_token>

{
  "text": "Generate 5 random cat names",
  "title": ""
}

Response Example

{
  "uuid": "37290857-0aff-416e-9693-77acd04e28c5",
  "stream_url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/stream",
  "messages_url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/messages"
}

What To Do Next

Immediately subscribe to stream_url to receive the agent response for the new session.

GET /api/v1/sessions/{session_uuid}/stream

Stream the Response

Open the session stream returned by stream_url and keep reading until the API sends a finish event or returns 204 No Content on reconnect.

Request Example

GET /api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/stream
Accept: text/event-stream
Authorization: Bearer <blast_access_token>
Cache-Control: no-cache

Response Example

: ok

retry: 0

id: 13
data: {"type":"text-start","id":"pending-message-e04b3a29-5a07-49e3-b180-279c99383220"}

id: 14
data: {"type":"text-delta","id":"pending-message-e04b3a29-5a07-49e3-b180-279c99383220","delta":"Miso, "}

id: 15
data: {"type":"text-delta","id":"pending-message-e04b3a29-5a07-49e3-b180-279c99383220","delta":"Juniper, Nimbus, Pickles, and Poppy."}

id: 16
data: {"type":"finish"}
POST /api/v1/sessions/{session_uuid}/messages

Send Another Message

Reuse the same session for every follow-up user turn. The API returns a new stream_url for the next agent reply in that session.

Request Example

POST /api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/messages
Content-Type: application/json
Authorization: Bearer <blast_access_token>

{
  "text": "Give me 5 more cat names with a playful tone."
}

Response Example

{
  "uuid": "e04b3a29-5a07-49e3-b180-279c99383220",
  "stream_url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/stream"
}

What To Do Next

Immediately subscribe to stream_url to receive the next agent response in the same session.

POST /api/v1/sessions/{session_uuid}/messages/{message_uuid}/feedback

Add Feedback on a Message

Once you have an agent message_uuid, create or replace feedback for that message. This endpoint is for agent messages only.

Request Example

POST /api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/messages/e04b3a29-5a07-49e3-b180-279c99383220/feedback
Content-Type: application/json
Authorization: Bearer <blast_access_token>

{
  "rating": "positive",
  "body": "Accurate"
}

Response Example

{
  "url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/messages/e04b3a29-5a07-49e3-b180-279c99383220/feedback",
  "session_uuid": "37290857-0aff-416e-9693-77acd04e28c5",
  "message_uuid": "e04b3a29-5a07-49e3-b180-279c99383220",
  "rating": "positive",
  "body": "Accurate",
  "created_at": "2026-04-15T16:17:22.398531Z"
}
GET /api/v1/sessions/{session_uuid}

Load Session History

Retrieve the session resource when you need metadata and use messages_url to fetch the saved transcript.

Session Detail Example

{
  "uuid": "37290857-0aff-416e-9693-77acd04e28c5",
  "url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5",
  "title": "5 random cat names",
  "user": {
    "uuid": "61cb3911-3662-4d85-bd93-9d8e2c3892cb",
    "name": "Human User"
  },
  "messages_url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/messages",
  "metadata": {
    "source": "api-docs"
  },
  "created_at": "2026-04-15T16:17:22.398531Z",
  "updated_at": "2026-04-15T16:18:04.117204Z"
}

Message List Example

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "uuid": "6a2d0f84-857b-4b10-a020-1d7286213b32",
      "url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/messages/6a2d0f84-857b-4b10-a020-1d7286213b32",
      "session_uuid": "37290857-0aff-416e-9693-77acd04e28c5",
      "feedback_url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/messages/6a2d0f84-857b-4b10-a020-1d7286213b32/feedback",
      "feedback": null,
      "sender_role": "user",
      "text": "Generate 5 random cat names",
      "temperature": 0.0,
      "model": {
        "provider": "bedrock",
        "model_id": "claude-sonnet-4"
      },
      "metadata": {
        "source": "api-docs"
      },
      "created_at": "2026-04-15T16:17:22.398531Z"
    },
    {
      "uuid": "e04b3a29-5a07-49e3-b180-279c99383220",
      "url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/messages/e04b3a29-5a07-49e3-b180-279c99383220",
      "session_uuid": "37290857-0aff-416e-9693-77acd04e28c5",
      "feedback_url": "https://genie.livelike.ai/api/v1/sessions/37290857-0aff-416e-9693-77acd04e28c5/messages/e04b3a29-5a07-49e3-b180-279c99383220/feedback",
      "feedback": null,
      "sender_role": "agent",
      "text": "Miso, Juniper, Nimbus, Pickles, and Poppy.",
      "temperature": 0.0,
      "model": {
        "provider": "bedrock",
        "model_id": "claude-sonnet-4"
      },
      "metadata": {
        "source": "api-docs"
      },
      "created_at": "2026-04-15T16:18:04.117204Z"
    }
  ]
}
POST /api/v1/sessions/{session_uuid}/stream/stop

Stop a Run

If the current agent run should stop early, request a stream stop for the active session.

Response Example

{
  "uuid": "37290857-0aff-416e-9693-77acd04e28c5",
  "stopped": true
}