Back to Blog
Guide

Daniel Kim6 min
+K

When you build a computer use agent, cost is not an afterthought. Every API call, every prediction, every step of a task run adds up. You need to know exactly what you pay for and how much each operation costs. The Coasty computer use API is transparent. Below is a complete breakdown of every endpoint, its purpose, and its price, so you can budget automatically and scale with confidence.

Vision endpoints: predict and ground

The vision endpoints let you send a base64 screenshot to the model with instructions and get actions back. You can also map visual descriptions to x,y coordinates. These are billed per call.

bash
curl https://coasty.ai/v1/predict \
  -H 'X-API-Key: $COASTY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "screenshot": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
    "instruction": "Click the button labeled Submit",
    "cua_version": "v3"
  }'

POST /v1/predict costs $0.05 per call.

Session-based vision: predict with stateful trajectory

Use sessions to keep a trajectory in memory. You create a session, then send predictions with a lower per-call price. This is useful when you need to remember past actions across frames.

python
import os, base64, requests, json

def predict_with_session():
    api_key = os.environ.get('COASTY_API_KEY')
    headers = {'X-API-Key': api_key, 'Content-Type': 'application/json'}
    # 1. Create a session
    resp = requests.post('https://coasty.ai/v1/sessions', headers=headers, json={})
    session = resp.json()
    session_id = session['id']
    # 2. Predict within the session
    payload = {
        'screenshot': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==',
        'instruction': 'Click the button labeled Submit',
        'cua_version': 'v3'
    }
    resp = requests.post(f'https://coasty.ai/v1/sessions/{session_id}/predict', headers=headers, json=payload)
    return resp.json()

result = predict_with_session()
print(json.dumps(result, indent=2))

POST /v1/sessions costs $0.10 and POST /v1/sessions/{id}/predict costs $0.04 per call.

Grounding: map screenshots to element coordinates

POST /v1/ground maps a screenshot and an element description to x,y coordinates. This is billed $0.03 per call and helps you find interactive targets reliably.

bash
curl https://coasty.ai/v1/ground \
  -H 'X-API-Key: $COASTY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "screenshot": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
    "description": "The submit button"
  }'

POST /v1/ground costs $0.03 per call.

Task Runs: the server drives an agent to completion

Task Runs let you offload an entire task to an agent. You POST /v1/runs with machine_id, task, cua_version, instructions, system_prompt, max_steps, deadline_seconds, and on_awaiting_human. You are billed $0.05 per agent step. You can poll or stream events.

bash
curl https://coasty.ai/v1/runs \
  -H 'X-API-Key: $COASTY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "machine_id": "vm-123",
    "task": "Open Chrome and navigate to example.com",
    "cua_version": "v4",
    "max_steps": 30,
    "deadline_seconds": 300,
    "on_awaiting_human": "pause",
    "webhook_url": "https://your-domain.com/webhook"
  }'

Task Run states and HTTP endpoints

Task Runs have states: queued, running, awaiting_human, succeeded, failed, cancelled, timed_out. You can list, get, cancel, and resume runs. These operations are free.

bash
# List runs
curl https://coasty.ai/v1/runs -H 'X-API-Key: $COASTY_API_KEY'

# Get a specific run
curl https://coasty.ai/v1/runs/abc123 -H 'X-API-Key: $COASTY_API_KEY'

# Cancel a run
curl -X POST https://coasty.ai/v1/runs/abc123/cancel \
  -H 'X-API-Key: $COASTY_API_KEY'

# Resume a run
curl -X POST https://coasty.ai/v1/runs/abc123/resume \
  -H 'X-API-Key: $COASTY_API_KEY'

Workflows: versioned JSON DSL of runs

Workflows let you encode a sequence of steps as a versioned JSON DSL. You can POST /v1/workflows, /v1/workflows/{id}/runs, or inline /v1/workflows/runs. Steps include task, assert, if, loop, parallel, human_approval, retry, succeed, fail, with conditions, variables, budget_cents, max_iterations, and deadline_seconds. Task steps are billed $0.05 each.

python
import os, json, requests

def create_workflow():
    api_key = os.environ.get('COASTY_API_KEY')
    headers = {'X-API-Key': api_key, 'Content-Type': 'application/json'}
    workflow = {
        "name": "example-workflow",
        "version": "1.0",
        "steps": [
            {
                "type": "task",
                "task": "Open Chrome and navigate to example.com"
            },
            {
                "type": "assert",
                "condition": {
                    "field": "title",
                    "operator": "contains",
                    "value": "Example Domain"
                }
            },
            {
                "type": "succeed"
            }
        ],
        "budget_cents": 100,
        "max_iterations": 10,
        "deadline_seconds": 300
    }
    resp = requests.post('https://coasty.ai/v1/workflows', headers=headers, json=workflow)
    return resp.json()

workflow = create_workflow()
print(json.dumps(workflow, indent=2))

Machines: provision cloud VMs for real desktops

POST /v1/machines provisions a cloud VM you can start, stop, and snapshot. The agent can drive real desktops, browsers, and terminals, not just API calls. This operation is free.

bash
curl https://coasty.ai/v1/machines \
  -H 'X-API-Key: $COASTY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "my-agent-vm",
    "os": "linux",
    "size": "small"
  }'

Billing and configuration

Billing uses a prepaid USD wallet where 1 credit equals $0.01. Webhooks are HMAC signed with header Coasty-Signature: t=unix,v1=hex. Keys are scoped and read from COASTY_API_KEY environment variable. Idempotency-Key provides replay safety only for the 18 documented reserve-and-replay operations when present on the original request.

Where computer use beats brittle automation

Traditional automation relies on fragile selectors and API mocks. A computer use agent sees the screen, understands context, and acts like a human. It handles layout changes, dynamic content, and UI variations without hard-coded selectors. This makes it far more resilient and easier to maintain at scale.

With transparent pricing for every endpoint you can model costs into your software from day one. Build reliable computer use agents, automate complex workflows, and scale without surprises. Get your key at https://coasty.ai/developers and start coding with confidence.

© 2026 Coasty

Backed byYCombinator