Back to Blog
Tutorial

Sarah Chen7 min
F12

You need an agent that opens a browser, logs into a portal, fills a form, and confirms success without hard‑coded selectors. The /v1/runs endpoint gives you a server‑driven agent that sees the screen, clicks, types, and reports back. It bills $0.05 per agent step and lets you attach a pass/fail verifier, a deadline, and a webhook so you can resume or cancel the task from your system.

How /v1/runs works

You POST to /v1/runs with a machine_id, a task description, and control options. The server provisions a cloud desktop, starts the agent with the given cua_version (default v3, use v4 for autonomous verification), and loops capture → predict → act until the agent finishes or hits max_steps or deadline_seconds. The response includes the run_id and initial state. You can poll GET /v1/runs/{id} or stream events with GET /v1/runs/{id}/events to follow progress in real time. States include queued, running, awaiting_human, succeeded, failed, cancelled, and timed_out. Billing happens at $0.05 per agent step.

bash
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 https://example.com, login with [email protected] / secretpass, click the logout button, and return the final URL.",
    "cua_version": "v3",
    "max_steps": 200,
    "deadline_seconds": 300,
    "on_awaiting_human": "pause",
    "webhook_url": "https://your-server.com/webhook/coasty"
  }'

Key request fields

  • machine_id: the cloud VM you provisioned with POST /v1/machines
  • task: plain‑language instructions for the agent
  • cua_version: default v3, use v4 for autonomous verification
  • max_steps: hard stop if the agent exceeds this many steps
  • deadline_seconds: hard timeout in seconds
  • on_awaiting_human: pause, fail, or cancel when the agent needs human input
  • webhook_url: URL for POST /v1/runs/{id}/cancel and resume

Billed $0.05 per agent step, no per‑call fees for the endpoint itself.

Where this beats brittle automation

Traditional tools rely on XPath, CSS selectors, or API mocks that break when UI changes or when the app uses a custom rendering engine. The computer use API sees the real screen, handles layout shifts, and works with any application that renders a desktop. You define the task in plain English, the agent navigates like a human, and you get a pass/fail outcome instead of fragile selectors. Plus, you can stream events and trigger webhooks to coordinate with your own workflows.

Next steps

  • Provision a machine with POST /v1/machines to get a machine_id
  • Attach a pass/fail verifier by setting cua_version to v4 and defining success criteria in the task
  • Stream events from GET /v1/runs/{id}/events to show live progress in your UI
  • Use an MCP server to drive Coasty from Cursor, Claude Desktop, or other clients

With /v1/runs you get a production‑grade computer use agent that finishes end‑to‑end tasks on a real desktop. Start by provisioning a machine, then launch a run with the task and parameters you need. Get your API key at https://coasty.ai/developers.

© 2026 Coasty

Backed byYCombinator