Skip to main content
GET /api/v1/r/tasks/{taskId}/events opens a Server-Sent Events stream that emits one event per status change or progress tick. The connection stays open until the task reaches a terminal state (completed, failed, cancelled), then closes. Prefer this over polling GET /r/tasks/{taskId} — lower latency, fewer requests.

Connect

Use a Bearer token (JWT, sk-, or dk-):
The browser’s built-in EventSource does not support custom headers, which means it can’t carry an Authorization header. Server-side runtimes (Node fetch, Python requests, httpx), React Native, or libraries like eventsource work fine. In a browser, proxy through your own backend.

Event types

status

progress

Nerfstudio tasks add stage (download, process_data, train, export, upload) and a human-readable message to the payload.

Terminal events

After any of these three the server closes the connection.

error

A transient server-side problem reading task state. Treat it as recoverable — the task itself may still be running. If the stream also closes, fall back to polling (see below).

Example stream

A typical ComfyUI task end-to-end:

Polling fallback

If your network drops SSE, or you’d rather not hold a connection open, poll GET /r/tasks/{taskId} until task_status is one of completed, failed, cancelled. Three seconds between polls is a reasonable default.
When the task is completed, fetch the artifact links via GET /r/tasks/{taskId}/result.

Consume the stream