Provision Cloud Machines on Demand with the /v1/machines API
Managing your own desktop and browser fleet is tedious. You handle scaling, OS upgrades, and security patches. A computer use agent needs a real desktop to interact with. The /v1/machines endpoint lets you provision cloud machines on demand. You start, stop, or snapshot them, then hand the machine to an agent. This keeps your code focused on the task, not the infrastructure.
How it works
The /v1/machines endpoint provisions a cloud VM that can host a real desktop environment. You send a POST request to create a machine and receive an ID. The machine starts in a stopped state. You call start on the machine ID to boot it. The agent then drives the desktop just like a human would. You can also stop the machine to save resources or snapshot it to create a consistent baseline.
# Provision a cloud machine
export COASTY_API_KEY=$(cat ~/.coasty_key)
# Create a machine
CREATED=$(curl -s -X POST https://coasty.ai/v1/machines \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "demo-machine",
"os": "windows",
"resolution": "1920x1080"
}')
MACHINE_ID=$(echo $CREATED | jq -r .id)
echo "Machine ID: $MACHINE_ID"
# Start the machine
STARTED=$(curl -s -X POST https://coasty.ai/v1/machines/$MACHINE_ID/start \
-H "X-API-Key: $COASTY_API_KEY")
echo "Start response: $STARTED"
# Stop the machine later
STOPPED=$(curl -s -X POST https://coasty.ai/v1/machines/$MACHINE_ID/stop \
-H "X-API-Key: $COASTY_API_KEY")
echo "Stop response: $STOPPED"
# Snapshot the machine
SNAPSHOT=$(curl -s -X POST https://coasty.ai/v1/machines/$MACHINE_ID/snapshot \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "demo-snapshot"
}')
echo "Snapshot response: $SNAPSHOT"
# List machines
curl -s https://coasty.ai/v1/machines \
-H "X-API-Key: $COASTY_API_KEY" | jq .Machine lifecycle
- ●POST /v1/machines creates a new cloud machine with a name and OS.
- ●POST /v1/machines/{id}/start boots the machine so the agent can interact with it.
- ●POST /v1/machines/{id}/stop halts the machine and stops billing for it.
- ●POST /v1/machines/{id}/snapshot saves the current state as a named snapshot.
Use /v1/machines to spin up a real desktop, then hand it to an agent with /v1/runs for task execution.
Where this beats brittle automation
Traditional automation relies on selectors, keyboard shortcuts, or documented APIs that change often. If a UI element moves or a site updates its selectors, your script breaks. A computer use agent sees the screen and acts like a human would. It can click, type, drag, and scroll naturally. By provisioning a real desktop with /v1/machines, you give the agent a consistent environment that reacts to real-world changes. This makes your automation more resilient and easier to maintain.
Provisioning cloud machines on demand with the /v1/machines API gives your computer use agent a real desktop to work with. Start, stop, and snapshot machines without managing infrastructure yourself. Build more reliable automation that adapts to real UI changes. Get your API key at https://coasty.ai/developers and start provisioning machines today.