Back to Blog
Guide

Emily Watson7 min
Ctrl+A

You want a computer use agent that can click, type, and scroll like a human. You need a clear picture of what each operation costs. Coasty exposes a computer use API at https://coasty.ai/v1. Every endpoint has a fixed price. No surprise bills. No hidden per-second charges. This post lists every endpoint, the exact cost, and a working example you can run today.

Core pricing model

  • Coasty bills on a prepaid USD wallet. 1 credit equals $0.01.
  • Task runs are billed $0.05 per agent step.
  • Vision prediction during a session is $0.05 per call.
  • Stateful session prediction is $0.04 per call.
  • Grounding a screenshot to coordinates costs $0.03.
  • Parse is free and converts pyautogui code into structured actions.
  • You must provide an API key via X-API-Key or Authorization: Bearer header.
  • Use the COASTY_API_KEY environment variable. Never hardcode keys.

Vision endpoint

  • POST /v1/predict charges $0.05.
  • Request body includes a base64 screenshot, instruction, and cua_version.
  • Response returns actions and a status.
  • Loop capture, predict, and act until status is done.
bash
#!/bin/bash
# This example calls /v1/predict with a base64 screenshot, reads COASTY_API_KEY from env.
# Replace ${SCREENSHOT_BASE64} with a real base64 screenshot string.

SCREENSHOT_BASE64="$1"
INSTRUCTION="Click the login button in the top right corner and type '[email protected]'"

curl -s https://coasty.ai/v1/predict \
  -H "X-API-Key: ${COASTY_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "{\"screenshot\": \"${SCREENSHOT_BASE64}\", \"instruction\": \"${INSTRUCTION}\", \"cua_version\": \"v3\"}"

Stateful session endpoint

  • POST /v1/sessions costs $0.10 per session creation.
  • POST /v1/sessions/{id}/predict costs $0.04 per prediction.
  • Sessions store trajectory memory between calls.
  • Use sessions when you need continuity across multiple steps.
python
import os
import requests
import json

BASE = "https://coasty.ai/v1"
API_KEY = os.getenv("COASTY_API_KEY")

# 1. Create a session
resp = requests.post(
    f"{BASE}/sessions",
    headers={"X-API-Key": API_KEY},
    json={"cua_version": "v3"},
)
session = resp.json()
print("Session ID:", session["id"])

# 2. Predict with the session
resp = requests.post(
    f"{BASE}/sessions/{session['id']}/predict",
    headers={"X-API-Key": API_KEY},
    json={"instruction": "Click the search bar and type 'hello'"},
)
pred = resp.json()
print("Actions:", pred["actions"])

# 3. Cancel the session when done
requests.post(
    f"{BASE}/sessions/{session['id']}/cancel",
    headers={"X-API-Key": API_KEY},
)

Task runs are $0.05 per agent step, billed automatically after each step.

Task runs endpoint

  • POST /v1/runs starts a task run on a machine_id.
  • Provide task, cua_version (default v3, v4 is autonomous with a pass/fail verifier), and optional instructions.
  • You can set system_prompt, max_steps, deadline_seconds, on_awaiting_human, and webhook_url.
  • GET /v1/runs lists all runs.
  • GET /v1/runs/{id} returns run details.
  • POST /v1/runs/{id}/cancel cancels a run.
  • POST /v1/runs/{id}/resume resumes a paused run.
  • GET /v1/runs/{id}/events streams Server-Sent Events; reconnect with Last-Event-ID.
  • Run states include queued, running, awaiting_human, succeeded, failed, cancelled, and timed_out.
bash
#!/bin/bash
# Start a task run with POST /v1/runs. Replace MACHINE_ID and COASTY_API_KEY.

MACHINE_ID="your_machine_id"
TASK="Open Chrome, navigate to example.com, click the first link, and verify the title includes 'example'"

curl -s https://coasty.ai/v1/runs \
  -H "X-API-Key: ${COASTY_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "{\
    \"machine_id\": \"${MACHINE_ID}\", \
    \"task\": \"${TASK}\", \
    \"cua_version\": \"v3\", \
    \"max_steps\": 20\
  }"

Workflows endpoint

  • POST /v1/workflows creates a versioned JSON DSL of runs.
  • POST /v1/workflows/{id}/runs executes a workflow run.
  • POST /v1/workflows/runs runs an ad-hoc inline workflow.
  • Step types include task, assert, if, loop, parallel, human_approval, retry, succeed, and fail.
  • Conditions are structured objects. Variables use double-brace inputs.x and stepId.field.
  • Guard parameters like budget_cents, max_iterations, and deadline_seconds enforce limits.
  • Task steps inside workflows also cost $0.05 each.

Machines endpoint

  • POST /v1/machines provisions a cloud VM.
  • You can start, stop, and snapshot machines.
  • The agent drives real desktops, browsers, and terminals, not just API calls.

Grounding endpoint

  • POST /v1/ground maps a screenshot plus element description to x,y coordinates.
  • Cost: $0.03 per call.
  • Use this when you need precise element locations from a visual context.
bash
#!/bin/bash
# Ground an element using POST /v1/ground. Replace SCREENSHOT_BASE64 and COASTY_API_KEY.

SCREENSHOT_BASE64="$1"
DESCRIPTION="The login button in the top right corner"

curl -s https://coasty.ai/v1/ground \
  -H "X-API-Key: ${COASTY_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "{\
    \"screenshot\": \"${SCREENSHOT_BASE64}\", \
    \"description\": \"${DESCRIPTION}\"\
  }"

Parse endpoint

  • POST /v1/parse is free.
  • It turns pyautogui code into structured actions.
  • Use this to generate repeatable action sequences from manual scripts.

Where this beats brittle automation

  • Computer use agents see the screen and act like a human, unlike brittle selectors that break when layouts change.
  • API-only tools often require brittle XPath, CSS selectors, or hardcoded coordinates.
  • Coasty agents can handle dynamic UIs, overlapping elements, and non-standard layouts.
  • You can automate desktop apps, browsers, and terminals with the same endpoint and predictable per-step cost.
  • Task runs and workflows let you orchestrate multi-step workflows with built-in retry, conditional logic, and human approval.

You now know every Coasty endpoint and its exact cost. You can start a task run for $0.05 per step, use stateful sessions for continuity, or build workflows with structured conditions. The computer use API gives you a clear, developer-friendly way to build agents that see and act like humans. Get your API key at https://coasty.ai/developers and start building.

© 2026 Coasty

Backed byYCombinator