Getting Started
Prerequisites
- Channel API key (
Authorization: Bearer <API_KEY>). - SSE-capable client (for example,
EventSourcein browsers).
Steps
- Get your API key (see Authentication).
- Pick
typesto filter (optional). - Connect to the SSE endpoint.
- Handle events by
eventname (matchestype).
Endpoint
GET /v1/eventsub/stream
Authorization: Bearer <API_KEY>Query parameters
| Name | Description | Example |
|---|---|---|
types | Comma-separated event keys to include | types=chat.message,ai.tts.generated |
channelId | Target 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.