Provision Cloud Machines on Demand with the Coasty Computer Use API
Most automation stacks rely on static environments or fragile XPaths. You spin up a Docker container and hope the UI does not change. The Coasty computer use API changes that by provisioning real cloud machines on demand. You get a live desktop, browser, or terminal that your agent can see, interpret, and interact with through natural language. This post shows how to provision machines with the /v1/machines endpoint and why it is safer than API-only approaches.
How /v1/machines works
The /v1/machines endpoint provisions a cloud VM you can start, stop, and snapshot. You make a POST request with a JSON body that includes machine_id and optional configuration fields. The server returns an object with the machine ID and status. You can then start the machine with its ID. The agent drives real desktops, browsers, and terminals, not just API calls. This stateful machine object lets you reuse an environment across multiple runs.
#!/bin/bash
# Example shell snippet using curl to provision a machine
# Read API key from environment variable
COASTY_API_KEY="${COASTY_API_KEY}"
BASE_URL="https://coasty.ai/v1"
# Provision a machine
MACHINE_ID="my-mac-prod"
PAYLOAD=$(cat <<EOF
{
"machine_id": "$MACHINE_ID"
}
EOF
)
RESPONSE=$(curl -s -X POST "$BASE_URL/machines" \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d "$PAYLOAD")
echo "$RESPONSE"
Provisioning a machine
- ●POST /v1/machines expects a JSON body with machine_id.
- ●The server returns a machine object with the same machine_id and a status field.
- ●Use machine_id as a unique identifier to provision the same environment repeatedly.
- ●No additional parameters are required for basic provisioning, so you can start small and add options later.
Running a task on a provisioned machine
- ●After provisioning, use machine_id in a /v1/runs request to drive the machine.
- ●Each step in a run is billed $0.05 per agent step.
- ●The agent sees the screen and acts like a human, so it works even if selectors change.
- ●Combine /v1/machines with /v1/runs to create on-demand, long-lived automation workflows.
Use /v1/machines to spin up a fresh environment for every run, then reuse the same machine_id for reproducible environments.
Where this beats brittle automation
When you only use APIs, you are limited to documented endpoints. If a UI adds a new consent banner or a field moves, your automation breaks. A computer use agent sees the screen with vision. It can click through a browser, type into a form, or run a terminal command exactly as a human would. This is why a computer use agent is more robust than brittle selectors or API-only tools. You build automation that adapts to real interfaces.
Provision cloud machines on demand with /v1/machines and drive them with the Coasty computer use API. Build agents that see and interact with real desktops, browsers, and terminals. Get a key at https://coasty.ai/developers to start automating like a human.