Back to Blog
Tutorial

David Park8 min
⇧+Tab

Automated QA often breaks because tools depend on fragile selectors or lack context. A self-running QA bot that sees the screen and acts like a human avoids those issues. The Coasty Computer Use API lets you run agents that capture screenshots, understand what is on screen, and click, type, and verify. This guide shows how to build a QA testing bot with real endpoints and accurate pricing.

How it works

The QA bot runs as a task using the /v1/runs endpoint. You POST a machine_id, a task description, and a cua_version. The server creates a task run, provisions a cloud VM if needed, and starts an agent. The agent captures screenshots, sends them to the vision endpoint, and executes actions. You stream events from /v1/runs/{id}/events to track progress. Billing is $0.05 per agent step. When the run succeeds, failed, or times out, the status field in the response indicates the outcome.

bash
#!/bin/bash

COASTY_API_KEY="${COASTY_API_KEY}"
machine_id="coasty-prod-vm-001"

# Create a task run for a QA test
curl -s -X POST https://coasty.ai/v1/runs \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "'"$machine_id"'",
    "task": "Open the application, navigate to the login page, enter a username and password, submit the form, and verify that the dashboard load appears.",
    "cua_version": "v4",
    "max_steps": 50,
    "deadline_seconds": 300,
    "on_awaiting_human": "pause"
  }' | jq '.run_id.status'

# Stream events from the run
curl -s -N https://coasty.ai/v1/runs/"$(curl -s -X POST https://coasty.ai/v1/runs -H "X-API-Key: $COASTY_API_KEY" -H "Content-Type: application/json" -d '{"machine_id": "'"$machine_id"'","task": "Test login flow","cua_version": "v4"}' | jq -r .run_id)/events \
  -H "X-API-Key: $COASTY_API_KEY"

Task run parameters

  • machine_id: Cloud VM ID to drive real browsers and desktops
  • task: Natural language description of the QA test
  • cua_version: Use 'v4' for an autonomous agent with a pass/fail verifier
  • max_steps: Upper limit on agent steps to prevent runaway work
  • deadline_seconds: Fail runs that exceed this duration
  • on_awaiting_human: 'pause', 'fail', or 'cancel' when the agent needs human input
  • webhook_url: Optional URL to receive finished runs via signed webhooks

Billed $0.05 per agent step, start with small max_steps and deadline_seconds to control costs.

Where this beats brittle automation

Traditional automation often relies on CSS selectors, XPath, or fixed element IDs that change when the UI is updated. A computer use agent from the Coasty API watches the screen, understands visual context, and clicks or types based on what it sees. This means your QA bot survives UI refactors and works across browsers and desktop environments without constant selector maintenance. The agent also handles dynamic content, loading states, and user prompts that pure API tools cannot reason about.

You now have a self-running QA testing bot that uses the Coasty Computer Use API to drive real browsers and desktops. Use /v1/runs to submit tasks, stream events with /v1/runs/{id}/events, and control behavior with max_steps and deadline_seconds. The next step is to wrap this logic in a CI pipeline or scheduler. Head to https://coasty.ai/developers to get a key and start building.

© 2026 Coasty

Backed byYCombinator