Skip to main content

Chat Stream

POST 

/api/websites/:site_id/builder/chat

Stream one chat turn as Server-Sent Events.

When WEBSITE_BUILDER_STREAM_REATTACH is enabled we ALSO:

  1. Insert a row in website_builder_turns so the reattach probe can find this turn by (site_id, status=in_flight).
  2. Tee every SSE event into builder:turn:{turn_id} (Redis stream) so a reattaching client can replay past + future events.
  3. Inject the turn_id into the first start event so the original client can also hand it to a freshly-mounted hook in another tab. All Redis ops are best-effort: a Redis failure DOES NOT break the user-facing SSE response. Worst case the user just doesn't get reattach for this one turn.

Request

Responses

Successful Response