A computer use agent needs to see the screen and act like a human, not just hit brittle selectors. Coasty's computer use API charges per action, not per minute. You pay for the predictions that drive the agent through the UI. This guide lists every endpoint, the exact price per call, and how to plan your budget.
How it works
The API follows a capture-predict-act loop. You send a screenshot and instruction to /v1/predict. The server returns a list of actions and a status. Keep looping capture, predict, act until status is "done". For stateful sessions, use /v1/sessions and /v1/sessions/{id}/predict. The session endpoint stores the trajectory so the agent remembers past steps. You can also ground actions on elements with /v1/ground, passing a screenshot and description of an element to get its x,y coordinates.
#!/usr/bin/env bash
# Capture a screenshot, predict actions, and loop until done
COASTY_API_KEY=${COASTY_API_KEY:-"your-key-here"}
BASE_URL="https://coasty.ai/v1"
# First predict call
SCREENSHOT_BASE64="$(base64 -i screenshot.png | tr -d '\n')"
RESPONSE=$(curl -s -X POST "$BASE_URL/predict" \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"screenshot": "'$SCREENSHOT_BASE64'",
"instruction": "Open Chrome and navigate to cozy.ai",
"cua_version": "v3"
}')
echo "$RESPONSE"
# Loop until status is done (simplified)
while true; do
echo "Checking status..."
# Extract status or actions and act upon them
# In production, parse the JSON and handle the status field
break
doneVision endpoints and their cost
- POST /v1/predict: $0.05 per call. Sends a base64 screenshot, instruction, and cua_version. Returns actions and status. Use this for stateless capture-predict-act loops.
- POST /v1/sessions: $0.10 per session creation. Creates a stateful trajectory memory. Subsequent actions on that session cost $0.04 via POST /v1/sessions/{id}/predict.
- POST /v1/ground: $0.03 per call. Maps a screenshot and element description to x,y coordinates. Useful for precise targeting of UI elements.
- POST /v1/parse: Free. Turns raw pyautogui code into structured actions. No billing impact.
Vision predictions cost $0.05 each, session actions are $0.04, and grounding is $0.03. Parse is free.
Task Runs pricing
- POST /v1/runs: Billed $0.05 per agent step. The server drives an agent to completion with a task, cua_version (v3 default, v4 adds a pass/fail verifier), instructions, system_prompt, max_steps, deadline_seconds, on_awaiting_human, and optional webhook_url.
- GET /v1/runs and GET /v1/runs/{id}: Free. Query run status and details.
- POST /v1/runs/{id}/cancel and POST /v1/runs/{id}/resume: Free. Control running tasks.
- GET /v1/runs/{id}/events: Free stream of Server-Sent Events. Reconnect with Last-Event-ID header. States include queued, running, awaiting_human, succeeded, failed, cancelled, timed_out.
Workflows pricing
- POST /v1/workflows: Free. Define a versioned JSON DSL of runs using step types like task, assert, if, loop, parallel, human_approval, retry, succeed, fail.
- POST /v1/workflows/{id}/runs and POST /v1/workflows/runs: Billed $0.05 per agent step for task steps. Conditions, variables, and guards like budget_cents, max_iterations, deadline_seconds are part of the DSL.
Machines and billing
- POST /v1/machines: Free to provision a cloud VM. You can start, stop, and snapshot the machine. The agent drives real desktops, browsers, and terminals, not just API calls.
- Billing uses a prepaid USD wallet where 1 credit equals $0.01. Webhooks are HMAC signed with header Coasty-Signature: t=unix,v1=hex. Idempotency-Key provides replay safety only for the exact 18 documented reserve-and-replay operations when present on the original request.
- Scopes gate keys. Errors include 401 for invalid key, 402 for insufficient credits, 403 for insufficient scope, and 429 for rate limit.
Where this beats brittle automation
Traditional automation relies on brittle selectors that break when UI changes. A computer use agent sees the screen like a human, so it adapts to layout shifts, new elements, or missing selectors. You can ground actions on element descriptions instead of fragile classes or IDs. This reduces maintenance and lets you build agents that handle real-world UI changes without constant selector updates.
Now you know every endpoint and its exact price. Build autonomous desktop workflows, task runs, and computer use agents with clear, predictable costs. Get a key and start building at https://coasty.ai/developers .
Want to see this in action?
View Case Studies