Back to Blog
Guide

Alex Thompson9 min
Pg Up

You have a manual workflow that clicks, types, and waits. Building it with selectors or an API-only wrapper means brittle selectors and endless maintenance. The Coasty computer use API replaces fragile selectors with a model that sees the screen and acts like a human. You start with a prototype, then promote to managed task runs and workflows on real desktops.

How it works

The computer use API runs an agent on a real desktop. It captures a screenshot, predicts an action, executes it, and repeats until the task finishes. For stateful memory you use sessions with POST /v1/sessions, then POST /v1/sessions/{id}/predict for loop iterations. Task runs are the server-driven path: POST /v1/runs to start, then GET /v1/runs/{id}/events to stream events. You pay $0.05 per agent step for runs, $0.04 per predict for sessions, and $0.03 for ground (screen to x,y). Vision calls are $0.05 each.

bash
# Build a prototype: start a task run with a simple instruction
COASTY_API_KEY=$(cat ~/.coasty/key) 
curl -s https://coasty.ai/v1/runs \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "vm-12345678",
    "task": "Open Chrome, go to https://example.com, and take a screenshot",
    "cua_version": "v3",
    "max_steps": 20,
    "deadline_seconds": 300,
    "on_awaiting_human": "pause"
  }' | jq .

Track runs in production

Use GET /v1/runs to list recent runs and GET /v1/runs/{id}/events to stream progress. Events include queued, running, awaiting_human, succeeded, failed, cancelled, timed_out. You can cancel or resume a run with POST /v1/runs/{id}/cancel and POST /v1/runs/{id}/resume. Webhook_url lets you push final state to your system. All runs are billed $0.05 per agent step.

Workflow DSL for complex pipelines

Workflows are a versioned JSON DSL that chains steps. Task steps are billed $0.05 each. You can nest loops, conditionals, parallel tasks, retries, and human approvals. Variables like {{inputs.x}} and stepId.field are resolved at runtime. Hard guards include budget_cents, max_iterations, and deadline_seconds. POST /v1/workflows creates a workflow, then POST /v1/workflows/{id}/runs or POST /v1/workflows/runs executes it.

Stateful sessions for long-running agents

For agents that need memory across steps, use sessions. POST /v1/sessions creates a session with an ID. Then loop POST /v1/sessions/{id}/predict with a screenshot, instruction, and cua_version. Each predict costs $0.04 and returns actions plus a status. Use this for multi-step explorations, UI navigation, and multi-VM workflows.

POST /v1/runs lets you start a production agent with $0.05 per step and stream events to your frontend.

Where this beats brittle automation

The computer use API drives real desktops, browsers, and terminals. It does not rely on static selectors or hard-coded API paths. The model sees the screen, understands layout changes, and adapts to different UI versions. This means fewer flaky tests, less maintenance on UI refactorings, and faster iteration on prototypes. You can prototype with sessions, then scale to managed task runs for automated pipelines.

Start with a prototype task run to prove the workflow on a real desktop. Once stable, promote to workflows for multi-step pipelines and sessions for memory-heavy agents. Get your API key at https://coasty.ai/developers and build production-grade computer use agents today.

© 2026 Coasty

Backed byYCombinator