Turn PyAutoGUI Code into Structured Actions with the Free Parse Endpoint
Many teams still rely on PyAutoGUI scripts that click pixels or use brittle selector strings. Those scripts break with window moves, layout changes, or browser updates. The Coasty Computer Use API provides a free /v1/parse endpoint that takes raw pyautogui code and returns a structured list of actions, including screen captures and element descriptions. You then feed those actions into a /v1/sessions or /v1/runs workflow to run on a real desktop. This lets you modernize legacy code without rewriting it from scratch.
How the parse endpoint works
Send a POST request to https://coasty.ai/v1/parse with your pyautogui code and the cua_version. The endpoint does not require an API key. It returns a JSON object with a code field that contains the converted actions and a status field indicating success or failure. The response uses the same action model used by the computer use agent, so you can pass it directly to session creation or run workflows. This is a one-way transformation, not a live driver. It does not execute code on your machine.
curl -X POST https://coasty.ai/v1/parse \
-H 'Content-Type: application/json' \
-d '{
"code": "pyautogui.moveTo(100, 200); pyautogui.click();",
"cua_version": "v3"
}'import os
import json
import requests
COASTY_API_KEY = os.getenv("COASTY_API_KEY")
url = "https://coasty.ai/v1/parse"
payload = {
"code": "pyautogui.moveTo(100, 200); pyautogui.click();",
"cua_version": "v3"
}
response = requests.post(url, json=payload)
if response.ok:
result = response.json()
print(json.dumps(result, indent=2))
else:
print(f"Error: {response.status_code} {response.text}")Key fields you will see in the response
- ●code: string containing the list of structured actions generated from the input pyautogui code
- ●status: string indicating success or an error message
- ●request_id: string you can pass back if you need to debug specific requests
The /v1/parse endpoint is completely free. It does not consume credits and has no rate limits listed.
Why this beats brittle selectors and API-only tools
PyAutoGUI scripts rely on absolute pixel coordinates and hard-coded selector strings. When you use the parse endpoint, the generated actions include explicit screen captures and element descriptions. The computer use agent can then locate those elements visually, adapt to layout changes, and handle windows that move or resize. This approach is far more robust than brittle selectors, and it works across browsers and desktop environments without needing API-specific integrations. You leverage the agent’s computer use abilities to turn legacy code into a modern, flexible automation pipeline.
Start by converting a small PyAutoGUI script with the free /v1/parse endpoint, then integrate the resulting actions into a /v1/sessions workflow or a /v1/runs task. Build a desktop automation pipeline that adapts to UI changes, not to fixed coordinates. Get your API key at https://coasty.ai/developers and turn your old scripts into powerful, computer use agents.