Skip to main content
This page explains how to use Server-Sent Events (SSE) endpoints in skills.video to receive generation progress updates over one long-lived HTTP response.

Purpose

Use SSE when your integration needs near real-time task state updates without repeated polling requests.

Endpoint

SSE endpoints follow the same provider and model naming as standard generation endpoints, with an /sse/ segment in the path.
Example:

Request parameters

The SSE request body is the same as the matching non-SSE generation endpoint, so you can reuse the same model-specific payload.

Path parameters

Headers

Request body example

Response example

A successful SSE request returns 200 OK with Content-Type: text/event-stream. The stream sends incremental status updates and ends when the task reaches a terminal state. Each data: frame is a generation object with id, status, input, data, and usage. Failed terminal frames also include sanitized code and message fields.
The stream ends when the task reaches a terminal status: COMPLETED, FAILED, or CANCELED. For FAILED, use code for client branching and message for a safe user-facing explanation.

Error handling notes

When the request fails before the stream is established, the API returns standard JSON error responses with code and message. The legacy error field is also present for backward compatibility. Once the stream is established, handle a terminal FAILED or CANCELED frame as the generation result.

Operational behavior

Design client logic for streaming workloads and transient network failure.
  • The stream closes after COMPLETED, FAILED, or CANCELED.
  • If the connection drops after you receive a generation id, reconcile with GET /api/v1/generation/{id}.
  • Retry transient HTTP 429 and 5xx responses with exponential backoff before the stream is established.

Retry guidance

Retrying a POST can create duplicate generation jobs if the first request was accepted but the client disconnected. Use idempotency controls if your backend provides them, or reconcile task IDs before retrying create calls.