Tutorial

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

Rachel Kim||6 min
Pg Up

Most desktop and browser agents require a persistent, reachable desktop to interact with. Maintaining your own Windows or Linux VMs, keeping them patched, and managing credentials is slow and error prone. The /v1/machines API lets you provision cloud machines on demand. Create a VM, start it, and let a computer use agent run tasks against a real desktop or browser instead of an API-only abstraction. This removes infrastructure friction and lets you scale agents across many environments.

How it works

Use POST /v1/machines to create a new machine. The request body can specify a name, region, and other configuration. The endpoint returns a machine object with an id, status, and connection details. You can start or stop the machine with start and stop actions. The /v1/runs API uses machine_id to schedule task runs against a live desktop. The server drives the agent to completion, billing $0.05 per agent step.

bash
curl -X POST https://coasty.ai/v1/machines \
  -H "Authorization: Bearer $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "demo-agent-machine",
    "region": "us-east-1"
  }'

Machine lifecycle

  • POST /v1/machines creates a new VM and returns a machine object with id, status (e.g., pending, running, stopped), and connection info.
  • Use the machine_id from the response when calling POST /v1/runs to target this machine for a task run.
  • POST /v1/machines/{id}/start and POST /v1/machines/{id}/stop let you manage the VM lifecycle.
  • Agents drive real desktops or browsers instead of simulated environments, enabling more realistic interactions.

POST /v1/machines creates a cloud VM that a computer use agent can start and drive to completion.

Where this beats brittle automation

Traditional web automation often relies on XPath, CSS selectors, or brittle API wrappers that break when UI changes. The computer use API lets an agent see the screen and act like a human. By tying a computer use agent to an on-demand VM, you get a temporary desktop that persists long enough for the agent to complete multi-step workflows, handle popups, and recover from errors. This approach works across browsers, local apps, and terminal sessions without maintaining brittle selectors.

Start provisioning cloud machines with /v1/machines to eliminate infrastructure overhead for your computer use agent. Spin up VMs, run browser and desktop tasks, and scale across regions. Get an API key at https://coasty.ai/developers to begin.

Want to see this in action?

View Case Studies
Try Coasty Free