Back to Blog
Tutorial

Priya Patel8 min
+Tab

Traditional QA automation relies on selectors and APIs that break when UI changes or when a site hides elements behind a modal. The Coasty Computer Use API solves this by letting an agent see the actual screen and act like a human. You send a task, the server drives a cloud machine, and you get a success or failure result. This guide shows you how to use the POST /v1/runs endpoint to build a self-running QA bot that can verify your web app end-to-end.

How it works

You start by calling POST /v1/runs with a machine_id, a task describing the test, and a cua_version. The server launches a cloud VM and drives it through the steps. Each agent step costs $0.05. The response contains a run_id and an initial state. You poll GET /v1/runs/{id} to follow progress. When the server hits a human approval, you can set on_awaiting_human to pause, fail, or cancel. The run finishes with status succeeded or failed. You can stream events with GET /v1/runs/{id}/events to see actions in real time.

bash
#!/bin/bash

# Set your API key from the environment
export COASTY_API_KEY="${COASTY_API_KEY}"

# Start a QA run on a browser task
# POST /v1/runs
# - machine_id: use a machine_id from /v1/machines (e.g., 'machine-123')
# - task: what the agent should do
# - cua_version: "v3" or "v4" (v4 has a pass/fail verifier)
# - on_awaiting_human: "pause" to stop and wait
# Billed $0.05 per agent step
curl -s https://coasty.ai/v1/runs \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "machine-123",
    "task": "Open https://example.com, verify that the title contains "Example Domain", and close the browser.",
    "cua_version": "v3",
    "on_awaiting_human": "pause"
  }' | jq .

Follow the run to see results

  • GET /v1/runs returns a list of recent runs with id, status, created_at, and error fields.
  • GET /v1/runs/{id} gives you the full run details, including final status and any error message.
  • GET /v1/runs/{id}/events streams Server-Sent Events with actions and status changes. Use the Last-Event-ID header to reconnect.

Each agent step is billed $0.05. Track costs by monitoring steps or using the events stream.

Where this beats brittle automation

A computer use agent does not rely on CSS selectors or XPath. It sees the screen, reads text, and clicks buttons it can perceive. This means your tests survive layout changes, hidden elements, and dynamic content. You can run the same task on different browsers, different desktop environments, or even on real devices provisioned via the machines endpoint. This makes it a powerful tool for functional QA and smoke tests that need to stay resilient to UI evolution.

Next steps and resources

  • Create a key at https://coasty.ai/developers and read it from COASTY_API_KEY.
  • Provision a machine with POST /v1/machines if you need a specific environment.
  • Explore workflows (POST /v1/workflows) to chain multiple QA tasks, assertions, and retries.
  • Check the official OSWorld benchmark to see how well the agent performs on complex desktop tasks.

You now have a self-running QA bot that can see your app and act like a human. Start building with the Coasty Computer Use API, create your key at https://coasty.ai/developers, and ship tests that stay reliable as your UI evolves.

© 2026 Coasty

Backed byYCombinator