You cannot drive a real desktop, browser, or terminal with just API calls. You need a live machine. The /v1/machines API provisions cloud VMs that your computer use agent can control. The agent sees the screen, clicks, types, and runs workflows on real machines. This eliminates brittle CSS selectors and hard‑coded API paths. You get a real environment every time you run a task.
How it works
POST /v1/machines creates a machine resource. The request takes a machine_id, a cua_version, and an optional deploy flag. The server returns a JSON object with id, status, and a machine_url. The status can be provisioning, ready, stopped, or failed. Once status is ready, you can start the machine and let the computer use agent drive it. The agent uses either the stateless predict endpoint or the stateful sessions endpoint to capture screenshots and issue actions. The /v1/machines API does not bill you for the VM itself, only for agent steps on the machine.
# Provision a cloud machine for your computer use agent
export COASTY_API_KEY=$(cat ~/.coasty_key)
# Create a machine (provisioned, not yet started)
curl -s -X POST https://coasty.ai/v1/machines \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "my-test-machine",
"cua_version": "v3",
"deploy": false
}' | jq .
# Start the machine when status is ready
MACHINE_ID=$(curl -s -X POST https://coasty.ai/v1/machines \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "my-test-machine",
"cua_version": "v3",
"deploy": true
}' | jq -r '.id')
# Poll for ready status
while true; do
STATUS=$(curl -s -X GET "https://coasty.ai/v1/machines/$MACHINE_ID" \
-H "X-API-Key: $COASTY_API_KEY" | jq -r '.status')
echo "Status: $STATUS"
if [ "$STATUS" = "ready" ]; then
break
fi
sleep 2
done
# Now your computer use agent can drive this machine
# Example: POST /v1/runs with machine_id: $MACHINE_IDKey fields and states
- machine_id: a unique identifier for the machine (string)
- cua_version: version of the computer use agent (v3 or v4)
- deploy: boolean to start provisioning immediately (true/false)
- id: the machine identifier returned by the server
- status: provisioning, ready, stopped, failed
- machine_url: a URL to access the machine (if returned)
Deploy the machine with deploy:true and wait for status:ready before sending tasks.
Where this beats brittle automation
Traditional automation relies on CSS selectors, XPath, and fixed API endpoints. When a site changes a class name or moves a button, your tests break. With /v1/machines, the computer use agent sees the screen and acts like a human. It clicks buttons, fills forms, and navigates menus. It adapts to layout changes without you updating selectors. You can run the same agent on multiple machines in parallel, each with its own state. This makes self‑healing UI tests and data entry bots practical.
Connecting to task runs
After provisioning a machine, you pass its id to a task run. POST /v1/runs takes a machine_id field. The agent runs on that machine until it completes or hits a state like succeeded, failed, or cancelled. You can stream events from /v1/runs/{id}/events to see step‑by‑step actions. This lets you monitor progress and handle states like awaiting_human if configured with on_awaiting_human: pause or fail. Machine provisioning is a prerequisite for any computer use workflow that needs a real desktop.
Spin up cloud machines and let your computer use agent drive real environments. Build self‑healing UI tests, data entry bots, and multi‑step workflows without brittle selectors. Get your API key at https://coasty.ai/developers and start provisioning machines today.
Want to see this in action?
View Case Studies