Checkout flows are fragile. They rely on hidden IDs, dynamic classes, and layout shifts. Many bots break on the first form field change or promotional popup. A computer use agent sees the screen, reads labels, and follows the same steps a human does. The Coasty computer use API turns your goal into a task run that an agent executes on a cloud machine, not just a series of selector‑based clicks.
How it works
You send a task to the Coasty API. The server provisions a machine and starts your agent. The agent repeatedly takes a screenshot, interprets the instruction, and emits actions to move the mouse, type, or click. Each screenshot + prediction step costs $0.05. The API returns a stream of events you can watch in real time. When the agent finishes, you get a final status and logs. You can also use workflows to orchestrate multiple steps like assert, loop, and retry with structured conditions.
#!/usr/bin/env bash
set -e
# Required for the example to work
COASTY_API_KEY=${COASTY_API_KEY:-"your-key-here"}
# Start a checkout task run (stateless, non-agent version)
curl -sS https://coasty.ai/v1/runs \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": null,
"task": "Go to https://example.com/cart, fill the email field with [email protected], fill the password field with a real password, click the checkout button, then click the pay button and report the final page title.",
"cua_version": "v3",
"system_prompt": "You are a helpful checkout assistant. Follow the steps in the task. Report the final page title at the end."
}' | jq '.'Task run fields you need
- machine_id (optional): provision a cloud VM by first calling POST /v1/machines, then provide its ID here. You can also let Coasty provision one for you by passing null.
- task: plain‑text instruction describing the flow. The agent treats it as a natural language plan.
- cua_version: use "v3" for guided actions or "v4" for autonomous runs with a pass/fail verifier.
- instructions (optional): additional context you can append to the base prompt.
- system_prompt (optional): custom instructions for the agent's behavior.
- max_steps (optional): how many agent actions to perform before stopping.
- deadline_seconds (optional): fail if the agent does not finish within this time.
- on_awaiting_human (optional): how to handle human approvals (pause, fail, cancel).
- webhook_url (optional): receive final state and logs via an HTTP POST.
- Billed $0.05 per agent step. You pay for what the agent actually does.
Each agent step costs $0.05. Use max_steps and deadline_seconds to keep costs predictable.
Where this beats brittle automation
Selector‑only tools rely on CSS or XPath selectors that break when the UI changes. A computer use agent reads labels, looks at button placements, and adapts to layout shifts. It can handle CAPTCHAs, prompts, and dynamic forms without extra code. Coasty even provides an MCP server so you can drive agents from Cursor, Claude Desktop, or other MCP clients.
Build robust checkout flows and multi‑step forms by letting an agent see and act on the screen. Get your API key at https://coasty.ai/developers and start automating with the Coasty computer use API.
Want to see this in action?
View Case Studies