Most computer use agents need a model that suits their workflow. The Coasty Computer Use API offers two distinct options for the cua_version parameter. v3 lets you own each step with predict calls and control the loop. v4 runs autonomously and returns pass/fail results after each agent step. Knowing the right choice saves you money and engineering effort.
How to pick cua_version
- Use cua_version=v3 when you want to manage prediction loops, handle errors, and integrate with external systems.
- Use cua_version=v4 when you want the server to drive the agent to completion with automatic pass/fail verification.
- Both versions are billed at $0.05 per agent step inside a POST /v1/runs request.
- v4 adds built-in verification so you can focus on high‑level logic instead of retry loops.
- v3 leaves stateful trajectory memory to your application via /v1/sessions/{id}/predict.
Pick v3 for full control over each step. Pick v4 for autonomous verification.
v3: manual step control
- You start a task run with cua_version=v3.
- The task runs in steps. Each step is billed $0.05.
- You monitor events via GET /v1/runs/{id}/events for state changes.
- You can cancel and resume runs with POST /v1/runs/{id}/cancel and POST /v1/runs/{id}/resume.
- Great for complex workflows that need human approval, custom error handling, or integration with other systems.
v4: autonomous verification
- Set cua_version=v4 to let the agent complete tasks without manual intervention.
- The agent runs to completion and returns a final pass/fail result.
- You receive events for each agent step and a final state like succeeded or failed.
- This speeds up development when your goal is success or failure.
- You can still add instructions, system_prompt, and a deadline_seconds to guide the agent.
import os
import requests
import json
def start_run_v4():
url = "https://coasty.ai/v1/runs"
api_key = os.getenv("COASTY_API_KEY")
headers = {"Authorization": f"Bearer {api_key}"}
payload = {
"machine_id": "your_machine_id",
"task": "Open Chrome and navigate to cozy.ai",
"cua_version": "v4",
"instructions": "Verify that the page loads successfully.",
"system_prompt": "You are a helpful assistant that controls the desktop.",
"max_steps": 20,
"deadline_seconds": 300,
"on_awaiting_human": "pause"
}
resp = requests.post(url, headers=headers, json=payload)
resp.raise_for_status()
run = resp.json()
print("Run ID:", run["id"])
print("State:", run["state"])
return run
def list_runs():
url = "https://coasty.ai/v1/runs"
api_key = os.getenv("COASTY_API_KEY")
headers = {"Authorization": f"Bearer {api_key}"}
resp = requests.get(url, headers=headers)
resp.raise_for_status()
runs = resp.json()
print("Runs:", json.dumps(runs, indent=2))
if __name__ == "__main__":
start_run_v4()
list_runs()Where this beats brittle automation
Traditional automation relies on brittle selectors, static APIs, and fragile schedules. With computer use, the agent sees the screen and acts like a human. It can handle layout changes, dynamic elements, and multi‑step workflows that would require constant maintenance. v3 gives you the flexibility to intervene at any point. v4 gives you fast, automated verification. Both reduce the cost of maintenance and let you ship agents that adapt to real UI changes.
Pick the cua_version that matches your workflow. v3 for manual control and custom logic. v4 for autonomous verification and faster iteration. Ready to build smarter agents? Get a key at https://coasty.ai/developers.
Want to see this in action?
View Case Studies