Build a Self-Running QA Testing Bot with the Computer Use API
Traditional UI automation relies on brittle selectors and hard‑coded locators. When the DOM changes or a component shifts, tests break. The Coasty Computer Use API lets you build a QA bot that sees the screen and acts like a human tester. The server drives a computer use agent to completion, streams live events, and you can assert outcomes along the way.
How it works
Start a task run with POST /v1/runs. Include the target machine, the QA task, and a cua_version of v4 for an autonomous agent with a pass/fail verifier. The server spins up a cloud VM, starts the agent, and executes steps until it reaches a final state. You can stream events with GET /v1/runs/{id}/events to watch progress in real time. When the run finishes, inspect the result to see if the test succeeded or failed.
# Example: start a QA run that opens a URL and clicks a login button
# Copy COASTY_API_KEY from your environment before running.
API_KEY=$(cat "$HOME/.coasty_key")
MACHINE_ID="cloud-vm-123"
TASK='Open https://example.com. Click the login button, type a user name, type a password, and submit the form.'
curl -s https://coasty.ai/v1/runs \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "'"$MACHINE_ID"'",
"task": "'"$TASK"'",
"cua_version": "v4",
"max_steps": 300,
"deadline_seconds": 600
}' | jq '.'Stream events to track progress
After the run starts, connect to the event stream with GET /v1/runs/{id}/events. This uses Server-Sent Events (SSE). Pass the Last-Event-ID header when reconnecting after an interruption. The stream emits events such as queued, running, awaiting_human, succeeded, failed, cancelled, and timed_out. This lets your QA dashboard show live progress and stop waiting when the agent finishes or when it reaches an unexpected state.
# Stream events for a completed run
API_KEY=$(cat "$HOME/.coasty_key")
RUN_ID="abc-123-def-456"
curl -s https://coasty.ai/v1/runs/$RUN_ID/events \
-H "X-API-Key: $API_KEY" \
-H "Accept: text/event-stream" \
--no-buffer | while read -r line; do
echo "$line"
doneBilling and limits
- ●Task runs are billed $0.05 per agent step.
- ●You can set max_steps to cap costs.
- ●Deadline_seconds lets you abort long-running tests.
- ●Runs can reach states such as succeeded, failed, cancelled, and timed_out.
- ●The v4 cua_version includes an autonomous pass/fail verifier.
Start a server-driven QA run with POST /v1/runs and stream events with GET /v1/runs/{id}/events.
Where this beats brittle automation
A computer use agent reads the visual state of the desktop, navigates by looking at buttons and text, and adapts when layout changes. This removes the need to maintain fragile XPath or CSS selectors. Because the agent runs on real machines, you catch layout regressions and interaction bugs that API-only tests cannot discover. You also avoid mocking and can test against production-like environments safely.
Take the QA bot further by wrapping runs in workflows, adding assert steps, or integrating with CI pipelines. Get your API key and start building at https://coasty.ai/developers.