Managing desktop environments for automated tasks is painful. You must spin up VMs, provision OS images, install dependencies, configure browsers, and keep them clean between runs. The /v1/machines API changes that. It provisions a cloud desktop you can start, stop, and snapshot with a single HTTP request. Your computer use agent can then drive that desktop to execute real workflows, run end-to-end tests, or explore UIs without you ever touching a hypervisor.
How the API works
Provisioning a machine is a two-step flow. First, you call POST /v1/machines with a JSON payload that defines the machine type and optional image identifier. The endpoint returns a machine object with an id, status, and a cloud provider identifier. You then issue start and stop commands on that id to manage the lifecycle. The agent can begin taking screenshots and issuing actions once the machine reaches a ready state. Because the machine is a real desktop, the agent experiences the same visual context as a human user.
#!/usr/bin/env bash
COASTY_API_KEY="${COASTY_API_KEY:?COASTY_API_KEY must be set}"
BASE_URL="https://coasty.ai/v1"
# Provision a machine
MACHINE_RESPONSE=$(curl -s -X POST "$BASE_URL/machines" \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "ubuntu-22.04-desktop",
"memory_gb": 8,
"gpu": false
}')
echo "Provision response: $MACHINE_RESPONSE"
# Extract machine ID (adjust to actual field name from docs)
MACHINE_ID=$(echo "$MACHINE_RESPONSE" | jq -r '.id')
# Start the machine
START_RESPONSE=$(curl -s -X POST "$BASE_URL/machines/$MACHINE_ID/start" \
-H "X-API-Key: $COASTY_API_KEY")
echo "Start response: $START_RESPONSE"
# Wait a bit for the machine to become ready (optional)
sleep 10
# Stop the machine to release resources
STOP_RESPONSE=$(curl -s -X POST "$BASE_URL/machines/$MACHINE_ID/stop" \
-H "X-API-Key: $COASTY_API_KEY")
echo "Stop response: $STOP_RESPONSE"
Key fields and behavior
- POST /v1/machines creates a new machine record with an id, status, and cloud provider identifier.
- The response includes an id field you use for subsequent start/stop/snapshot calls.
- Start and stop operations are asynchronous; the status updates over time.
- You can snapshot a running machine to save its current state for reuse.
- The machine runs a full desktop environment, not a headless container.
- Your computer use agent connects to the machine via a secure tunnel and drives it with mouse and keyboard actions.
POST /v1/machines returns an id you use for all subsequent lifecycle commands.
Where this beats brittle automation
Traditional automation relies on brittle selectors, hardcoded indices, and API-only integrations that break when UI or backend changes. The computer use API lets your agent see the screen and act like a human. It can open the correct menu, type into the right field, and click the proper button even if IDs or classes shift. Provisioning real machines with /v1/machines ensures the environment matches production, so your agent exercises the same software stack you use every day.
Use the /v1/machines API to create ephemeral desktops for your computer use agent. Build CI pipelines that spin up clean environments, run parallel test harnesses, or explore UI workflows with real desktops. Get your API key at https://coasty.ai/developers to start provisioning machines on demand.
Want to see this in action?
View Case Studies