Tutorial

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

Marcus Sterling||4 min
Ctrl+C

Most computer use agents run on a local or pre-provisioned desktop. That means you either spin up your own VMs or build brittle selectors to poke at a remote session. With the /v1/machines endpoint you can provision cloud machines on demand. Your agent then connects to a real desktop, runs a task, and tears down the VM when it finishes.

How it works

You POST to /v1/machines with a machine_id (you provide it) and a label for the environment. The API returns a machine object that contains its state, uptime, and a base URL for the agent to connect to. You can start, stop, and snapshot machines via their state. The agent then drives that machine using the computer use API. When the task completes you can stop or delete the machine to avoid ongoing costs.

bash
curl -X POST https://coasty.ai/v1/machines \
  -H 'X-API-Key: $COASTY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "machine_id": "my-browser-01",
    "label": "Browser automation VM",
    "state": "start"
  }'

Key fields and states

  • machine_id: your unique identifier for the VM.
  • label: human-readable name for the environment.
  • state: start, stop, or leave empty to create a stopped machine.
  • Returned machine object includes state, uptime, and connection details.
  • You can snapshot machines to save a clean state for reuse.

POST https://coasty.ai/v1/machines with your machine_id and state to spin up a cloud desktop on demand.

Where this beats brittle automation

API-only tools rely on stable element IDs or predictable responses. When a site changes its layout or a app updates its UI, your selectors break. A computer use agent that sees the screen and acts like a human works regardless of DOM changes. By provisioning fresh cloud machines you can run each task in a clean environment and avoid state leakage between runs.

Now you can spin up cloud machines, let your computer use agent drive real desktops, and stop the VM when done. Build workflows that handle complex UIs with confidence. Get your API key at https://coasty.ai/developers to start provisioning machines today.

Want to see this in action?

View Case Studies
Try Coasty Free