Checkout pages are a nightmare for brittle selectors. They hide required fields behind nested divs, change IDs on every reload, and ask for human verification steps that break static selectors. A computer use agent looks at the screen, reads the form, remembers previous steps, and can handle dynamic layouts. The Coasty computer use API lets you drive a real cloud desktop with a task and get real-time events, all billed by agent step. This guide walks you through building a form-filling and checkout agent using the POST /v1/runs endpoint.
How it works
You send a task to POST /v1/runs with a machine_id, a checkout URL, instructions, and a cua_version. The server provisions a cloud VM, starts a desktop, and launches a browser. The agent runs in a loop, taking screenshots, calling predict on the current state, and executing actions. You stream events from GET /v1/runs/{id}/events to watch progress, detect errors, and know when the agent is waiting for human input. When the agent finishes, the event stream returns status succeeded, failed, cancelled, or timed_out. Each agent step costs $0.05.
curl -X POST https://coasty.ai/v1/runs \
-H "Content-Type: application/json" \
-H "X-API-Key: $COASTY_API_KEY" \
-d '{
"machine_id": "m-123456",
"task": "Open https://example.com/checkout, fill in address, phone, and email, and submit the order.",
"cua_version": "v3",
"max_steps": 200,
"deadline_seconds": 600,
"on_awaiting_human": "pause"
}'Key fields and pricing
- machine_id: provisioned cloud desktop ID you own.
- task: natural language description the agent receives.
- cua_version: v3 for guided mode, v4 for autonomous with pass/fail verifier.
- max_steps: hard limit on agent steps, default 200.
- deadline_seconds: server will stop the run after this many seconds, default 600.
- on_awaiting_human: pause when the agent asks for input, fail, or cancel.
- Each agent step costs $0.05.
Use POST /v1/runs with max_steps and deadline_seconds to keep automation predictable and within budget.
Where this beats brittle automation
Static selectors break when a form changes layout, hides fields behind modals, or inserts a CAPTCHA. A computer use agent reads the visual state of the page, recognizes which input is expected next, and can fill it correctly. Because the agent runs in a real cloud desktop with a full browser, it can handle JavaScript-rendered forms, shadow DOM elements, and multi-step wizards. The stateful trajectory memory in sessions keeps context across steps, so the agent remembers what it filled in earlier.
Now that you know how to drive a real computer over the API, you can build reliable checkout bots, data entry assistants, and multi-step workflows. Start a trial machine, try the POST /v1/runs endpoint, and scale with a prepaid wallet. Get your API key at https://coasty.ai/developers.
Want to see this in action?
View Case Studies