Tutorial

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

Emily Watson||5 min
Del

Most computer use agents run in a sandbox. They can click buttons all day, but they never touch a real browser, desktop, or terminal. That changes with the /v1/machines API. You provision a cloud VM, the agent logs into it, and you get a real machine you can interact with. This turns your agent from a simulator into something that can verify installations, run end-to-end tests, and control production systems.

How it works

The /v1/machines endpoint creates a cloud virtual machine for you. You send a POST request to /v1/machines with at least a machine_id and a task description. The server allocates a VM and returns its identifier along with a status. Once the status shows the machine is ready, your agent can start interacting with it through the computer use flow: capture screen, predict actions, execute. The machine lives until you stop it or you explicitly shut it down. You manage life cycle with start, stop, and snapshot actions.

bash
# Provision a machine and check its status
export COASTY_API_KEY

curl -s -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "my-agent-vm-001",
    "task": "Start a web browser and navigate to https://coasty.ai"
  }' | jq .

Machine lifecycle

  • POST /v1/machines: creates a new cloud VM. You provide machine_id and a brief task description.
  • GET /v1/machines: lists your provisioned machines and their current status.
  • POST /v1/machines/{id}/start: brings the machine online so the agent can interact.
  • POST /v1/machines/{id}/stop: shuts down the machine to stop billing.
  • POST /v1/machines/{id}/snapshot: saves the current state. You can restore from a snapshot later.

Provision a real machine with POST /v1/machines, then start it so your computer use agent can drive it.

Where this beats brittle automation

Traditional automation relies on brittle selectors. A button might change class names, an ID might shift, and your test breaks. Computer use agents see the screen and act like humans. They can read text, recognize layout changes, and recover when elements move. When you pair that with a real machine, you can run installation scripts, configure services, and perform UI tests on actual software. This is the difference between simulation and production-grade validation.

You now have a way to spin up real machines and let a computer use agent take over. Build workflows that install software, run end-to-end tests, or control terminal sessions. Next, try integrating machines into a workflow with POST /v1/workflows and POST /v1/runs. Go to https://coasty.ai/developers to get your API key and start provisioning machines.

Want to see this in action?

View Case Studies
Try Coasty Free