logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·01.11.26
← Back to news

Launch HN: Coasty (YC S26) – An API for computer-use agents

Original article
coasty.ai|18 points|0 comments|by nkov47|Jul 15, 2026

Launch HN: Coasty (YC S26) – An API for computer-use agents

Welcome to the Coasty API, a powerful interface designed to execute autonomous tasks on managed virtual machines. Whether you want to orchestrate complex workflows or maintain granular control via prediction primitives, Coasty provides the infrastructure to make AI agents actually work on a computer.

[!TIP] Building with an AI assistant? Check out the llms.txt reference to generate optimized prompts for tools like Claude Code, Cursor, or ChatGPT.


🚀 Getting Started: The Automation Hierarchy

Coasty offers different levels of abstraction depending on how much control you need. You can start at the highest level and "drop down" to lower primitives as your requirements become more specific.

Primary Automation Levels

  • Task Runs: A single goal driven to completion autonomously.
  • Workflows: A programmatic collection of multiple tasks (includes branching and loops).
  • Machines: Managed Linux or Windows environments providing the browser, terminal, and filesystem.

Low-Level Primitives (Manual Execution)

If you prefer to own the control loop, use these stateless/stateful tools:

  1. predict: A single stateless step.
  2. sessions: A stateful loop for screenshots.
  3. ground: Used to find specific screen coordinates.
  4. parse: Converts code into executable actions.

Choosing Your Entry Point

Start WithUse it when...
Task RunsYou have one goal that needs to be autonomously verified as "done."
WorkflowsYou need sequencing, budgets, human-in-the-loop approvals, or branching logic.
MachinesYou specifically need a managed OS (Windows/Linux) with a browser and shell.
PrimitivesYour app must control every single screenshot and prediction manually.

🔐 Authentication & Billing

All requests are sent via standard HTTPS to https://coasty.ai/v1.

API Key Management

You must include your secret key in every authenticated request. While Authorization: Bearer <key> is supported, the canonical method is the X-API-Key header.

⚠️ Critical Warning: X-API-Key: Bearer sk-coasty-live-xxx ←\leftarrow← Do not do this. Including the word "Bearer" inside the X-API-Key header is a common error that results in a 401 INVALID_API_KEY response.

Security Best Practices:

  • Store keys in environment variables.
  • Keep keys server-side.
  • Never commit keys to version control or expose them in client-side JS.

Key Types & Behavior

PrefixKindBehavior
sk-coasty-live-LiveExecutes real models; deducts from your USD wallet.
sk-coasty-test-TestUses mock VMs; $0 cost; identical request/response shapes for CI/CD.

The Billing Logic

Coasty uses a "charge-then-refund" model to ensure reliability.

  • Pre-charge: Every billed call is charged before the model runs.
  • Automatic Refund: If a 5xx error occurs, the charge is reversed.
  • Verification: Check the X-Credits-Refunded header to confirm a refund.
  • Short-circuit: 401, 403, or 402 errors occur before any charges are applied.

🛠️ Running Your First Task

To launch an autonomous agent, follow this checklist:

  • Obtain a test key from the API dashboard.
  • Provision or select a machine_id.
  • Set your environment variable: export COASTY_API_KEY=sk-coasty-test-your_key.
  • Execute a POST /v1/runs request.

Implementation Example (Python)

import os, time, requests

BASE = "https://coasty.ai/v1"
HEADERS = {"X-API-Key": os.environ["COASTY_API_KEY"]}
TERMINAL_STATES = {"succeeded", "failed", "cancelled", "timed_out"}

# 1. Initiate the autonomous run
payload = {
    "machine_id": "mch_test_0123456789abcdef",
    "task": "Open the billing page and download the latest invoice as PDF",
    "cua_version": "v5", # Options: v1, v3, v4, v5 (v5 is default)
    "max_steps": 40,
    "on_awaiting_human": "pause",
}

run = requests.post(
    f"{BASE}/runs", 
    headers={**HEADERS, "Idempotency-Key": "order-4821"}, 
    json=payload, 
    timeout=30
).json()

run_id = run["id"]
print(f"Initial Status: {run['status']}") # Usually 'queued'
webhook_secret = run.get("webhook_secret") # Save this for HMAC verification

# 2. Poll for completion
while True:
    run = requests.get(f"{BASE}/runs/{run_id}", headers=HEADERS, timeout=30).json()
    print(f"Status: {run['status']} | Steps: {run['steps_completed']}")
    
    if run["status"] in TERMINAL_STATES:
        break
    time.sleep(2)

print(f"Final Result: {run['result']}") 
# Returns: { "passed": bool, "status": str, "summary": str }

🔄 Understanding the Agent Loop

When you use a Task Run, Coasty manages the entire execution cycle on its backend. You don't need to manually trigger every step.

Task Run Details

  • Communication: You can track progress via polling, SSE (Server-Sent Events) for live streaming, or HMAC-signed webhooks.
  • Human Intervention: If the agent hits a wall, it can pause and wait for human takeover before resuming.
  • Cost Calculation: The cost is calculated based on the engine version used: Total Cost=Completed Steps×Price per Step\text{Total Cost} = \text{Completed Steps} \times \text{Price per Step}Total Cost=Completed Steps×Price per Step
    • v5 Engine: \0.05$ / step
    • v1 Engine (Legacy): \0.08$ / step

Coasty Workflow

Next Steps:

  • Explore Task Fields and lifecycle states.
  • Set up Streaming Events to eliminate polling.
  • Build complex Workflows for repeatable business automation.