Tutorial

Provision Cloud Machines On-Demand With the /v1/machines API

Daniel Kim||8 min
Ctrl+A

You want to run a computer use agent that interacts with a real browser, desktop app, or terminal, but you do not want to manage VMs yourself. The /v1/machines API solves this by provisioning cloud machines on demand. You create a machine, start it, and then route your task runs or task steps to that machine. The agent drives real environments, not just API calls.

How it works

Provisioning a machine is a two-step process. First, POST to /v1/machines to create a machine resource. The response contains an id and status fields. You can then start the machine with a start command. The agent then uses this machine ID for subsequent task runs or task steps. The /v1/machines endpoint is part of the Coasty Computer Use API, which lets you provision real desktop environments on demand.

bash
# Provision a cloud machine
API_KEY=$(cat "$HOME/.coasty_key")

# Create a machine
MACHINE_RESPONSE=$(curl -s -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "test-browser-machine"}')

# Inspect the response
echo "$MACHINE_RESPONSE" | jq .

# The response will contain an id and status fields
# Example output: {"id": "mch_abc123","status":"provisioning"}

# Start the machine
START_RESPONSE=$(curl -s -X POST https://coasty.ai/v1/machines/$ID/start \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json")

echo "$START_RESPONSE" | jq .

# The machine is now ready to be used in task runs or task steps
# Example output: {"status":"running"}

Key fields and behaviors

  • name: optional string for your reference
  • id: string returned by the API for the machine resource
  • status: one of provisioning, running, stopped, error
  • You can start, stop, and manage machines via the API
  • The agent uses the machine ID for subsequent task runs or task steps

POST /v1/machines to create a machine, then start it with POST /v1/machines/{id}/start to get a live desktop for your computer use agent.

Where this beats brittle automation

Traditional automation relies on brittle selectors and fixed API endpoints. The Coasty Computer Use API lets your agent see the screen and act like a human. When the UI changes, your agent adapts. With real machines, you can run browsers, desktop apps, and terminals exactly as a human would. This is especially useful for complex workflows, testing, and data entry where visual context matters.

Provisioning cloud machines is the foundation for any computer use agent. Use the /v1/machines API to spin up desktop environments on demand, then route your task runs or task steps to those machines. Build automated testing, data entry, and UI workflows that drive real browsers and terminals. Get your key at https://coasty.ai/developers and start building.

Want to see this in action?

View Case Studies
Try Coasty Free