Build an Autonomous Agent That Finishes a Task with /v1/runs
You want an agent that can open a browser, fill out a form, click a button, and close the tab, all without hard-coded selectors. The /v1/runs endpoint gives you that capability. It provisions a machine, sends a task, and lets the server drive real desktops, browsers, and terminals until the job is done or the deadline is reached.
How /v1/runs works
You POST to /v1/runs with a task and optional configuration. The server spins up a machine, starts an agent that can see the screen, and executes actions. The agent runs until it succeeds, fails, cancels, or times out. You can stream events, cancel a run, or resume a paused run.
curl https://coasty.ai/v1/runs \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "vm-123",
"task": "Open Chrome, navigate to https://example.com, click the Sign Up link, and type your email.",
"cua_version": "v3",
"max_steps": 200,
"deadline_seconds": 300,
"on_awaiting_human": "pause"
}'Request fields
- ●machine_id: your provisioned cloud VM identifier.
- ●task: the natural language instruction the agent receives on the screen.
- ●cua_version: defaults to 'v3'; 'v4' adds a pass/fail verifier and autonomous behavior.
- ●max_steps: maximum agent steps before timeout, defaults to 200.
- ●deadline_seconds: total time before the run is cancelled, defaults to 300.
- ●on_awaiting_human: 'pause', 'fail', or 'cancel' when the agent needs human input.
- ●system_prompt: optional system-level instructions appended to the base prompt.
- ●webhook_url: optional URL to receive final status and events.
You pay $0.05 per agent step via a prepaid USD wallet (1 credit = $0.01).
Where this beats brittle automation
Traditional automation relies on CSS selectors, XPath, or API endpoints that can break when UI changes. A computer use agent sees the screen like a human does, so it adapts to layout shifts, missing elements, or unexpected states. You can ask it to 'click the button on the top right' and it will locate the button visually, not by class name. This works for browsers, desktop apps, and CLI tools, reducing maintenance and false positives.
Next steps
- ●Provision a machine via POST /v1/machines and get a machine_id.
- ●Stream events with GET /v1/runs/{id}/events to monitor progress.
- ●Cancel a long-running run with POST /v1/runs/{id}/cancel.
- ●Resume a paused run with POST /v1/runs/{id}/resume.
- ●Use workflows (POST /v1/workflows) to sequence multiple /v1/runs with conditions and retries.
Start building autonomous agents that finish tasks end-to-end. Get a key at https://coasty.ai/developers and try the /v1/runs endpoint.