You have a working script with pyautogui.moveTo, pyautogui.click, and pyautogui.rightClick. Now you want that same logic to run on any machine, on any browser, or inside a remote desktop without hard-coded element IDs. Coasty takes your raw pyautogui code and maps it to structured actions that a computer use agent can execute, even when you cannot inspect the DOM. The /v1/parse endpoint does this for free, so you can convert existing scripts and build workflows that run on real desktops, browsers, and terminals.
How /v1/parse works
Send a POST to https://coasty.ai/v1/parse with a JSON body. Include a field source containing your pyautogui code snippet. The endpoint returns a JSON object with a field actions that holds an array of structured steps. Each step has a type (click, hover, type, scroll, etc.) and coordinates that the agent can use to drive a real UI. No API key is required for this free endpoint. The response will look like this. { "actions": [ { "type": "move", "x": 120, "y": 45, "duration": 0.2 }, { "type": "click", "x": 120, "y": 45 }, { "type": "type", "text": "Hello", "x": 120, "y": 45 } ] }
import os
import requests
COASTY_API_KEY = os.getenv("COASTY_API_KEY")
pyautogui_code = '''"""
import pyautogui
pyautogui.moveTo(120, 45)
pyautogui.click()
pyautogui.write("Hello")
"""'''
response = requests.post(
"https://coasty.ai/v1/parse",
json={"source": pyautogui_code},
headers={"X-API-Key": COASTY_API_KEY}
)
if response.status_code == 200:
data = response.json()
print("Structured actions:", data.get("actions", []))
else:
print("Error:", response.text)Use structured actions in a run
Once you have the actions array, you can feed it into a task run. POST to /v1/runs with a machine_id, the task containing the actions, and a cua_version (v3 or v4). The server will provision a cloud VM, start it, and drive the desktop according to your actions. Each agent step is billed at $0.05. If the task requests human approval, you can set on_awaiting_human to pause, fail, or cancel. You can also stream events with GET /v1/runs/{id}/events to monitor progress.
Scale with workflows
Combine parsed actions with workflows. POST /v1/workflows to define a versioned JSON DSL that uses task, assert, if, loop, and parallel step types. Task steps inherit the $0.05 per step billing. Variables like {{inputs.x}} let you parameterize parsed actions at runtime. Hard guards such as budget_cents, max_iterations, and deadline_seconds stop runaway runs.
The free /v1/parse endpoint turns raw pyautogui into structured actions your computer use agent can execute, with no per-call cost.
Why computer use beats brittle selectors
Traditional automation relies on stable IDs, XPath, or CSS selectors that break when layouts change or when you target different browsers. Coasty does not need selectors. It sees the screen and acts like a human. After parsing your pyautogui code into structured actions, the agent can run on any machine, any OS, or any browser. You do not need to maintain a separate selector map for each app. This makes your automation more robust and easier to maintain.
Start converting your pyautogui scripts into structured actions with the free /v1/parse endpoint. Then send those actions to a machine run or embed them in a workflow. Get your API key at https://coasty.ai/developers and build automation that runs on real desktops without brittle selectors.
Want to see this in action?
View Case Studies