Tutorial

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

Lisa Chen||6 min
End

Most automation stacks rely on brittle selectors, hardcoded URLs, or fragile APIs. You spin up a VM and then fight against UI changes, consent dialogs, and environment drift. The Coasty /v1/machines API flips that model. You provision a real cloud machine, give the computer use agent a task, and let it drive the desktop exactly like a human. No selectors, no fragile APIs. Just a live desktop that you can start, stop, and snapshot on demand.

How it works

The /v1/machines endpoint provisions a cloud VM that you can start, stop, and snapshot. You send a POST request with machine_id (unique identifier you choose) and optional metadata such as operating_system, region, and tags. The server returns a machine object with id, status (pending, running, stopped), and connection details. Once status is running, you can attach a task run or interact with the machine directly. This machine is a real desktop, not a sandboxed container, so browsers, terminals, and native apps work exactly as users see them.

bash
curl -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "ci-worker-001",
    "operating_system": "ubuntu-22.04",
    "region": "us-east-1",
    "tags": ["ci", "ephemeral"]
  }'

Key fields and lifecycle

  • machine_id: a unique string you choose. No duplicate IDs across runs.
  • operating_system: specify the OS image (e.g., ubuntu-22.04).
  • region: determines where the VM lives for latency and compliance.
  • tags: arbitrary metadata for grouping and filtering.
  • status: pending, running, or stopped. You must wait until running before using the machine.
  • You can start, stop, or snapshot a machine via actions on the machine object. Snapshots let you save a known-good state and roll back if needed.

POST /v1/machines spins up a real desktop you can start, stop, and snapshot on demand.

Where this beats brittle automation

Traditional automation hinges on stable selectors and API contracts. When UI changes or a platform evolves, your scripts break. With the Coasty computer use API, your agent sees the screen and acts like a human. It can click buttons, fill forms, navigate dynamic pages, and switch between tabs. It also works with terminal commands, native apps, and login flows. You don’t need to maintain a library of selectors. You just describe the task in natural language, and the agent drives the real machine. This makes your automation resilient to UI changes, consent popups, and environment drift.

Use /v1/machines to create ephemeral test environments, self-healing CI pipelines, and browser automation that survives UI updates. Start building with the Coasty computer use API and get your key at https://coasty.ai/developers.

Want to see this in action?

View Case Studies
Try Coasty Free