Tutorial

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

Marcus Sterling||6 min
Ctrl+C

You want an agent that can click, type, and navigate a real desktop. You do not want to maintain a fleet of VMs or hardcode element selectors for every site. The /v1/machines API lets you provision cloud machines on demand. Each machine is a full desktop environment you can start, stop, and snapshot. Your computer use agent can drive it using vision and mouse actions, not just API calls.

How it works

To provision a machine, send a POST request to /v1/machines with your API key in the X-API-Key header. The request does not require a body, but you can pass optional parameters such as region or size if the API supports them. The endpoint returns a machine object with an id, status, and other metadata. You can then start the machine, send it to your computer use agent, and later stop or delete it to save credits.

bash
curl -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $COASTY_API_KEY"
python
import os
import requests

url = "https://coasty.ai/v1/machines"
headers = {"X-API-Key": os.getenv("COASTY_API_KEY")}

resp = requests.post(url, headers=headers)
resp.raise_for_status()
machine = resp.json()
print("Machine id:", machine["id"])
print("Status:", machine["status"])

# Start the machine
start_url = f"https://coasty.ai/v1/machines/{machine['id']}/start"
resp = requests.post(start_url, headers=headers)
resp.raise_for_status()
print("Started machine")

Machine lifecycle

  • POST /v1/machines provisions a new cloud machine and returns its id
  • You can start, stop, or snapshot the machine using its id
  • Each provisioned machine consumes credits from your prepaid wallet (1 credit = $0.01)
  • Stopping or deleting machines frees credits for other runs
  • The agent runs task steps for $0.05 per step on top of machine costs

The /v1/machines endpoint is the foundation for on-demand cloud desktops. Use it to provision environments your computer use agent can drive.

Where this beats brittle automation

Traditional automation often relies on brittle element selectors that break when a site updates. The /v1/machines API gives you a real desktop. Your computer use agent sees the screen, understands context, and clicks, types, and scrolls like a human. This approach works across browsers, terminals, and desktop apps without maintaining dozens of selectors. You can spin up fresh machines for each run, ensuring no state leaks between tasks.

Provision cloud machines on demand with the /v1/machines API and give your computer use agent a real desktop to work on. Stop guessing with selectors and start building agents that can handle any UI. Get your API key at https://coasty.ai/developers and start provisioning machines today.

Want to see this in action?

View Case Studies
Try Coasty Free