Back to Blog
Tutorial

James Liu8 min
Ctrl+A

Traditional QA scripts rely on brittle selectors and hardcoded wait times. They break when UI changes or when you need to test on real browsers and desktop environments. The Coasty Computer Use API lets you build a self-running QA bot that sees the screen and acts like a human. It captures screenshots, follows instructions, clicks elements, and verifies results without relying on fixed X paths or IDs.

How a QA Bot Works with the Computer Use API

The computer use API drives a real machine through a loop of capture, predict, and act. You send a screenshot and a QA instruction to POST /v1/predict. The model returns actions such as moveTo, leftClick, type, and a status. You keep capturing and predicting until the status is done. Each predict call costs $0.05. The API also provides a stateful session endpoint POST /v1/sessions/{id}/predict for trajectory memory and POST /v1/ground to map element descriptions to coordinates for precise interactions.

bash
curl -X POST https://coasty.ai/v1/predict \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "screenshot": "$(base64 -i screenshot.png)",
    "instruction": "Go to https://example.com and click the login button.",
    "cua_version": "v3"
  }'

Create a QA Bot with a Task Run

  • POST /v1/runs provisions a cloud machine and an autonomous agent. You specify the machine_id, the task, and optional instructions. Use cua_version for the agent mode. The default is v3.
  • The agent runs step by step, each billed $0.05. It captures screenshots, predicts actions, and executes them on the real desktop or browser.
  • You can provide a system_prompt to guide the agent's behavior and a max_steps limit. The on_awaiting_human option lets you pause, fail, or cancel when the agent needs human input.
  • The agent's state flows through queued, running, awaiting_human, succeeded, failed, cancelled, and timed_out. Use GET /v1/runs/{id}/events to stream events and reconnect with Last-Event-ID.

A self-running QA bot is a POST /v1/runs with a QA task and a machine.

Why Computer Use Beats Brittle Automation

Selectors break when a page changes or when you need to support multiple frameworks. A computer use agent sees the screen and targets elements by description. It handles dynamic content, multiple languages, and layout changes without selector updates. The agent can also perform multi-step flows that require typing, selecting, and verifying results in a realistic environment. This makes it ideal for end-to-end QA on real browsers, desktops, and terminals.

You can now build a self-running QA bot that tests real UI flows on real machines. Use POST /v1/runs to launch an agent, stream events with GET /v1/runs/{id}/events, and verify each step. To get started, generate a key at https://coasty.ai/developers and read the full docs at https://coasty.ai/docs.

© 2026 Coasty

Backed byYCombinator