How to Automate Any Desktop App with the Coasty Computer Use API
Most desktop automation tools rely on brittle selectors or on an app exposing APIs. When the UI changes, your script breaks. The Coasty computer use API turns your app into a window you can see and control like a human. You send a screenshot and a natural language instruction, the agent clicks, types, and scrolls until the task finishes.
How it works
The core is a task run. You POST to /v1/runs with a machine_id, a task description, and a cua_version. The server spins up a headless desktop, drives it with a computer use agent, and streams events back to you. You can poll the run status or subscribe via Server-Sent Events. The agent is billed at $0.05 per step. When the run reaches succeeded, failed, or timed_out, you know the result.
# Example: start a task run from the command line
# COASTY_API_KEY must be exported in your environment
export COASTY_API_KEY=your_api_key_here
curl -X POST https://coasty.ai/v1/runs \
-H 'X-API-Key: $COASTY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"machine_id": "m-12345",
"task": "Open Chrome, navigate to https://example.com, and type a message in the search box",
"cua_version": "v3",
"max_steps": 50
}' | jq '.'What fields to provide
- ●machine_id: a VM provisioned by Coasty for the agent to drive.
- ●task: free-form natural language describing the user intent.
- ●cua_version: defaults to v3; v4 adds a pass/fail verifier.
- ●max_steps: cap the number of agent steps to control cost.
- ●optional system_prompt: custom system instructions to steer behavior.
- ●optional on_awaiting_human: pause, fail, or cancel when the agent asks for help.
The run is billed at $0.05 per agent step, with events streamed back via Server-Sent Events.
Where this beats brittle automation
Coasty does not need XPath or CSS selectors. It looks at the screen, interprets the layout, and acts like a human. That means when your app redesigns, your automation keeps working. You can target anything, browsers, terminals, legacy desktop apps, without maintaining a library of locators. You also get visibility into actions via events, so you can debug or replay steps.
Start by provisioning a machine, defining a short task, and watching the agent complete it. Build workflows to chain multiple tasks, add retries and human approvals, and scale across many machines. Get your API key at https://coasty.ai/developers and start automating any desktop app with a computer use agent.