Tutorial

Provisioning Cloud Machines on Demand with the /v1/machines API

Priya Patel||7 min
Ctrl+H

Most automation struggles when UI elements change or APIs disappear. You end up scraping brittle selectors or managing fragile wrapper services. The /v1/machines API solves this by provisioning real cloud VMs you can start, stop, and snapshot. Your computer use agent drives the desktop, browser, and terminal directly, seeing the screen and acting like a human. This lets you build workflows that interact with live environments, not just API calls.

How it works

POST /v1/machines provisions a cloud VM with a machine_id. You start it with a start request, stop it to save resources, and snapshot it for repeatable environments. All actions return machine_id and status fields. The agent then uses that machine_id in task runs (POST /v1/runs) to drive the desktop. While task runs are billed $0.05 per agent step, machine provisioning itself charges credits at the wallet rate (1 credit = $0.01).

bash
curl -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "windows-11",
    "region": "us-east-1"
  }'

Machine lifecycle

  • POST /v1/machines creates a VM and returns machine_id and status.
  • Use machine_id in subsequent /v1/runs to run agents on that VM.
  • Start the machine with a start request to allocate resources.
  • Stop the machine to halt the VM and preserve state.
  • Snapshot the machine to save a clean state for reuse.

Use machine_id from /v1/machines in POST /v1/runs to drive the cloud desktop with your computer use agent.

Where this beats brittle automation

When you rely on HTML selectors, a single layout change breaks your scripts. APIs change, rate limits hit, and platforms introduce new redirects. A computer use agent sees the screen, understands context, and clicks, types, and drags naturally. It can handle dynamic UI, popups, and multi-step flows without brittle selectors. The /v1/machines API gives you real environments, so your agent works on the actual OS, browser, or terminal you care about.

Spin up cloud machines on demand, start your agent, and watch it drive the desktop through vision and actions. Build workflows that handle real-world complexity instead of 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
Try Coasty Free