Guide

Coasty Computer Use API Pricing: Every Endpoint, Every Cent

Emily Watson||6 min
Ctrl+C

Most UI automation tools charge by the click or rely on fragile selectors. The Coasty computer use API bills by the step and by the endpoint, with no hidden per-minute fees. You pay only for what your agent actually sees and does. This guide lists every endpoint, the exact price per call, and how to track spending in real time.

Core Computer Use Endpoints

  • Base URL: https://coasty.ai/v1
  • Auth header: X-API-Key or Authorization: Bearer (read from COASTY_API_KEY environment variable)
  • POST /v1/predict ($0.05) takes a base64 screenshot, instruction, and cua_version, returns actions and status
  • POST /v1/sessions ($0.10) creates a stateful session, then POST /v1/sessions/{id}/predict ($0.04) for trajectory memory
  • POST /v1/ground ($0.03) maps a screenshot and element description to x,y coordinates
  • POST /v1/parse is free and converts pyautogui code into structured actions

How POST /v1/predict works

You send a screenshot as base64, a natural language instruction, and the cua_version (v3 or v4). The endpoint returns a list of actions (click, type, scroll, etc.) and a status. Loop capture-screen, predict, act until status is done. This is the simplest entry point for a computer use agent.

python
import base64, os, requests, time

API_KEY = os.getenv("COASTY_API_KEY")
BASE = "https://coasty.ai/v1"
HEADERS = {"X-API-Key": API_KEY, "Content-Type": "application/json"}

# Step 1: Capture a screenshot and encode as base64
with open("screen.png", "rb") as f:
    img_b64 = base64.b64encode(f.read()).decode()

def predict(instruction, cua_version="v3"):
    resp = requests.post(
        f"{BASE}/predict",
        headers=HEADERS,
        json={"screenshot": img_b64, "instruction": instruction, "cua_version": cua_version}
    )
    resp.raise_for_status()
    data = resp.json()
    return data.get("actions", []), data.get("status")

# Simple loop: capture, predict, act until done
while True:
    actions, status = predict("Click the login button")
    if actions:
        for act in actions:
            print("Action", act)
    if status in ("done", "failed", "cancelled"):
        break
    time.sleep(0.5)

Task Runs and Stateful Sessions

  • POST /v1/runs ($0.05 per agent step) drives an agent to completion with machine_id, task, cua_version, instructions, system_prompt, max_steps, deadline_seconds, on_awaiting_human (pause/fail/cancel), and optional webhook_url
  • GET /v1/runs lists runs, GET /v1/runs/{id} gets a specific run
  • POST /v1/runs/{id}/cancel stops a run, POST /v1/runs/{id}/resume resumes after pausing
  • GET /v1/runs/{id}/events streams Server-Sent Events; reconnect with Last-Event-ID
  • States: queued, running, awaiting_human, succeeded, failed, cancelled, timed_out

Billed $0.05 per agent step for Task Runs, including autonomous mode with pass/fail verifier (cua_version="v4").

Workflows and Variables

  • POST /v1/workflows defines a versioned JSON DSL of runs using step types: task, assert, if, loop, parallel, human_approval, retry, succeed, fail
  • Variables like {{inputs.x}} and stepId.field enable referencing inputs and intermediate results
  • Hard guards: budget_cents, max_iterations, deadline_seconds
  • Task steps inside workflows are billed $0.05 each

Where this beats brittle automation

Selecting a button by class name or XPath breaks when a product changes classes. A computer use agent sees the screen and acts on visual signals, reproducing human behavior. This makes UI bots resilient to layout shifts, dynamic content, and dark pattern changes. Combine this with Coasty workflows to orchestrate complex multi-step flows without managing separate scripts.

You now have the full list of Coasty endpoints and exact costs. Start building a robust computer use agent today. Get your API key at https://coasty.ai/developers.

Want to see this in action?

View Case Studies
Try Coasty Free