1. Keep the API key on your server
Every stream route requires your API key, so the browser must never connect toapi.autumn.ai directly. Start the task server-side, then either proxy the SSE stream
through your backend or forward its events over your own channel.
2. Subscribe on the server, relay to the client
GET /task/{task_id}/stream attaches to the task and replays recent events if a turn is
already active, so a user who opens the page mid-run still sees context:
3. Map events to UI states
Each event carries atype, a summary, and data. The summary field is written to be
shown, so the cheap version of this UI is a scrolling activity feed of summaries. A step up
is a small state machine:
4. On done, fetch the rows
done ends the turn, not the task. Refresh the table from
GET /task/{task_id}/output, flattening cells for display and keeping _sources so each
value can link to where it came from. Outputs and sources covers the
cell shape.
5. Wire the follow-up box to continue
The natural next interaction is the user asking for changes. Send that throughPOST /task/{task_id}/continue/stream and reuse the same event pipeline for the new turn.
Disable the box while a turn is in flight; a submit during one returns 409.
Decision: if your UI only needs a progress bar and a finished table, skip the stream
entirely and poll GET /task/{task_id} with the terminal check from
Task lifecycle. Streaming earns its complexity when users watch.
Related
Live messages
The SSE mechanics: routes, parsing, and event names.
Build a reviewed list
Put a human reviewer behind this UI.