Guide

From Prototype to Production With the Coasty Computer Use API

James Liu||10 min
Ctrl+F

Automating software used to mean writing brittle selectors, parsing HTML, or hoping API endpoints stay stable. Now you can build agents that see the screen and act like humans. The Coasty computer use API lets you move from a quick prototype to a production-ready automation system without rewriting core logic each time. This guide shows how.

How it works

The Coasty API provides two main entry points. For a simple task, POST /v1/predict runs a one-shot computer use cycle. It takes a base64 screenshot, an instruction string, and the cua_version. The endpoint returns actions and a status field (like done or processing). You loop capture, predict, act until the status is done. For longer-running agents with memory, create a session with POST /v1/sessions, then repeatedly call /v1/sessions/{id}/predict. The task runs API, POST /v1/runs, drives an agent to completion using a machine_id and task, billing $0.05 per agent step. Stateful workflows are defined as a versioned JSON DSL and launched via POST /v1/workflows or POST /v1/workflows/{id}/runs. Step types include task, assert, if, loop, parallel, human_approval, retry, succeed, and fail. You can also ground elements with POST /v1/ground (screenshot + element description to x,y) and turn pyautogui code into structured actions with POST /v1/parse.

bash
curl https://coasty.ai/v1/predict \
   -H 'X-API-Key: $COASTY_API_KEY' \
   -H 'Content-Type: application/json' \
   -d '{
     "screenshot": "$(base64 -i screenshot.png)",
     "instruction": "Click the first button that says OK",
     "cua_version": "v3"
   }'

Prototype: quick one-shot tasks

  • Set up your environment and get a key from https://coasty.ai/developers.
  • Read the key from COASTY_API_KEY instead of hardcoding it.
  • Upload a screenshot, send an instruction, and get actions.
  • Loop until status is done. Each predict costs $0.05.

Use POST /v1/predict for single-round tasks.

Scale to workflows

  • Define a versioned JSON DSL with POST /v1/workflows.
  • Launch workflows with POST /v1/workflows/{id}/runs or POST /v1/workflows/runs for ad-hoc inline workflows.
  • Step types task, assert, if, loop, parallel, human_approval, retry, succeed, and fail let you orchestrate complex flows.
  • Configure budget_cents, max_iterations, and deadline_seconds as hard guards.
  • Each task step bills $0.05.

Where this beats brittle automation

Coasty agents see the screen, read text, and react to layout changes. That means fewer selectors to maintain and fewer updates when UIs evolve. Grounding with POST /v1/ground lets you map text descriptions to coordinates, so you operate on what the agent perceives. The parse endpoint turns raw pyautogui code into structured actions, giving you a clean, versioned automation definition. With machine_id support, agents run on real desktops, browsers, and terminals, not just API-only tools. You can track stateful trajectories with sessions, pause for human approval, and integrate with webhooks and idempotency keys for replay safety.

Start with a quick prototype using POST /v1/predict, then move to stateful sessions and full workflows. Build agents that see and act like humans, not scripts. Get your API key at https://coasty.ai/developers and start shipping production computer use agents.

Want to see this in action?

View Case Studies
Try Coasty Free