You finish a quick browser task with a few curl calls. Then you move to production and hit walls. UI layout changes, pop-ups, and hidden elements break your hardcoded selectors. You need an agent that sees the screen and acts like a human. The Coasty computer use API gives you that. It lets you drive real desktops, browsers, and terminals through vision. You can start with a prototype that calls /v1/predict, then graduate to stateful sessions, task runs, and full workflows. All billed at clear prices. No magic. No fluff.
How it works
The core loop is simple. Capture a screenshot, send it to /v1/predict with an instruction and cua_version, and act on the returned actions. When the status is done, the task finishes. For more memory, use /v1/sessions to keep trajectory, then POST /v1/sessions/{id}/predict. To click exactly where you see, use /v1/ground: send a base64 screenshot and an element description, get back x,y coordinates. For pipelines, POST /v1/runs with machine_id, task, cua_version, optional instructions, system_prompt, max_steps, deadline_seconds, on_awaiting_human, and webhook_url. The server drives the agent step by step. Each step costs $0.05. States are queued, running, awaiting_human, succeeded, failed, cancelled, timed_out. Workflows are versioned JSON DSLs with tasks, asserts, if, loop, parallel, human_approval, retry, succeed, fail, and variables like {{inputs.x}} or stepId.field.
#!/bin/bash
COASTY_API_KEY="${COASTY_API_KEY}"
BASE_URL="https://coasty.ai/v1"
SCREENSHOT="$(base64 -i screenshot.png)"
curl -s -X POST "${BASE_URL}/v1/predict" \
-H "X-API-Key: ${COASTY_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"screenshot":"'"${SCREENSHOT}"'",
"instruction":"Find and click the search button",
"cua_version":"v3"
}' | jq '.'Provision a machine for production runs
- POST /v1/machines with machine_id, os_family, os_version, region, and timeout_seconds to create a cloud VM.
- The agent drives this real desktop, not a mock environment.
- You can start, stop, and snapshot machines from the API.
- Use the machine_id in later /v1/runs requests to target that environment.
Use machine_id from /v1/machines in POST /v1/runs to target a real desktop environment.
Where this beats brittle automation
Standard automation relies on selectors, XPath, and brittle IDs that break when layouts change or pages are dynamic. Coasty gives you a computer use agent that sees the screen and acts like a human. It handles UI changes, pop-ups, and hidden elements without you rewriting selectors. You can drive browsers, terminals, and desktop apps through natural language instructions. Workflows let you orchestrate tasks, asserts, loops, and parallel steps with a JSON DSL, all billed step by step. Vision plus real environment control means fewer edge cases and faster iteration.
Manage runs and workflows at scale
- GET /v1/runs lists all runs. GET /v1/runs/{id} shows details and events.
- POST /v1/runs/{id}/cancel stops a running task. POST /v1/runs/{id}/resume restarts after pause.
- GET /v1/runs/{id}/events streams Server-Sent Events with Last-Event-ID for reconnection.
- POST /v1/workflows creates a versioned workflow DSL. POST /v1/workflows/{id}/runs and POST /v1/workflows/runs execute them.
- Use on_awaiting_human to pause, fail, or cancel when the agent needs human input.
- Set max_steps and deadline_seconds to control runtime and cost.
You can prototype with /v1/predict, scale with /v1/sessions and /v1/runs, and orchestrate complex pipelines with /v1/workflows. All backed by real desktops and billed at $0.05 per step. Ready to build? Get your key at https://coasty.ai/developers.
Want to see this in action?
View Case Studies