Tutorial

Provision Cloud Machines on Demand with the Coasty Computer Use API

Marcus Sterling||6 min
Ctrl+S

Classic automation tools rely on selectors, IDs, or public APIs. When UI changes, scripts break. The Coasty /v1/machines endpoint solves this by letting you provision real cloud machines on demand. Each machine is a live desktop, browser, or terminal your agent can control directly. You start it, run your agent, and shut it down when done. This gives you a fully isolated environment that behaves exactly like a human user would see it.

How it works

The /v1/machines endpoint provisions a cloud VM for you. You send a POST request with a machine_id, a task description, and the cua_version you want to use. The server returns a machine object containing an id, a state (like 'pending' or 'running'), and a control URL. The agent can then interact with that machine using the computer use predict endpoints. When the task finishes, you stop or delete the machine to stop billing. This workflow removes the need to maintain a pool of static VMs and lets you scale up and down instantly.

bash
curl -X POST https://coasty.ai/v1/machines \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "test-browser-01",
    "task": "Open https://example.com and verify the title",
    "cua_version": "v3"
  }'

Key fields and pricing

  • machine_id: a unique identifier for the machine (string).
  • task: the high-level goal for the agent (string).
  • cua_version: the computer use agent version (default 'v3', 'v4' adds autonomous verification).
  • Endpoint: POST https://coasty.ai/v1/machines.
  • Billing: The machine is provisioned on demand. You stop or delete it to release resources.
  • No per-step charge on the /v1/machines call itself.

Start with POST /v1/machines, then drive the machine with POST /v1/sessions or POST /v1/runs.

Where this beats brittle automation

With selectors and static APIs, a single UI change breaks your tests. A computer use agent sees the screen like a human, reads text, clicks buttons, types into inputs, and navigates based on context. When you provision a fresh machine for each run, you also avoid state pollution between tests. This means your agent can reliably reproduce user workflows even when the application layout changes. You get true end-to-end automation without maintaining fragile selectors.

Provisioning cloud machines on demand gives you a clean slate for every agent run. Combine /v1/machines with task runs or workflows to build robust automated testing, onboarding simulations, or workflow bots. Ready to try it? Get your API key at https://coasty.ai/developers.

Want to see this in action?

View Case Studies
Try Coasty Free