Skip to main content
Instead of polling or configuring webhooks, you can stream job status updates using Server-Sent Events (SSE). This is useful when you need real-time updates without a public webhook endpoint — for CLI tools, local scripts, or serverless functions.

Usage

The connection stays open and emits events as the job progresses:
The connection closes automatically when the job reaches a terminal state (Completed, Failed, or Canceled).

Event Types

Progress Events

Long-running jobs (like drawing preprocessing) emit progress events:
The progress field is a number between 0 and 1. Not all job types emit progress events.

Already-Completed Jobs

If the job has already completed when you open the stream, you’ll receive a single terminal event and the connection closes:

Example: Python

Example: JavaScript

Heartbeat

The server sends a comment line every 15 seconds to keep the connection alive:

Connection Limits

Each API key can have up to 10 concurrent SSE connections. Opening an 11th connection returns 429 Too Many Requests.

When to Use What