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

Hacker News Top Products

Summary

Coasty is a new API for building computer-use agents, offering task runs, workflows, managed machines, and lower-level prediction primitives.

Hey HN, we’re Nitish and Prateek, the founders of Coasty (<a href="https:&#x2F;&#x2F;coasty.ai&#x2F;computer-use">https:&#x2F;&#x2F;coasty.ai&#x2F;computer-use</a>). We’re building computer-use agents that can complete workflows inside legacy desktop software and web applications without usable APIs.<p>Developers send Coasty a natural-language task either through our consumer app or through our API, select a machine or browser environment, and any relevant credentials or files. The agent then operates the interface through screenshots, mouse, and keyboard input, verifies the result, and returns a structured run record with screenshots, actions, outputs, and errors.<p>Here is a raw demo of an agent completing a workflow in a legacy application(It’s a mockup): <a href="https:&#x2F;&#x2F;drive.google.com&#x2F;file&#x2F;d&#x2F;1ZghU_3vsAYhHVz1bsvE0pkvZYk7OUnb1&#x2F;view?usp=sharing" rel="nofollow">https:&#x2F;&#x2F;drive.google.com&#x2F;file&#x2F;d&#x2F;1ZghU_3vsAYhHVz1bsvE0pkvZYk7...</a><p>A lot of important software is still difficult to automate. Healthcare teams submit prior authorizations through payer portals, accounting teams enter data into desktop applications, and operations teams move information between internal systems, spreadsheets, and remote desktops. Many of these applications have no API, incomplete APIs, or integrations that take months to build.<p>The usual alternative is RPA, record a sequence of clicks and replay it. That works when the interface and workflow are predictable, but it often breaks when a button moves, a pop-up appears, a page loads slowly, or the application enters an unexpected state.<p>Coasty takes a different approach. The agent observes the current screen, decides what action to take, executes it, and then observes the resulting state before continuing. It does not require DOM access, an accessibility tree, selectors, or an application-specific integration, so the same API can operate browsers, remote desktops, and older Windows applications.<p>A simplified request looks roughly like this:<p><pre><code> run = coasty.runs.create( environment=&quot;vm_123&quot;, task=&quot;&quot;&quot; Open the patient record in the billing portal. Enter the attached authorization data. Do not submit if the member ID or procedure code does not match. Return the confirmation number. &quot;&quot;&quot;, files=[&quot;authorization.pdf&quot;], approval_required=[&quot;final_submission&quot;] ) </code></pre> The response includes the final status, extracted outputs, a replay URL, and a timestamped event log:<p><pre><code> { &quot;status&quot;: &quot;completed&quot;, &quot;output&quot;: { &quot;confirmation_number&quot;: &quot;PA-184392&quot; }, &quot;replay_url&quot;: &quot;...&quot;, &quot;events&quot;: [ { &quot;type&quot;: &quot;verification&quot;, &quot;field&quot;: &quot;member_id&quot;, &quot;result&quot;: &quot;matched&quot; } ] } </code></pre> The API can also pause a run for human approval, retry from a checkpoint, or return control to the developer when it encounters a condition the workflow did not anticipate.<p>We started working on this last summer, because we saw that models were getting better at vision but kept seeing a gap between computer-use demos and the reliability needed for production workflows. Getting an agent to complete a task once is fairly straightforward. Getting it to repeat that task, recover from unexpected states, avoid silently entering incorrect data, and produce evidence of what it did is much harder.<p>We built several layers around the underlying computer-use model. The system tracks the expected state of the workflow, detects when the application has diverged from that state, and can re-plan instead of continuing blindly. Developers can define invariants such as “the patient name must match the source document” or “never submit without approval,” and the agent checks those conditions during the run.<p>Each run happens in an isolated virtual machine. We expose APIs for provisioning environments, uploading files, starting tasks, streaming events, inserting human approvals, and retrieving the full replay and audit trail. Environments can be kept alive across runs when the application has a long login flow or persistent local state.<p>One problem we are still working through is the tradeoff between speed and reliability. The agent can move faster by taking fewer observations and verification steps, but that becomes risky in workflows involving patient records, payments, or regulatory filings. We currently bias toward slower execution with more checks and let developers configure approval points and verification policies.<p>We are initially working with healthcare operations teams because their workflows combine many of the hardest conditions: payer portals, EHRs, PDFs, spreadsheets, remote desktops, and actions where quiet mistakes are expensive. We also expose the same infrastructure through the developer API for teams building their own agents and vertical automation products.<p>We currently charge based on agent runtime and workflow volume, with separate pricing for dedicated environments and enterprise deployments.<p>We’d especially appreciate feedback from people who have built and&#x2F;or used browser agents, RPA systems, desktop automation, or agent infrastructure. We’re curious which parts of the API you would want direct control over, where you would prefer higher-level abstractions, and which failure modes have been hardest in your own automation systems.<p>If you&#x27;ve hit weird failure modes automating software like this, we want to hear about them. We&#x27;ll be here all day answering questions and taking notes!
Original Article
View Cached Full Text

Cached at: 07/15/26, 07:44 PM

# API reference — Coasty Computer Use API Source: [https://coasty.ai/docs](https://coasty.ai/docs) Building with an AI assistant? Generate a ready\-made prompt tailored to Cursor, Claude Code, ChatGPT, or any LLM\. ## Introduction PRIMARY AUTOMATION · START HEREtask runsone goal, driven to doneworkflowsmany tasks, one programmachinesmanaged Linux or Windowsuse finer control when neededPRIMITIVES · YOU OWN EXECUTIONpredictstateless stepsessionsstateful loopgroundfind coordinatesparsecode to actions Start with task runs, workflows, and machines\. Drop to prediction primitives only when your application needs to own the control loop\.Start with a[task run](https://coasty.ai/docs#runs): give Coasty a goal and a machine, then let the agent drive to completion\. Use[workflows](https://coasty.ai/docs#workflows)when an automation needs many tasks, branches, loops, approvals, or shared outputs\.[Machines](https://coasty.ai/docs#machines)provide the managed computer those tasks operate\. The prediction endpoints are lower\-level primitives for teams that need to own the control loop themselves\. Use[sessions](https://coasty.ai/docs#sessions)for a stateful screenshot loop,[predict](https://coasty.ai/docs#predict)for a stateless step, grounding for coordinates, and parse for structured actions\. Everything is normal HTTPS to`https://coasty\.ai/v1`, so you can choose the highest\-level surface that fits the job and drop down only when you need finer control\. ## Authentication API keyscope ✓reserve $run model200 \+ usageX\-Credits\-\*failsrefund \+ 5xxX\-Credits\-Refunded401 / 403 / 402 short\-circuit before any charge Every billed call is charged before the model runs and automatically refunded if it fails — the X\-Credits\-Refunded header confirms the refund\.Every API\-key\-authenticated request must include your secret key\. The four health probes are public, and webhook ingress uses its documented`Coasty\-Signature`HMAC credential instead\. For API\-key operations, the canonical form is the`X\-API\-Key`header, but`Authorization: Bearer <key\>`works too: a blank`X\-API\-Key`falls through to the Bearer header\. Pick one form and send the raw key\. Do not paste the literal text`Bearer`inside`X\-API\-Key`; that is the single most common first\-day mistake and it returns`401 INVALID\_API\_KEY`\. Keys are created and revoked from the[API keys](https://coasty.ai/developers/keys)page\. Treat a key like a password: keep it server\-side, store it in an environment variable, and never commit it or ship it in client\-side code\. Prefer test keys while you wire up your integration\. An`sk\-coasty\-test\-` key never bills and runs against mock VMs, yet exercises the exact same request and response shapes \(its`X\-Credits\-Charged`and`usage\.cost\_cents` are always`0`\), so you can build and run CI confidently before flipping to a live key\. ## Run your first task Your first autonomous task needs an API key and a machine\. Grab a test key from the[API keys](https://coasty.ai/developers/keys)page \(it never bills\), then use an existing machine or[provision one](https://coasty.ai/docs#machines)\. Set the key in your shell: Start the task with`POST /v1/runs`\. Replace the example`machine\_id`, describe the outcome in`task`, and send an`Idempotency\-Key`so a retried create cannot start a duplicate run\. The complete example starts the run and follows it to a terminal state: The create response begins at`queued`\. Coasty then drives the machine, records each step, and finishes as`succeeded`,`failed`,`cancelled`, or`timed\_out`\. Your application can poll, subscribe to the event stream, or receive signed webhooks; it does not need to execute each prediction itself\. Task runs are the default starting point for autonomous work\. Workflows build on them, machines host them, and prediction primitives remain available when your application needs direct control over the loop\. ## Task runs POST /v1/runstask \+ machineagent loopseescreenshotthinkpredictactapplyverifydonepass / failSSE eventslive stream, resumablewebhookHMAC\-signed callbackshuman takeoverpause → resume POST a task \+ machine and Coasty runs the whole loop for you — streaming events over SSE, calling your webhook on lifecycle changes, and pausing for a human when asked\.A run hands the agent a task and a machine, then drives it to completion on our side\. The agent loops autonomously, verifies its own work \(pass or fail\), can pause for a human when it hits a wall, bills $0\.05 per completed step from your dollar API wallet \($0\.08/step on the legacy v1 engine\), and streams every event live\. You start one call and watch, instead of running the predict loop yourself\. Create a run with`POST /v1/runs`\. The two required fields are`machine\_id`and`task`\. The response is an`agent\.run`object with`status`of`queued`, plus a one\-time`webhook\_secret`you store to verify[webhooks](https://coasty.ai/docs#run-webhooks)\. Send an`Idempotency\-Key`header to make a retried create safe\. A run moves through`queued`to`running`, can bounce between`running`and`awaiting\_human`, and ends in one of`succeeded`,`failed`, `cancelled`, or`timed\_out`\. Terminal states are immutable, so it is always safe to stop polling once you reach one\. Runs need the `runs:read`and`runs:write`scopes, granted to new keys by default\. ## Streaming events `GET /v1/runs/\{id\}/events`returns a Server\-Sent Events stream so you can follow a run as it happens, instead of polling\. Each event has a type and a numeric`id`\(the sequence number\)\. If your connection drops, reconnect and replay everything you missed by sending the last sequence you saw as a`Last\-Event\-ID`header, or as the`?after=`query parameter\. The stream closes after the`done`event\. ## Human takeover Some steps need a person: a captcha, a one\-time code, a judgment call\. When the agent reaches one and`on\_awaiting\_human`is`pause`, the run moves to`awaiting\_human`and emits an`awaiting\_human`event with a reason\. A human completes the blocking step \(in the same machine session\), then you hand control back with`POST /v1/runs/\{id\}/resume`and an optional`note`\. Resume is only valid while the status is`awaiting\_human`\. Detect the pause from either the run object \(`status == awaiting\_human` with`awaiting\_human\_reason`set\), the SSE `awaiting\_human`event, or the`run\.awaiting\_human` webhook\. After resume, the run returns to`running`and emits a `resumed`event\. Set`on\_awaiting\_human`to `fail`or`cancel`at create time if you would rather the run stop than wait for a human\. ## Webhooks Pass a`webhook\_url`\(https only\) when you create a run and we POST a signed callback at each lifecycle transition\. The response to your create call includes a`webhook\_secret`exactly once: store it, because every callback is signed with it\. Each request carries a`Coasty\-Signature`header of the form`t=<unix\_ts\>,v1=<hex\>`\. To verify, build the signed payload as`"<t\>\." \+ raw\_request\_body`, compute`HMAC\-SHA256`over it keyed by the`webhook\_secret`, and compare against`v1`with a constant\-time check\. Always hash the raw body bytes, before any JSON re\-serialisation\. ## Bring your own model By default every LLM call in the computer\-use harness runs on Coasty's managed models\. BYOK \(bring your own key\) flips that: opt in and the entire harness \(the worker, grounding, the code agent, and compaction; every LLM call\) runs on your own Anthropic or OpenAI account instead\. Opt\-in is always explicit, per request or per stored key\.`provider: "managed"`\(or omitting`llm`entirely\) keeps the platform default, unchanged\. There are two ways to hand over a key\. Store it once with`PUT /v1/llm/keys/\{provider\}`\(encrypted with AES\-256\-GCM at rest; only a sha256\-prefix fingerprint is ever echoed back\), or send it per request in headers\. A header key takes precedence over the stored key\. Sending a key without a provider returns`422`\. The headers work on`POST /v1/predict`,`POST /v1/runs`,`POST /v1/workflows/\{id\}/runs`,`POST /v1/sessions`, and`POST /v1/schedules`\. Stored keys are managed through three endpoints, gated by the`llm\_keys`scope \(granted to new live keys by default\)\. These endpoints require a live key; sandbox keys cannot read, overwrite, or delete the production credential store: On the request body, the same endpoints accept an`llm`object that selects the provider and, optionally, a model per harness role\. It deliberately hasno api\_key field\(a`422`if you attempt one\): keys ride headers or the encrypted store only, so they can never be echoed in run objects, webhooks, or idempotency replays\. Per\-role overrides exist for tuning cost against quality: run compaction on a cheaper model while the worker stays on the default, for example\. For runs, workflows, and schedules the key is snapshotted encrypted into the run, so crash\-recovery on another replica keeps using your key; it is scrubbed the moment the run reaches a terminal state\.`GET /v1/runs/\{id\}`echoes a non\-secret`llm`block:\{`provider, model, key\_fingerprint, key\_source, key\_scrubbed`\}\. Schedules store only the non\-secret preference; at fire time the current stored key is used\. Delete the stored key and future firings fail loudly with`LLM\_KEY\_NOT\_CONFIGURED`; they never silently run on platform keys\. Grounding \(pixel\-coordinate resolution\) quality is tuned on the platform model\. When running grounding on your own model, expect the best results with the defaults, and use `grounding\_model`to experiment before committing a cheaper or different model to that role\. No silent fallback, ever: once you ask for BYOK, no code path can use Coasty's platform LLM keys\. Errors from your provider surface as your key's issue with stable codes: `LLM\_KEY\_NOT\_CONFIGURED`,`LLM\_KEY\_INVALID`, `LLM\_PROVIDER\_AUTH\_FAILED`,`LLM\_PROVIDER\_RATE\_LIMITED`, `LLM\_PROVIDER\_QUOTA\_EXCEEDED`, and`LLM\_PROVIDER\_ERROR`\. Billing: Coasty's per\-call and per\-step platform charges are unchanged with BYOK\. The model tokens are billed by your provider account directly\. ## Workflows workflowversioned JSONtask= a runassertpureif / looppuretask= a runbudget\_cents · max\_iterations · deadline guard the whole run A workflow is a small JSON DSL\. Control steps \(if / loop / parallel / human\_approval\) are pure and safe; each task step executes as a real run with its own billing and events\.A workflow composes many runs into one versioned program, with branching, loops, and guards expressed as a JSON DSL\. Each`task`step is itself an agent run, so a workflow is the way to chain tasks, gate them on conditions, and pass results between them\. Workflows are versioned: re\-creating the same`slug`bumps the version, and a`PUT`does too\. Create one with`POST /v1/workflows`\. The`slug`must match`\[a\-z0\-9\_\-\]`\. The response is a`Workflow`carrying an`id`, a`version`, and the current`dsl\_version`\(`2026\-06\-01`\)\. Workflows need the`workflows:read`and `workflows:write`scopes, granted to new keys by default\. See the [Workflow DSL](https://coasty.ai/docs#workflow-dsl) for the full step and condition catalogue\. ## Workflow DSL The DSL \(`dsl\_version``2026\-06\-01`\) is a JSON object with a`steps`array and an optional`output`\. Each step has an`id`and a`type`\. A`task`step runs the agent and binds its result \(`\{ status, passed, result, run\_id, steps, error \}`\) under both its`save\_as`name and its step id, so later steps can read it\. Conditions are structured rather than expression strings, which keeps them injection\-safe\. Each`left`,`right`, or`value`is either a literal or a`\{\{path\}\}`reference\. Paths are dotted lookups into`inputs\.\*`,`vars\.\*`, and any step id or`save\_as`name\. Three hard guards stop a workflow run when breached: `budget\_cents`\(spend cap in USD cents; 0 means unlimited\), `max\_iterations`\(loop cap\), and `deadline\_seconds`\(wall\-clock\)\. A breach ends the run as `failed`or`timed\_out`\. A definition is validated before it is accepted\. The limits below are enforced at create and ad\-hoc time, so an invalid definition is rejected with`422 VALIDATION\_ERROR`rather than failing mid\-run\. Workflows are version\-pinned\. When a run starts, the workflow's current `definition`is snapshotted into that run, so editing or replacing the workflow \(which bumps its`version`\) never changes runs already in flight\. Each run records the`workflow\_version`it executed\. ## Running workflows Start a saved workflow with`POST /v1/workflows/\{id\}/runs`, or run a definition inline \(without saving\) with`POST /v1/workflows/runs`by adding a`definition`\(and optional`inputs\_schema`\) to the same body\. Both return a`workflow\.run`\. The body accepts`inputs`, a default`machine\_id`for task steps,and the`budget\_cents`,`max\_iterations`, and`deadline\_seconds`guards\. An`Idempotency\-Key`header is honoured here too\. ## Provisioning A machine is a Coasty\-managed cloud VM that an agent can see and control\. You provision one, poll until it is`running`, then either hand it to a[task run](https://coasty.ai/docs#runs)\(the agent drives it to done\) or drive it yourself with the[action endpoints](https://coasty.ai/docs#machine-connect)\. Machines are optional:`/predict`,`/sessions`, and`/ground`run against*your*screen\. You only need a Coasty machine when you want the agent to execute on a VM Coasty hosts\. Provisionwith`POST /v1/machines`\. Only`display\_name`is required; everything else has a sensible default\. The body rejects unknown fields, so a typo returns`422 VALIDATION\_ERROR`rather than being silently ignored\. Provisioning isasynchronous\. The response returns immediately with the machine in`creating`status and a`connection`object whose secrets are redacted\. The VM is not drivable yet — poll`GET /v1/machines/\{id\}`until`status`is`running`before you send actions or start a run\. The machine object— returned by provision, list, and get: Listyour machines with`GET /v1/machines`\(newest first,`?limit=`1–200, default 50\) — it returns`\{ data, has\_more, request\_id \}`\. Fetch one with`GET /v1/machines/\{id\}`\. Both read straight from the registry, so they keep working even when provisioning is busy\. Provisioning a live machine needs the`machines:write`scope, a wallet balance of at least`20`credits \(Unlimited\-tier keys skip this\), and room under your plan's concurrent\-machine cap\. Building? An`sk\-coasty\-test\-`key returns a fully\-shaped mock VM \(id`mch\_test\_…`,`is\_test: true`\) with zero billing — up to 5 at a time\. ## Lifecycle & TTL creating0 cr/hrrunning5–20 cr/hrstopped1–2 cr/hrterminated0 cr/hrstopstartdelete / TTLttl\_minutes elapsesinsufficient funds → machine is stopped & flagged, never deleted — your data is safe Machines bill per minute while they exist\. Out of funds → stopped \(never destroyed\)\. A TTL auto\-destroys the VM at created\_at \+ ttl\_minutes\.A machine moves through a small set of statuses\.`status`is the field you poll: drive the machine only while it is`running`\. The runtime rate that applies in each status is shown below; exact per\-hour USD numbers are in the[Pricing](https://coasty.ai/docs#pricing)section\. Start, stop, restartare`POST /v1/machines/\{id\}/start`\(and`/stop`,`/restart`\)\. They are asynchronous: the call returns a transitional status \(`starting`/`stopping`\) and you poll until it settles\. They are state\-checked — starting a machine that is already running, or stopping one that is not running, returns`409 INVALID\_STATE`with`current\_state`and`allowed\_from`in the body, so you can react without guessing\.`start`is allowed from`stopped`or`error`;`stop`only from`running`\. Terminatewith`DELETE /v1/machines/\{id\}`\. This is permanent — the VM and its disk are destroyed and a later GET returns`404 MACHINE\_NOT\_FOUND`\. Delete is idempotent: deleting an already\-gone machine still succeeds, so retries are safe\. Auto\-destroy \(TTL\)\.A machine left running bills until you destroy it, so set`ttl\_minutes`as a safety net\. A background sweep \(every ~60s\) terminates a machine once its`auto\_destroy\_at`passes\. Adjust it any time with`PATCH /v1/machines/\{id\}`:`ttl\_minutes`is measured*from now*\(so it doubles as a lease extension\), accepts`5`–`10080`\(5 min to 7 days\), and`0`clears auto\-destroy entirely\. Anything else is`400 INVALID\_TTL`\. Provisioning without a TTL works but adds a`Warning`response header nudging you to set one\. Runtime billing\.Machines bill thedeveloper API wallet \(separate from any subscription credits\) by the minute, rounded down to whole credits in your favour\. Running Linux is`$0\.05/hr`, running Windows`$0\.09/hr`, and a`stopped`or`suspended`machine the keep\-alive rate of`$0\.01/hr`;`creating`,`error`, and`terminated`are free\. Transitional states \(starting/stopping/restarting\) bill at the running rate\. The per\-call control endpoints \(actions, terminal, files, browser, screenshot, connection\) are never billed — you pay for runtime only\. If the API wallet empties while a machine is running, the next sweepstopsit \(status becomes`suspended`\) rather than destroying it — your disk and snapshots are preserved\. Top up the wallet and`POST /start`to resume\. You can watch live accrual for every metered machine at`GET /v1/billing/active`\. ## Connect & control 1st requestIdempotency\-KeyreserveSET NXexecutecharge oncestore result24hretry \(same key\)timeout / 502replays the stored result — X\-Credits\-Charged: 0 On the exact 18 reserve\-and\-replay operations, send Idempotency\-Key with the original request\. A retry with that same key replays the stored result and never bills twice; unsupported mutations cannot gain idempotency retroactively\.Once a machine is`running`you can reach it three ways: connect directly over SSH/VNC, drive it through Coasty's control endpoints, or hand it to an agent run\. Normal machine responses redact secrets and only expose`has\_ssh\_key`/`has\_vnc\_password`booleans plus ports\. Connection secrets\.`GET /v1/machines/\{id\}/connection`returns the full`ssh\_private\_key\_pem`,`vnc\_password`, public IP, and ports\. It is gated by theopt\-in`connection:read`scope\(not granted by default — request it when you mint the key\), and the response is sent`Cache\-Control: no\-store`\. Treat that payload like a password: never log it\. SSH usernames are`ubuntu`on Linux and`Administrator`on Windows; VNC details exist only on`desktop\_enabled`machines\. Screenshots & snapshots\.`GET /v1/machines/\{id\}/screenshot`returns the current screen of a desktop machine \(a still\-booting VM returns`502 SCREENSHOT\_FAILED`— poll for`running`first\)\.`POST /v1/machines/\{id\}/snapshot`captures a restorable image \(Linux\), needs the`snapshots:write`scope, and is the one machine op with a flat fee \(`$0\.01`per snapshot\)\. A conclusive pre\-creation failure is refunded, confirmed by`X\-Credits\-Refunded`\. A timeout, an upstream 5xx, or malformed post\-dispatch result may already have created the image and instead returns terminal`503 SNAPSHOT\_OUTCOME\_UNKNOWN`without a blind refund or re\-execution\. Boot a future machine from a confirmed snapshot with`restore\_from\_snapshot: true`\. The control surface\.Drive the VM directly with these endpoints\. Each enforces a specific scope, and the high\-risk ones —`browser\_execute`\(arbitrary JS\) and anything under`connection:read`— are opt\-in\.`/actions/batch`runs up to 50 steps and stops on the first error by default \(`stop\_on\_error: false`to continue\);`/terminal`truncates output to 5000 chars\. Idempotency & safety\.The machine operations in the exact reserve\-and\-replay set — provision, snapshot, actions, action batches, browser, terminal, and file operations — accept an`Idempotency\-Key`\(≤128 chars\)\. Lifecycle start/stop/restart, TTL updates, and termination do not\. For supported operations, a duplicate key replays the original result without re\-executing; a duplicate that arrives while the first is still running waits up to ~25s, then returns`409 IDEMPOTENCY\_IN\_FLIGHT`\. One nuance worth knowing: a command that never reached the VM \(a dispatch failure\) is*not*cached, so retrying the same key runs it fresh; a command the VM actually ran \(even if it errored\)*is*cached\. Every machine lookup is ownership\-scoped, so a wrong or someone\-else's id returns`404`— never a leak\. Full code list in[Errors](https://coasty.ai/docs#errors)\. ## Predict screenshotbase64 PNG / JPEGPOST /v1/predictCoasty CUAvision modelactions\[\]your appapply the actionsrepeat until status = "done"click · type\_text · scroll · key\_combo · drag · done The low\-level prediction loop: send a screenshot, apply the returned actions, then capture the next screen and repeat until status is done\.`POST /v1/predict`is the low\-level, stateless prediction primitive\. Each call is independent: you provide the full context, execute the returned actions, capture the next screenshot, and decide when to call again\. Use it when your application must own that loop\. For an autonomous goal, start a[task run](https://coasty.ai/docs#runs)\. When a manually driven loop needs server\-side trajectory memory, reach for[sessions](https://coasty.ai/docs#sessions)instead\. The response is the standard prediction shape, covered in[Response format](https://coasty.ai/docs#responses)\. ## Sessions A session keeps the trajectory — the running history of screenshots and actions — on our side, so each step only needs the latest screenshot and instruction\. This produces better multi\-step behaviour on long tasks and keeps your request bodies small\. Create a session once, step through the task, then delete it to release your concurrency quota\. Always delete a session in a`finally`block\. Sessions count against your tier's concurrent\-session limit\. The 2\-hour \(7200\-second\) idle TTL is reset on each predict and reset; deleting the session releases the slot immediately\. ## Grounding Grounding answers a narrower question than predict: “where is this element?” Give it a screenshot and a description and it returns the exact`x`,`y`coordinate to target\. It is faster and cheaper than a full prediction \($0\.03 instead of $0\.05\), which makes it ideal when you already know what to do and only need a pixel to click\. The response is`\{ x, y, usage, request\_id \}`\. Coordinates are in the same pixel space as the screenshot you sent\. ## Parse Parse converts a block of`pyautogui`code into the same structured action objects the model returns\. It is deterministic, runs no model, and is free\. Use it to migrate existing automation scripts onto Coasty's executor, or to normalise hand\-written steps into the canonical action schema\. ## Action types Every action the model can return uses an`action\_type`from the table below, paired with a`params`object\. Your executor switches on the type and applies the parameters\. The terminal types —`done`and`fail`— set the response`status`and signal you to stop looping\. ## Response format Predict and session\-predict return the same shape\.`actions`is the ordered list to execute;`status`tells you whether to keep going \(`continue`\), stop successfully \(`done`\), or stop because the task is impossible \(`fail`\)\.`usage`reports tokens and the dollar cost of the call \(`cost\_cents`\)\. Billed success responses also carry two headers you can read without parsing the body:`X\-Credits\-Charged`\(what this call cost\) and`X\-Credits\-Remaining`\(your wallet balance after it\)\. In the body, the same numbers appear as`usage\.credits\_charged`and`usage\.cost\_cents`\. On an`sk\-coasty\-test\-`key both are always`0`\. Every response \(success or error\) additionally carries an`X\-Coasty\-Request\-Id`header that mirrors`request\_id`; quote it when contacting support\. On a failed billed request,`X\-Credits\-Refunded`is the authoritative confirmation that credits were returned, and`X\-Credits\-Charged`is then`0`\. If settlement cannot be confirmed, the API returns`503 BILLING\_UNAVAILABLE`without the refund header\. Follow the error's`retry\_with\_same\_idempotency\_key`field rather than retrying by status alone\. ## Errors Errors return a non\-2xx status and a JSON envelope under an`error`key\. The`code`is stable and safe to branch on;`message`is human\-readable and may change\. Every error also carries an`error\.request\_id`\(mirrored in the`X\-Coasty\-Request\-Id`response header\), plus`error\.suggestion`and`error\.docs\_url`for self\-service\. A`Link: <url\>; rel="help"`header mirrors`docs\_url`\. Always log the request id: it is the fastest way for us to trace a failed call\. Some codes attach machine\-readable context to the body\. A`402`\(`INSUFFICIENT\_CREDITS`\) reports`required`and`balance`; a`403`reports`required\_scope`and`current\_scopes`; a`422``VALIDATION\_ERROR`lists the offending field path under`error\.details`; and a`409`state conflict carries`current\_state`with`allowed\_from`or`required\_state`\. Treat`429`,`503`\(`UPSTREAM\_UNAVAILABLE`\), and`504`\(`UPSTREAM\_TIMEOUT`\) as retryable: honor`Retry\-After` on a 429, and use an`Idempotency\-Key`with exponential backoff on the upstream codes only when the response's`retryable`and`retry\_with\_same\_idempotency\_key`fields permit it\. A`500`model failure \(`PREDICTION\_FAILED`or`GROUNDING\_FAILED`\) is refunded only when`X\-Credits\-Refunded`is present; after a confirmed refund, use a new idempotency key for a new execution\. ### Troubleshooting Five mistakes account for almost every first\-week support ticket\. Each maps to one status and one fix: ## Pricing Requests are billed in US dollars from your prepaid API wallet\. The charge is taken before the model runs\. On a conclusive server\-side failure, the API submits a refund; treat it as complete only when`X\-Credits\-Refunded`is present\. Ambiguous provider mutations may retain the debit until reconciliation\. Internally each request unit is`$0\.01`\(the granularity behind every price below\), but everything you pay and see is dollars\. Every price on this page is exact; test keys \(`sk\-coasty\-test\-`\) always bill`$0\.00`\. ### Surcharges Four fixed surcharges can apply on top of a base price, all on the vision endpoints \(predict, session steps, ground\)\. Each is an exact USD amount: ### Machines Machines bill for runtime only, metered per minute and rounded down:`$0\.05/hr`for a running Linux machine,`$0\.09/hr`for a running Windows machine, and`$0\.01/hr`while stopped or suspended\. The starting, stopping, and restarting transitions bill at the running rate; the creating, error, and terminated states bill nothing, and TTL auto\-destroy is free\. Snapshots are a one\-time`$0\.01`each, and every per\-call operation \(actions, batch, browser, terminal, files, screenshot, connection\) is free\. Provisioning requires a`$0\.20`wallet minimum, which is a gate, not a charge\. If the wallet empties mid\-flight the machine is automatically stopped, never destroyed, and resumes after you top up\. The live rate card is always at`GET /v1/machines/pricing`\. ### Schedules Schedules have no per\-fire fee: webhook fires are free \(limited to 60/min\), and create, run\-now, and webhook fires only require the same`$0\.20`wallet minimum as a gate\. The execution itself is billed differently from everything else on this page: scheduled agent runtime is charged to your subscription credit balance at 10 credits per minute \($0\.10 of subscription value per minute, at 1 credit = $0\.01\), not to this USD API wallet\. Keep both balances funded if you rely on schedules\. ## Cookbook Curated open\-source repositories for building on the Coasty API\. Clone a repo, mint a key, and ship\.

Similar Articles

Coasty

Product Hunt

Coasty is a computer-use agent designed to automate interactions with legacy software, mimicking human operation.

Launch HN: Hoplite (YC S26) – Effortlessly deploy cloud coding agents

Hacker News Top

Hoplite (YC S26) launches a platform to deploy cloud coding agents, porting over local setups and enabling concurrent QA of features across user flows, APIs, and CLIs. Founders Bence and Ryan built a custom agent harness on AWS, Temporal, Modal, and Planetscale, with free credits available via code 'HACKERNEWS'.

Launch HN: Superset (YC P26) – IDE for the agents era

Hacker News Top

Superset is an open-source IDE for orchestrating multiple CLI-based AI coding agents in parallel, with isolated git worktrees, built-in monitoring, and a diff viewer. It supports various agents like Claude Code, Codex CLI, and Gemini CLI.