Tutorial

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

Alex Thompson||6 min
Ctrl+S

Most computer use setups run on a local desktop or a fixed headless VM. You configure OS images, SSH keys, and browser profiles. When the workload grows, you must manage dozens of machines manually. The /v1/machines endpoint solves this by letting you provision a cloud VM on demand through the Coasty API. Your computer use agent can then drive that real desktop, browser, or terminal, handling UI changes without brittle selectors.

How provisioning works

The endpoint creates a cloud VM under your account and returns its machine_id. You provide a name and optional metadata. The server handles networking and OS provisioning. Once created, you can start and stop the machine or take a snapshot. The machine_id is the key you pass to your agent runs, workflows, and other APIs that require a machine context.

bash
curl -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "agent-desktop-01",
    "metadata": {
      "purpose": "osworld-v4-autonomous",
      "team": "qa-bot"
    }
  }'

Provisioning fields and responses

  • name: required string for the machine identifier.
  • metadata: optional JSON object. Use it to tag machines for routing or filtering.
  • machine_id: returned in the response. Use this for all subsequent operations.
  • status: shows the current state such as provisioning, running, or stopped.
  • You can start and stop the machine with GET /v1/machines and POST /v1/machines/{id}/start|stop.

Always keep the returned machine_id safe. It links all your agent runs and workflows to the same cloud VM.

Where this beats brittle automation

API-only tools rely on stable selectors like class names, XPath, or element IDs. When a UI changes, those selectors break. A computer use agent that sees the screen can recognize buttons, menus, and text that move around. By provisioning a real desktop VM, your agent can interact with applications the same way a human does. This is especially powerful for browser automation where cookies, popups, and navigation paths are unpredictable.

Start by creating a machine with /v1/machines and use the machine_id in your agent runs. From there, you can integrate workflows, MCP servers, and autonomous verification. Get a key at https://coasty.ai/developers to begin provisioning cloud machines for your computer use agent.

Want to see this in action?

View Case Studies
Try Coasty Free