Skip to main content

Build Progress (SSE)

The primary way to observe a build. Open a Server-Sent Events stream and receive one ProvisioningEvent per phase transition plus progress ticks in slow phases. On connect, the current state is replayed first, then events stream until a terminal event (done or error), after which the connection closes.

Authentication

This stream requires the Authorization header, so the browser’s native EventSource (which cannot send custom headers) cannot consume it directly. Consume it server-side — your backend opens the stream with the key and relays events to the browser (over your own SSE/WebSocket). This is the Pattern A backend proxy. Use fetch with a streaming body reader, or a Node SSE client like eventsource, not raw EventSource in the browser.

Path Parameters

string
required
The bld_… id returned by from-url (also available as the streamUrl).

Wire Format

Each message is a standard SSE frame. The id: is the event’s emittedAt ISO8601 timestamp (usable as Last-Event-ID for reconnect). The event: name is progress for non-terminal events, done for a successful terminal, or error for a failed terminal. The data: is a JSON-encoded ProvisioningEvent.
A failed build closes with an error event:

ProvisioningEvent Contract

A single shape returned by SSE data, the poll snapshot, and the webhook — render against this one contract everywhere.

ProvisioningStatus values

ready is emitted only when the agent is published and its bounded index run is complete (or a phase timeout elapsed) — so the first chat is grounded in the creator’s content. Thin / partial content still publishes and reaches ready with a warning rather than failing.

ProvisioningErrorCode table

Each error carries retryable so the client can branch (retry vs. explain).
Pre-flight failures (plan_limit, insufficient_credits) and Turnstile / rate issues surface here as a failed event with the matching code — they are not synchronous errors on from-url (except the synchronous 400 turnstile_failed and 429 rate_limited cases on the initial submit).

SSE Consumer (Node)

A server-side consumer using a streaming fetch reader — no extra dependency. Relay each parsed event to your own browser clients.
Node / TypeScript
Alternatively, with the eventsource package (which supports custom headers, unlike the browser built-in):
Node — eventsource package

curl

curl

Reconnect

The id: of each frame is the event’s emittedAt timestamp. On reconnect, send Last-Event-ID: <last id you saw> to resume; the stream replays current state on every connect, so a fresh connect without the header is also safe.

HTTP Status Codes