Back to Blog
Tutorial

Emily Watson5 min
Del

Building a computer use agent means you need a real desktop to act upon, not just a headless browser. You can write a script that opens a browser but you cannot reliably automate a real web app, a desktop app, or a terminal that reacts like a human. The /v1/machines API provisions a cloud VM you can start, stop, and snapshot. Your agent drives the VM through its OS, browser, or terminal. This is the foundation for high-fidelity, end-to-end automation.

How it works

The API uses a single POST request to provision a machine. The machine_id returned lets you start the VM, stop it, or create a snapshot. Once started, you can use the /v1/runs endpoint to drive the machine with a computer use agent. The server manages the cloud infrastructure, you only need to handle the machine lifecycle and trigger the agent.

bash
# Provision a cloud machine
export COASTY_API_KEY="your-key-here"
curl -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_type": "cloud",
    "os": "linux",
    "memory_gb": 2,
    "snapshot_id": null
  }'

# Start the machine using the returned machine_id
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_type": "cloud", "os": "linux", "memory_gb": 2}' \
  | jq -r .machine_id)

curl -X POST https://coasty.ai/v1/machines/$MACHINE_ID/start \
  -H "X-API-Key: $COASTY_API_KEY"

Key fields and lifecycle

  • POST /v1/machines creates a machine with machine_type, os, memory_gb, and optional snapshot_id.
  • Returned machine_id is used for all subsequent lifecycle operations.
  • POST /v1/machines/{id}/start begins the VM and makes it available to your agent.
  • POST /v1/machines/{id}/stop halts the VM and pauses billing.
  • POST /v1/machines/{id}/snapshot creates a saved state you can reuse.
  • The agent runs against real desktops, browsers, or terminals, not just API calls.
  • Machines are managed by the server; you only need to handle the machine lifecycle and trigger the agent.

POST /v1/machines returns a machine_id you use to start the VM in a computer use agent workflow.

Where this beats brittle automation

With selectors and API-only tools, you must hardcode CSS classes, IDs, or API endpoints that may change. A user might move a button, rename a class, or the application may use DOM-sprouting. When you provision a cloud machine and drive it with a computer use agent, the agent sees the same visual screen as a human. It can click, type, and scroll like a person, adapting to layout changes automatically. This gives you reliable end-to-end automation across apps, desktop tools, and terminals without brittle selectors.

Start with a cloud machine, spin up a computer use agent with /v1/runs, and automate real desktop workflows. Get your API key at https://coasty.ai/developers and build robust, human-like automation.

© 2026 Coasty

Backed byYCombinator