Back to Blog
Tutorial

Marcus Sterling7 min
⌘+T

Checkout flows are full of moving targets. Captchas, dynamic pricing, consent popups, and changing DOM structures break any selector-based bot. A computer use agent can see the screen, reason about what it sees, and click or type like a human. The Coasty Computer Use API lets you send a task and get a live desktop driver that types, selects, and confirms payments. You do not write selectors. You just describe the flow.

How it works

The simplest way to drive a form is a Task Run. POST /v1/runs starts a cloud machine, launches a browser, and runs a computer use agent. The request body defines the task and options. The server returns a run ID. You stream events from /v1/runs/{id}/events to watch clicks, keystrokes, and page loads in real time. When the run succeeds or fails, the event stream emits a final status. Each agent step costs $0.05. A short checkout might take 20 steps and cost about $1.

bash
# Start a checkout run. Replace YOUR_KEY with your Coasty API key.
# The machine_id is a cloud VM that the agent will use.
curl -X POST https://coasty.ai/v1/runs \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "vm-12345",
    "task": "Navigate to the checkout page, fill the shipping form, select express shipping, enter a valid credit card, and complete the order.",
    "cua_version": "v4",
    "max_steps": 60,
    "deadline_seconds": 600,
    "on_awaiting_human": "pause"
  }' | jq .

Task Run options you should know

  • machine_id: the cloud VM the agent uses. POST /v1/machines provisions a VM for you.
  • task: plain English instructions describing the form flow, including site URLs and steps.
  • cua_version: v4 is autonomous with a pass/fail verifier. v3 is the default if you omit this field.
  • max_steps: cap the number of agent steps. Each step is billed $0.05, so this controls cost.
  • deadline_seconds: abort after this many seconds. It protects you from runaway runs.
  • on_awaiting_human: pause execution when a human approval step is reached. Options are pause, fail, or cancel.

Start a checkout run with POST /v1/runs and stream events with GET /v1/runs/{id}/events.

Where this beats brittle automation

Selector-based tools rely on stable class names, IDs, and layout. A single layout change or consent banner can break a bot entirely. A computer use agent sees the screen every step. It can read text, detect buttons, and adapt to layout shifts. It also handles CAPTCHAs by asking a human or by following the on_awaiting_human policy. You do not need to maintain fragile selectors. You only need to keep the task description up to date.

What to build next

Extend the checkout flow into a workflow. Use POST /v1/workflows to version your DSL with tasks, asserts, retries, and loops. You can run the same checkout across multiple sites or add retries after payment failures. If you need more control, use POST /v1/sessions + POST /v1/sessions/{id}/predict for a stateful trajectory memory. Build a checkout dashboard that shows run history and events. Get your API key at https://coasty.ai/developers and start automating forms like a human.

© 2026 Coasty

Backed byYCombinator