From Prototype to Production with the Coasty Computer Use API
You prototype a desktop automation script in Python or Node. It clicks a button, fills a form, checks a result. It works for you, but it breaks when the UI changes. You need an agent that understands the screen and adapts to layout shifts. The Coasty computer use API gives you that capability. It provisions machines, streams screen captures, predicts actions, and lets you orchestrate complex multi-step workflows with task runs and the workflow DSL.
How it works
You start by provisioning a cloud machine with POST /v1/machines. The response includes a machine_id you use in a task run. POST /v1/runs sends the task, cua_version, and optional instructions. The server drives the agent on the machine, capturing screenshots, predicting clicks and typing, and streaming events via Server-Sent Events. When the status becomes succeeded or failed, the run is complete. You can resume, cancel, or stream events with Last-Event-ID. For a simpler prototype, you can call POST /v1/predict directly on a screenshot, paying $0.05 per prediction.
curl -X POST https://coasty.ai/v1/runs \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "machine_abc123",
"task": "Log in to https://example.com with email [email protected] and password mypass123",
"cua_version": "v3",
"max_steps": 200,
"deadline_seconds": 300
}'Add stateful memory and workflows
- ●Use POST /v1/sessions to create a session with a $0.10 upfront cost and $0.04 per predict.
- ●POST /v1/sessions/{id}/predict attaches a screenshot and instruction, returning a trajectory of actions.
- ●Define multi-step logic with POST /v1/workflows, using tasks, if, loop, parallel, human_approval, retry, succeed, fail.
- ●Variables like {{inputs.x}} and stepId.field let you reference inputs and intermediate results.
- ●Task steps inside workflows are billed $0.05 each.
Use POST /v1/runs with cua_version for autonomous task runs, or POST /v1/sessions for stateful predict loops.
Where this beats brittle automation
Most automation relies on CSS selectors, XPath, or hardcoded IDs. When the UI updates, the script fails. With the Coasty computer use API, the agent sees the screen, interprets descriptions, and acts on what it perceives. It can handle layout changes, missing elements, and dynamic content. You also get a real VM machine_id, not a headless browser, so the agent interacts with native apps, terminals, and OS dialogs. For high-stakes production, you can route human approval via human_approval steps or webhook_url, and track runs with events and Idempotency-Key for idempotent retries.
Start with a prototype using POST /v1/runs or /v1/predict, then move to stateful sessions and workflows. Build agents that adapt to real UI changes. Get your API key at https://coasty.ai/developers and begin production-ready automation today.