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.
POST /api/v1/generation/sse/{provider}/{model}
Example:
POST /api/v1/generation/sse/google/veo-3.1

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

NameTypeRequiredDescription
providerstringYesModel provider slug, for example google, openai, or kling-ai.
modelstringYesModel slug under the provider, for example veo-3.1 or sora-2-pro.

Headers

NameRequiredDescription
Authorization: Bearer <YOUR_API_KEY>YesAPI authentication header.
Content-Type: application/jsonYesIndicates JSON request body format.
Accept: text/event-streamRecommendedExplicitly requests SSE stream responses.

Request body example

{
  "prompt": "sunrise over mountains in watercolor style"
}

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.
data: {"id":"<GENERATION_ID>","status":"IN_QUEUE","data":null,"usage":{"total":0,"subscription":0,"permanent":0}}

data: {"id":"<GENERATION_ID>","status":"IN_PROGRESS","data":null,"usage":{"total":0,"subscription":0,"permanent":0}}

data: {"id":"<GENERATION_ID>","status":"COMPLETED","data":{"<OUTPUT_FIELD>":"<OUTPUT_VALUE>"},"usage":{"total":<NUMBER>,"subscription":<NUMBER>,"permanent":<NUMBER>}}

Error handling notes

When the request fails before the stream is established, the API returns standard JSON error responses.
StatusMeaning
400Invalid request body or missing required fields
401Missing or invalid API key
404Provider or model route not found
422Validation error
429Rate limited
500 / 503Transient server-side error
{
  "message": "Unauthorized"
}
{
  "message": "'prompt' parameter is required"
}

Operational behavior

Design client logic for streaming workloads and transient network failure.
  • Rate limits: PLACEHOLDER_RATE_LIMITS
  • Timeouts: PLACEHOLDER_TIMEOUTS
  • Retry behavior: PLACEHOLDER_RETRY_POLICY

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.