Most automation tools require you to map every UI element with brittle selectors and rebuild logic when a page layout changes. The /v1/runs endpoint lets you hand off a task to an agent that can see the screen, reason about it like a human, and drive clicks and typing on a real desktop until the job is done. You only pay $0.05 per agent step and get a live stream of events to know when your agent is paused, succeeded, or failed.
How /v1/runs works
You POST to /v1/runs with a machine_id, a task description, and optional parameters like cua_version, instructions, system_prompt, max_steps, deadline_seconds, on_awaiting_human, and webhook_url. The server provisions the machine and launches an agent that continuously captures the screen, reasons, and emits actions until the task completes or a guard condition triggers. You GET /v1/runs to list runs and GET /v1/runs/{id} to inspect a single run. The event stream at GET /v1/runs/{id}/events returns Server-Sent Events (SSE) with state changes and progress. States include queued, running, awaiting_human, succeeded, failed, cancelled, and timed_out.
curl -X POST https://coasty.ai/v1/runs \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "vm-1234",
"task": "Open Chrome, go to https://example.com, and click the first link that contains the word GitHub."
}'Key parameters for reliable runs
- machine_id: the ID of a provisioned cloud VM from /v1/machines
- task: a natural language description of what the agent should accomplish
- cua_version: default is v3; v4 adds a pass/fail verifier and autonomous behavior
- instructions: optional string appended to the base task prompt
- system_prompt: optional override of the agent's system instructions
- max_steps: hard cap on agent iterations, prevents runaway costs
- deadline_seconds: hard wall for the whole run, prevents infinite loops
- on_awaiting_human: control behavior when the agent needs human input (pause, fail, cancel)
- webhook_url: optional callback with an HMAC-signed payload
- billing: $0.05 per agent step, charged from a prepaid wallet where 1 credit equals $0.01
The one line to remember: POST to /v1/runs with machine_id and task, then stream events from /v1/runs/{id}/events to monitor progress and handle paused states.
Where this beats brittle automation
With traditional automation you must enumerate every button, input, and link and maintain CSS selectors, XPath, or Playwright IDs. When a site redesigns, your scripts break. The /v1/runs endpoint lets an agent see the live screen, understand context, and adapt its actions to changes. You do not need to maintain brittle selectors, you just describe the goal in plain language. The agent can also handle dynamic text, popups, and multi-step workflows that require human-like reasoning, which pure API tools cannot do.
You can now build an autonomous computer use agent that runs to completion on a remote desktop using the /v1/runs endpoint. Start by provisioning a machine with /v1/machines, submit your first run, and stream events to track progress. Get your API key at https://coasty.ai/developers and start building agents that see and act like a human.
Want to see this in action?
View Case Studies