Tutorial

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

Daniel Kim||6 min
Ctrl+A

Automated agents often hit a wall because they only know APIs and never see what is on the screen. They struggle with dynamic selectors, modal dialogs, or visual feedback loops. The /v1/machines API changes that by giving you a real cloud VM you can start, stop, and snapshot. You can then drive that machine with a computer use agent that sees the desktop, interprets it, and acts like a human. This enables robust automation for anything from web scraping to testing workflows that rely on visual states.

How it works

The /v1/machines endpoint provisions a cloud VM. You send a POST request to https://coasty.ai/v1/machines with an API key in the Authorization header. The response contains a machine_id and start_url. You use that ID to start the machine with a POST to /v1/machines/{id}/start. After the machine is running, you can stop it with POST /v1/machines/{id}/stop and snapshot it with POST /v1/machines/{id}/snapshot. This lets you manage lifecycle and state across runs.

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

# Response (simplified)
# {
#   "machine_id": "vm_abc123",
#   "start_url": "https://coasty.ai/v1/machines/vm_abc123/start"
# }

# Start the machine
curl -X POST https://coasty.ai/v1/machines/vm_abc123/start \
  -H "Authorization: Bearer $COASTY_API_KEY"

Machine lifecycle and operations

  • POST /v1/machines provisions a new cloud VM with optional machine_name, os_type, and region.
  • POST /v1/machines/{id}/start initiates the VM runtime.
  • POST /v1/machines/{id}/stop halts the VM and frees resources.
  • POST /v1/machines/{id}/snapshot captures a snapshot of the current state for reproducibility.

Use machine_id and start_url to drive the VM with a computer use agent that sees and acts like a human.

Where this beats brittle automation

Traditional automation often relies on brittle selectors (CSS classes, IDs) that break when UI changes. API-only tools cannot see visual feedback or handle modal dialogs. The /v1/machines API gives you a real desktop that your computer use agent can see. The agent captures a screenshot, predicts actions, and clicks or types. This visual grounding lets automation handle dynamic layouts, authentications, and workflows that need human-like perception. You are not guessing; you are seeing.

Build autonomous agents that can operate real desktops and browsers by combining /v1/machines with a computer use agent. Spin up a VM once, snapshot it across runs, and let the agent handle the rest. Get an API key at https://coasty.ai/developers and start provisioning machines on demand.

Want to see this in action?

View Case Studies
Try Coasty Free