Writing selectors for every element kills developer velocity. You want an agent that sees the UI and clicks like a human. The /v1/runs endpoint lets you hand a task to an autonomous agent that drives a real desktop or browser until success. It handles the capture, prediction, and action loop for you.
How /v1/runs works
POST /v1/runs starts a task run on a cloud machine. The body contains machine_id, task, cua_version, optional instructions, system_prompt, max_steps, deadline_seconds, on_awaiting_human, and webhook_url. The server provisions a machine, starts an agent, and streams events until the run reaches a terminal state. Each agent step bills $0.05. The endpoint returns a run_id you can use to poll or stream events.
#!/bin/bash
# Save your key to the environment variable
export COASTY_API_KEY="your-api-key-here"
# Minimal run with defaults
curl -X POST https://coasty.ai/v1/runs \
-H "Authorization: Bearer $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "machine-123",
"task": "Open a browser and navigate to https://example.com",
"cua_version": "v3",
"max_steps": 200,
"deadline_seconds": 300,
"on_awaiting_human": "pause"
}' | jqKey request fields
- machine_id: ID of the cloud machine to run on
- task: plain-language instruction the agent receives
- cua_version: v3 for guided agent, v4 for autonomous with pass/fail verifier
- instructions: optional extra text appended to the base prompt
- system_prompt: optional custom system instructions
- max_steps: max agent steps before forced stop
- deadline_seconds: absolute deadline for the run
- on_awaiting_human: pause, fail, or cancel when the agent needs human input
- webhook_url: optional URL to receive final state and events
POST /v1/runs, bill $0.05 per agent step, read COASTY_API_KEY from the environment.
Where this beats brittle automation
Traditional automation relies on stable selectors, XPath, or IDs that break on layout changes or app updates. A computer use agent watches the screen, parses visual context, and acts naturally. It can handle dynamic content, missing elements, and layout shifts without you rewriting selectors. The agent can also handle mixed tooling like CLI commands inside browsers, making it ideal for end-to-end workflows.
What to build next
- Use GET /v1/runs to list all runs and monitor progress
- Stream events from GET /v1/runs/{id}/events to build real-time dashboards
- Cancel or resume runs with POST /v1/runs/{id}/cancel and POST /v1/runs/{id}/resume
- Combine runs into workflows with POST /v1/workflows and POST /v1/workflows/{id}/runs
- Use POST /v1/sessions and POST /v1/sessions/{id}/predict for stateful trajectory memory
You now have a working autonomous agent that finishes a task using the /v1/runs endpoint. Send it a machine, a task, and the version you want, and the server drives it to completion. Start prototyping today at https://coasty.ai/developers to get your API key.
Want to see this in action?
View Case Studies