Subscribe to real-time Server-Sent Events for a job. This is the recommended approach over polling — it provides instant updates with lower latency and no wasted requests.
GET /api/v1/jobs/{job_id}/stream
job_id (string, required) — The unique job identifier returned from /generateX-API-Key (string, required) — Your API keyinstant_response — Educational text content generated for the query.thumbnail_generated — Thumbnail image URL is available.video_progress — Video generation progress update with percentage.video_completed — Video generation is complete. Contains video_url.video_failed — Video generation failed. Contains error message.Each message follows the standard SSE format:
event: video_progress
data: {"progress": 45, "current_step": "Generating animations"}
event: video_completed
data: {"video_url": "https://storage.aiprep.in/videos/abc123.mp4"}
On connect, the SSE endpoint replays all stored events for the job. This means if your connection drops and you reconnect, you will receive all previous events followed by any new ones — no data is lost.
EventSourcedoes not support custom headers. Usefetchwith a streaming reader to pass your API key via theX-API-Keyheader.