Automating Form Filling and Checkout Flows with the Coasty Computer Use API
API-only automation hits a wall with checkout flows. CAPTCHAs, hidden fields, and layout shifts break basic selectors. A computer use agent that sees the screen and clicks like a human completes the task reliably. This guide shows how to use the Coasty Computer Use API to automate form filling and checkout flows over the API.
How it works
You start a task run with POST /v1/runs. The server provisions a cloud machine and launches a computer use agent v4 (autonomous with pass/fail verifier). You provide the URL and a task description like "fill out the checkout form and submit the order." The agent repeatedly captures screenshots, sends the image and instruction to /v1/predict, receives actions (click, type, scroll), and executes them. The agent stops when status is succeeded or failed, or when a deadline or max_steps limit is reached. You stream events via GET /v1/runs/{id}/events to see progress in real time.
curl https://coasty.ai/v1/runs \ -H "Authorization: Bearer $COASTY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"machine_id":"prod-01","task":"Go to https://example.com/checkout, fill the email field with [email protected], fill the credit card number with 4111111111111111, fill the expiry with 12/25, fill the CVC with 123, click the place order button, and verify the success message.","cua_version":"v4","max_steps":30,"deadline_seconds":120,"on_awaiting_human":"pause"}'Key fields and options
- ●machine_id: your cloud VM identifier from /v1/machines
- ●task: high-level instruction in plain language. The agent plans actions from it.
- ●cua_version: use "v4" for autonomous checkout with pass/fail verifier. Default is "v3".
- ●max_steps: upper bound on agent steps. Each step costs $0.05.
- ●deadline_seconds: overall time limit for the run.
- ●on_awaiting_human: pause, fail, or cancel if the agent needs human input.
Each agent step costs $0.05. Use max_steps and deadline_seconds to control spend.
Where this beats brittle automation
Traditional automation relies on CSS selectors, XPath, or hardcoded element IDs. Checkout flows change layouts, add new fields, or introduce CAPTCHAs. The agent sees the screen, reads text, and infers where to click or type. It handles CAPTCHAs by describing the challenge to a human or by following instructions you provide. It adapts to layout shifts without selector updates. Coasty also provides a vision endpoint /v1/ground that maps a screenshot and element description to x,y coordinates, useful for precise clicks on dynamic elements.
Next steps
- ●Provision a machine with POST /v1/machines and use its ID in the run.
- ●Stream events with GET /v1/runs/{id}/events to build dashboards and logs.
- ●Integrate the runs API with your own orchestrator to chain tasks.
- ●Use the MCP server to drive Coasty from Cursor, Claude Desktop, or other MCP clients.
Now you can automate form filling and checkout flows with a computer use agent that sees the screen and acts like a human. Sign up for a key at https://coasty.ai/developers and start building reliable checkout automation.