> ## Documentation Index
> Fetch the complete documentation index at: https://docs.machinefi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use SSE Streaming

> Consume live monitor and digest events over Server-Sent Events

## 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:

```http theme={null}
Accept: text/event-stream
```

## Live Monitor Example

```bash theme={null}
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` (non-terminal trigger event when `max_triggers` > 1 or `null`)
* `stopped`
* `error`

## Live Digest Example

```bash theme={null}
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:

* `started`
* `progress`
* `summary`
* `stopped`
* `error`

## Client Handling Rules

* Parse by event name, not by message text.
* Handle reconnects in your application if UX requires continuity.
* Treat `triggered` as non-terminal.
* Treat `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

* Polling fallback: [Use Polling](/guides/poll-jobs)
* Callback delivery: [Use Webhooks](/guides/webhooks)
* Endpoint schema: [Live Monitor](/api-reference/live-monitor)
