Turn PyAutoGUI Code Into Structured Actions With the Free Parse Endpoint
Most desktop automation scripts are fragile. They click by index, sleep for arbitrary seconds, or break when the UI layout changes. You probably have a PyAutoGUI script that automates a simple task. You want to reuse that logic but make it robust. The free /v1/parse endpoint turns your existing PyAutoGUI code into a structured list of actions. These structured actions can be combined with task runs, workflows, or stateful sessions to build a computer use agent that watches the screen and acts exactly as you described.
How the parse endpoint works
The /v1/parse endpoint accepts raw PyAutoGUI code and returns a structured list of actions. Each action includes a type, coordinates, and any relevant parameters. The endpoint is free and lives at https://coasty.ai/v1/parse. Send a POST request with the code in the body. The response contains an actions array where each item represents a single interaction such as a mouse click or keyboard press. You can then feed these actions into a task run or workflow step to let the agent execute them on a real desktop.
import os
import requests
from base64 import b64encode
COASTY_API_KEY = os.environ.get("COASTY_API_KEY")
BASE_URL = "https://coasty.ai/v1"
pyautogui_code = """
import pyautogui
import time
pyautogui.moveTo(500, 300)
time.sleep(1)
pyautogui.click()
time.sleep(1)
pyautogui.moveTo(600, 400)
time.sleep(1)
pyautogui.doubleClick()
"""
headers = {
"Authorization": f"Bearer {COASTY_API_KEY}",
"Content-Type": "application/json",
}
payload = {
"code": pyautogui_code,
"language": "python",
}
response = requests.post(f"{BASE_URL}/parse", json=payload, headers=headers)
response.raise_for_status()
# structured actions from the free parse endpoint
actions = response.json()["actions"]
print(actions)Request and response fields
The POST /v1/parse request uses these fields. The response contains an actions array. Each action follows this structure. The endpoint is free and returns a JSON payload with no billing impact.
Use the free /v1/parse endpoint to turn PyAutoGUI code into structured actions.
Where this beats brittle automation
Traditional automation relies on hard-coded coordinates or fragile selectors. If the UI shifts, the script breaks. PyAutoGUI itself already assumes fixed coordinates, which are hard to maintain. The parse endpoint lets you start from code you already have and convert it into structured actions. You can then plug those actions into a computer use agent that captures a screenshot, sees the screen, and clicks the exact locations you defined. This approach is far more resilient because the agent validates the screen state before each action. It can wait, retry, or adapt without rewriting the entire workflow.
Now you can turn an existing PyAutoGUI script into a structured action list and use it within a task run or workflow. Build a computer use agent that follows your exact steps on a real desktop. Get a key at https://coasty.ai/developers and start converting your automation code.