Web checkout forms change often. Button text shifts, classes get renamed, and dynamic fields appear. Traditional browser automation relies on stable selectors and brittle XPath. When the UI breaks, your script fails. The Coasty Computer Use API lets you build a computer use agent that sees the screen, reads instructions, and clicks like a human. It handles everything from input fields to CAPTCHAs to final checkout confirmation.
How it works
The Computer Use API works in a loop: capture a screenshot, ask the model to take action, execute the action, and repeat until the task is done. You drive the agent with a base64 screenshot plus your instruction. The model returns a list of actions (click, type, scroll, etc.) plus a status. A status of done means the agent finished. You can also use stateful sessions to keep context across multiple captures.
curl https://coasty.ai/v1/predict \ -H 'X-API-Key: $COASTY_API_KEY' \ -H 'Content-Type: application/json' \ -d '{
"image": "$(base64 -i screenshot.png)",
"instruction": "Go to https://shop.example.com, click Add to Cart, fill email, fill credit card, and click Checkout. Confirm the final order page.",
"cua_version": "v3"
}' | jq '.'Stateful sessions
Stateful sessions add trajectory memory to your agent. You first create a session, then send capture/predict requests to that session. The server keeps a history of actions and screenshots, helping the model reason across steps. This is useful for multi-page flows like checkout where previous context matters.
SESSION=$(curl -s https://coasty.ai/v1/sessions \
-H 'X-API-Key: $COASTY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"task": "Fill the email field on the checkout form and submit."
}' | jq -r '.id')
for i in {1..5}; do
capture=$(curl -s https://coasty.ai/v1/sessions/$SESSION/predict \
-H 'X-API-Key: $COASTY_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"image": "$(base64 -i screenshot.png)",
"cua_version": "v3"
}' | jq -r '.actions')
echo "Step $i actions: $capture"
sleep 1
doneEach capture and action step costs $0.05, billed from a prepaid USD wallet where 1 credit is $0.01.
Where this beats brittle automation
Selectors break when a page team changes class names, reorders elements, or uses dynamic IDs. A computer use agent reads the visual layout, understands context, and adapts. It can click any visible element, type into any focused field, and scroll to reveal hidden parts. It works with forms, checkout pages, and even apps that lack documented APIs, all through the Computer Use API.
Build your first checkout agent
Start with a simple task: navigate to a product page, add it to cart, and fill a few fields. Use stateful sessions to remember the cart state across captures. Monitor the status field to know when the task completes. If the page needs human approval, set on_awaiting_human to pause or fail, or use a webhook to notify your system.
Automating forms and checkout with the Coasty Computer Use API gives you a reliable, adaptable agent driven by vision and clicks. Get your API key at https://coasty.ai/developers and start building.
Want to see this in action?
View Case Studies