# Server-Sent Events (SSE)

> Real-time job progress via SSE streaming

**Endpoint:** `GET /jobs/{id}/events`

Subscribe to job progress via Server-Sent Events.

## Basic Usage

```bash
curl -N "https://async.render.weyl.ai/jobs/j_abc123/events" \
  -H "Authorization: Bearer $WEYL_API_KEY"
```

## Event Stream

```
event: position
data: {"position": 3, "eta_seconds": 45}

event: started
data: {}

event: progress
data: {"progress": 0.65, "step": 20}

event: complete
data: {"output": "https://cdn.render.weyl.ai/i/xyz.webp"}
```

## Python Client

```python
import requests
import json

def stream_job_events(job_id: str):
    url = f"https://async.render.weyl.ai/jobs/{job_id}/events"
    headers = {"Authorization": f"Bearer {API_KEY}"}
    
    with requests.get(url, headers=headers, stream=True) as resp:
        for line in resp.iter_lines(decode_unicode=True):
            if line.startswith('data:'):
                data = json.loads(line[6:])
                print(data)
```