Documentation Index
Fetch the complete documentation index at: https://docs.cyberun.cloud/llms.txt
Use this file to discover all available pages before exploring further.
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-):
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
| Event | Meaning |
|---|---|
status | Task status changed (e.g. pending → waiting → queued → running). |
progress | Execution tick with progress, step_current, step_total, and the active node. |
completed | Task finished. Includes the output object. |
failed | Task failed. Includes the error string. |
cancelled | Task was cancelled before reaching a terminal state. |
error | Server-side error fetching status. The stream may still continue. |
status
progress
stage (download, process_data, train,
export, upload) and a human-readable message to the payload.
| Field | Type | Meaning |
|---|---|---|
progress | number | 0.0–1.0 overall progress. |
step_current | integer | Steps completed so far (when the runtime reports steps). |
step_total | integer | Total steps for this run. |
current_node | string | The runtime’s active node identifier (ComfyUI node ID for ComfyUI workflows). |
stage | string | Nerfstudio-only. Coarse phase name. |
message | string | Nerfstudio-only. Free-form status text. |
Terminal events
error
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, pollGET /r/tasks/{taskId} until task_status is one of
completed, failed, cancelled. Three seconds between polls is
a reasonable default.
completed, fetch the artifact links via
GET /r/tasks/{taskId}/result.
Consume the stream
Related
- Generate an API key — issue an
sk-credential. - API reference — the full endpoint catalog.
- Webhooks — push delivery of terminal events instead of streaming.
