Most computer use APIs give you a final result. You start a run and poll until it finishes. This is fine for batch jobs, but you lose visibility into what the agent does in between. You cannot see it pause, retry, or hit an edge case until it is too late. The Coasty Computer Use API fixes this. It streams events from the server using Server-Sent Events (SSE). You can attach Last-Event-ID to reconnect safely and resume streaming from where it left off. This lets you build dashboards, logs, and alerts that react to agent state in real time.
How it works
Start a task run with POST /v1/runs. The agent runs on a real machine and sends events back to you. The endpoint returns an event stream. Each event has a type, timestamp, and payload. Types include queued, running, awaiting_human, succeeded, failed, cancelled, and timed_out. When the connection drops, you send the Last-Event-ID header on a new request. The server streams events from that ID onward. This is safe because the server does not remove old events until the run completes. You can reconnect multiple times during a single run.
curl -N -H 'X-API-Key: $COASTY_API_KEY' \
-H 'Accept: text/event-stream' \
'https://coasty.ai/v1/runs' \
-d '{
"machine_id": "machine-123",
"task": "open https://coasty.ai",
"cua_version": "v4",
"max_steps": 50,
"on_awaiting_human": "pause"
}'Key request fields
- machine_id: your provisioned machine ID.
- task: natural language instruction for the agent.
- cua_version: 'v3' for basic runs, 'v4' for autonomous runs with a pass/fail verifier.
- max_steps: maximum number of agent steps allowed before timing out.
- on_awaiting_human: how to handle human approval, options are 'pause', 'fail', or 'cancel'.
Event types and payloads
- queued: run entered the queue.
- running: agent started processing the task.
- awaiting_human: agent needs human input; state is paused.
- succeeded: run completed successfully.
- failed: run failed; payload includes error details.
- cancelled: run was cancelled by you.
- timed_out: run exceeded max_steps or deadline_seconds.
Reconnect using the Last-Event-ID header to resume streaming without missing events.
Where this beats brittle automation
Traditional automation relies on selectors, IDs, and XPath. When a UI changes, the script breaks. The Coasty computer use agent watches the screen and acts like a human. It can adapt to layout shifts, new buttons, and unexpected error dialogs. Because you stream events, you can see the agent pause, inspect a dialog, or retry a step in real time. You can build dashboards that warn you when the agent hits awaiting_human or logs every action. This makes automation resilient and observable.
Use SSE and Last-Event-ID to stream live progress from Coasty runs. Build dashboards, logs, and alerts that react to agent state as it happens. Get a key at https://coasty.ai/developers and start streaming.
Want to see this in action?
View Case Studies