Getting Started

Prerequisites

  • Channel API key (Authorization: Bearer <API_KEY>).
  • SSE-capable client (for example, EventSource in browsers).

Steps

  1. Get your API key (see Authentication).
  2. Pick types to filter (optional).
  3. Connect to the SSE endpoint.
  4. Handle events by event name (matches type).

Endpoint

GET /v1/eventsub/stream
Authorization: Bearer <API_KEY>

Query parameters

NameDescriptionExample
typesComma-separated event keys to includetypes=chat.message,ai.tts.generated
channelIdTarget a specific channel (if the key has multiple)channelId=ch_123

Quick start (curl)

curl -N "https://api.getailicia.com/v1/eventsub/stream?types=chat.message,ai.tts.generated" \
  -H "Authorization: Bearer ${API_KEY}"

Client example (browser)

const es = new EventSource(
  'https://api.getailicia.com/v1/eventsub/stream?types=chat.message,ai.tts.generated',
  { withCredentials: false }
);

es.addEventListener('chat.message', (evt) => {
  const envelope = JSON.parse(evt.data);
  console.log('New chat message', envelope.payload);
});

Notes

SSE event names match the type field in the envelope (e.g. chat.message). Keep-alive comments may be sent periodically.