Server-Sent Events (SSE)
Endpoint: GET /jobs/{id}/events
Subscribe to job progress via Server-Sent Events.
Basic Usage
curl -N "https://async.render.weyl.ai/jobs/j_abc123/events" \ -H "Authorization: Bearer $WEYL_API_KEY"Event Stream
event: positiondata: {"position": 3, "eta_seconds": 45}
event: starteddata: {}
event: progressdata: {"progress": 0.65, "step": 20}
event: completedata: {"output": "https://cdn.render.weyl.ai/i/xyz.webp"}Python Client
import requestsimport 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)