Skip to main content

Goal

Receive progress and result events over a single streaming HTTP response.

When to Use

Use SSE when your UI or client needs near real-time updates without webhook infrastructure.

Request Requirement

Send:
Accept: text/event-stream

Live Monitor Example

curl -N -X POST https://trio.machinefi.com/api/live-monitor \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "stream_url":"https://www.youtube.com/watch?v=jfKfPfyJRdk",
    "condition":"Is there a cat visible?"
  }'
Common event names:
  • started
  • progress
  • triggered
  • stopped
  • error

Live Digest Example

curl -N -X POST https://trio.machinefi.com/api/live-digest \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "stream_url":"https://www.youtube.com/watch?v=jfKfPfyJRdk",
    "window_minutes":10,
    "capture_interval_seconds":60
  }'
Common event names:
  • job_started
  • progress
  • summary
  • job_stopped
  • error

Client Handling Rules

  • Parse by event name, not by message text.
  • Handle reconnects in your application if UX requires continuity.
  • Treat triggered, stopped, job_stopped, and error as terminal stream events.
  • Store job_id from start event when provided.

Fallback

If streaming is interrupted or unsupported, use polling via GET /jobs/{job_id}.

Next Steps