Provision Cloud Machines on Demand with the /v1/machines API
Building robust automation often requires real operating systems. Browser farms, terminal servers, or desktop apps are hard to mock. The Coasty /v1/machines API lets you provision a cloud VM on demand. Your computer use agent can then log in, run scripts, and interact with live UI elements. This is ideal for regression testing, UI workflows, and any task that needs a genuine desktop environment.
How it works
You start by POSTing to /v1/machines with a machine_id and optional image. The endpoint returns a machine object with an id, status, image, and region. You can start the machine to boot it, stop it to pause, and snapshot it to save state. Once running, you can feed screenshots and instructions to the Coasty Vision API or use Task Runs to drive the machine automatically until status is done.
curl -X POST https://coasty.ai/v1/machines \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "my-test-desktop",
"image": "ubuntu-22.04-desktop",
"region": "us-east-1"
}'
# Start the machine
curl -X POST https://coasty.ai/v1/machines/my-test-desktop/start \
-H "X-API-Key: $COASTY_API_KEY"
# Stop the machine
curl -X POST https://coasty.ai/v1/machines/my-test-desktop/stop \
-H "X-API-Key: $COASTY_API_KEY"
# Take a snapshot
curl -X POST https://coasty.ai/v1/machines/my-test-desktop/snapshot \
-H "X-API-Key: $COASTY_API_KEY"Machine lifecycle and costs
- ●POST /v1/machines creates a cloud VM with a machine_id and optional image. Returns an object with id, status, image, and region.
- ●POST /v1/machines/{id}/start boots the VM and sets status to running.
- ●POST /v1/machines/{id}/stop shuts it down and pauses compute.
- ●POST /v1/machines/{id}/snapshot saves the current OS state so you can restore it later.
- ●Task Runs are billed $0.05 per agent step, and the Vision API costs $0.05 per predict call.
POST /v1/machines then POST /v1/machines/{id}/start to get a running desktop, then POST /v1/sessions/{id}/predict with screenshots to drive actions.
Why computer use beats brittle selectors
API-only tools rely on stable endpoints or DOM selectors that break when layouts change. Coasty’s computer use agent sees the same screen as a human. It can click buttons, type into text fields, drag elements, and handle dynamic UI without hard-coded selectors. When paired with on-demand machines, you get full OS access and vision-based interaction in one stack.
What to build next
Use a provisioned machine to run end-to-end browser workflows, test login flows across OS versions, or automate desktop utilities. The /v1/runs endpoint lets you drive the agent with a task and optional instructions. Combine machines with workflows via POST /v1/workflows for multi-step pipelines. Get your API key at https://coasty.ai/developers and start spinning up desktop environments for your next automation project.