Tutorial

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

Emily Watson||6 min
End

Most automation stacks rely on brittle element selectors or APIs that do not actually exist. You want an agent that can click, type, and scroll on a real desktop, browser, or terminal. The /v1/machines API lets you provision a cloud machine on demand. Your agent runs directly on that machine, sees the screen, and acts like a human. You do not need to manage VMs yourself. You only need a key and a few lines of code.

How the /v1/machines endpoint works

POST /v1/machines creates a cloud VM and returns an ID and status. The request requires machine_id and task. The task field describes what you want the machine to do. The response returns id, status, and provision_progress. You can start, stop, and snapshot the machine with separate actions. The agent runs task steps on the machine. Each step costs $0.05. The endpoint does not return a password. You control the machine through task steps. The machine is not pre-configured. You define the environment in your task prompt. Use the /v1/runs endpoint to drive the agent on the machine.

bash
curl -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "my-browser-mac",
    "task": "Open Chrome and navigate to https://example.com and take a screenshot."
  }'

Key machine fields and costs

  • POST /v1/machines requires machine_id and task.
  • Response includes id, status, and provision_progress.
  • Use GET /v1/runs to inspect task runs on the machine.
  • Each agent step on the machine costs $0.05.
  • Use GET /v1/runs/{id}/events to stream events.
  • Set max_steps and deadline_seconds in runs to control execution.
  • Machines can be started, stopped, and snapshot with separate actions.
  • The agent drives real desktops, browsers, and terminals, not just API calls.

POST /v1/machines spins up a cloud desktop in seconds; POST /v1/runs drives an agent on that desktop with a $0.05 per-step cost.

Where this beats brittle automation

Traditional automation relies on selectors that break when layout changes. APIs often miss UI elements or return different data than what users see. The /v1/machines API gives you a real desktop. Your agent sees the screen, reads text, and clicks visible elements. It works with modern web apps, complex dashboards, and terminal workflows. You can also use the /v1/sessions endpoint for stateful trajectory memory, which remembers previous screen states and actions. This makes multi-step workflows smoother. The /v1/parse endpoint turns raw pyautogui code into structured actions. You can combine machine provisioning, computer use, and parse to build robust pipelines.

You now have a clear way to provision a cloud machine and run a computer use agent on it. Build workflows that interact with real UIs, browsers, and terminals. Next, explore task runs, workflows, and the MCP server for Cursor or Claude Desktop. Get your API key at https://coasty.ai/developers and start automating like a human.

Want to see this in action?

View Case Studies
Try Coasty Free