Use Server-Sent Events (SSE) to receive real-time progress updates for moderation jobs. This is more efficient than polling the job status endpoint.Documentation Index
Fetch the complete documentation index at: https://docs.omnifence.ai/llms.txt
Use this file to discover all available pages before exploring further.
Connecting
Open an SSE connection to the progress endpoint:Content-Type: text/event-stream.
Event types
connected
Sent immediately when the connection opens. Contains the current job state.
connected event includes progress: 100 and the stream closes immediately.
progress
Sent as the job progresses through the moderation pipeline.
Event data fields
| Field | Type | Description |
|---|---|---|
job_id | string | The job identifier. |
status | string | queued, processing, completed, or failed. |
progress | number | Completion percentage (0–100). |
detail | string | Human-readable step description. Optional. |
frames_completed | integer | Frames processed so far. Post-moderation only. |
frame_count | integer | Total frames to process. Post-moderation only. |
Stream lifecycle
- The stream closes automatically when
progressreaches 100 orstatusiscompletedorfailed. - A keepalive comment (
: keepalive) is sent every 15 seconds to prevent connection timeouts. - If the client disconnects, the server cleans up the subscription.
