You want to build a computer use agent that can navigate desktops, browsers, and terminals with high reliability. The Coasty Computer Use API offers two model flavors v3 and v4. v3 is a guided agent that waits for your decisions, while v4 is an autonomous agent with a pass/fail verifier. This guide shows the differences, pricing, and when to use each.
What the CUA versions actually do
- CUA v3: The server runs a guided agent that returns actions and a status. You loop capture, predict, and act until status is done. This is useful when you want to inspect steps or inject custom instructions before each action.
- CUA v4: The server runs an autonomous agent with a built-in pass/fail verifier that runs a task to completion. You submit a task and model ID and the server drives the agent until the verifier decides succeed or fail. This is useful for fire-and-forget tasks that must complete without human intervention.
- Both versions run on the same base URL https://coasty.ai/v1 with authentication via X-API-Key or Authorization: Bearer. You pay $0.05 per agent step for both v3 and v4 in task runs, and $0.05 for a single predict call in vision mode.
Task runs with v3 vs v4
- POST /v1/runs is the endpoint for task runs. Required fields are machine_id, task, and cua_version. cua_version can be 'v3' (guided) or 'v4' (autonomous). You can set max_steps or deadline_seconds to control runtime.
- For v3 you can also pass system_prompt, instructions (appended to the base prompt), and on_awaiting_human (pause, fail, or cancel). The server returns a run id and you can stream events via GET /v1/runs/{id}/events to see status changes (queued, running, awaiting_human, succeeded, failed, cancelled, timed_out).
- For v4 you typically omit instructions and on_awaiting_human since the verifier decides when the task is complete. You may still pass system_prompt to shape behavior, but the verifier is the primary gate for success or failure.
import os
import requests
from datetime import datetime, timedelta
COASTY_API_KEY = os.getenv("COASTY_API_KEY")
BASE_URL = "https://coasty.ai/v1"
# Example: launch a v3 guided task run
def create_task_run_v3():
payload = {
"machine_id": "your-machine-id",
"task": "Open the browser, go to https://coasty.ai/docs, and scroll to the bottom of the page.",
"cua_version": "v3",
"max_steps": 20,
"deadline_seconds": 300,
"on_awaiting_human": "pause",
"system_prompt": "You are a helpful assistant that follows user instructions carefully."
}
resp = requests.post(
f"{BASE_URL}/runs",
json=payload,
headers={"X-API-Key": COASTY_API_KEY}
)
resp.raise_for_status()
return resp.json()
def create_task_run_v4():
payload = {
"machine_id": "your-machine-id",
"task": "Open the browser, go to https://coasty.ai/docs, and scroll to the bottom of the page.",
"cua_version": "v4"
}
resp = requests.post(
f"{BASE_URL}/runs",
json=payload,
headers={"X-API-Key": COASTY_API_KEY}
)
resp.raise_for_status()
return resp.json()
# Example: stream events for a v3 run
def stream_events(run_id):
url = f"{BASE_URL}/runs/{run_id}/events"
headers = {"X-API-Key": COASTY_API_KEY}
with requests.get(url, headers=headers, stream=True) as r:
r.raise_for_status()
for line in r.iter_lines():
if line:
print(line.decode())How to inspect and control a v3 run
- Use GET /v1/runs to list runs and GET /v1/runs/{id} to inspect details. For a v3 run, you can cancel it with POST /v1/runs/{id}/cancel and resume it with POST /v1/runs/{id}/resume.
- The events stream shows each step, the model's actions, and status updates. This makes it easy to debug or inject human approval decisions via on_awaiting_human.
- You can also mix vision actions by looping capture and predict with POST /v1/predict (cost $0.05) while the run is in progress, which lets you combine guided and raw vision steps in a single workflow.
When to pick v3 vs v4
- Pick v3 when you need to review actions, inject custom instructions, or handle edge cases that require human judgment. Use on_awaiting_human to pause and collect input, then resume.
- Pick v4 when you want to offload the entire task to the server with a built-in verifier. This is ideal for batch jobs where you only care about succeed or fail results.
- Both versions are billed at $0.05 per agent step in task runs. Choose the version that matches your control requirements and let the server drive the computer use agent accordingly.
CUA v3 for guided control; CUA v4 for autonomous verification.
Where computer use beats brittle automation
Traditional automation relies on fragile selectors and fixed API endpoints. A computer use agent sees the screen and acts like a human, so it can adapt to UI changes, missing elements, or layout shifts. This makes it far more robust for real-world environments where selectors break or APIs evolve.
Now you know when to use v3 for guided control and v4 for autonomous verification. To start building with the Coasty Computer Use API, get a key at https://coasty.ai/developers .
Want to see this in action?
View Case Studies