Skip to main content
A task that runs for minutes needs to show the user something better than a spinner. The SSE routes emit the same events the Autumn dashboard renders, so your UI can narrate the work as it happens: what the agent is doing now, errors as they occur, and rows the moment the turn ends.

1. Keep the API key on your server

Every stream route requires your API key, so the browser must never connect to api.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:
This split (one process starts, another watches) is exactly what the subscribe route is for; see Live messages for the event parsing itself.

3. Map events to UI states

Each event carries a type, 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 through POST /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.

Live messages

The SSE mechanics: routes, parsing, and event names.

Build a reviewed list

Put a human reviewer behind this UI.