Back to Blog
Tutorial

Sarah Chen6 min
Ctrl+A

Traditional automation relies on brittle selectors and rigid APIs. You might wait for a DOM element to exist, but if a layout shifts or a class changes, the script breaks. The /v1/predict endpoint solves this by giving you a computer use agent that sees the screen and acts like a human. You send a base64 screenshot and an instruction, and it returns actions such as click, double-click, scroll, and type. You loop capture, predict, act until the status is done. This is how you build a computer use agent that works across any application, website, or desktop tool.

How /v1/predict works

The endpoint is a single HTTP POST request. You authenticate with an API key in the X-API-Key header. The payload includes a base64-encoded screenshot, an instruction string, and the cua_version to specify the model. The response contains the actions array, the status field, and a request_id for debugging. You run the actions with your own automation library, then capture a new screenshot and call predict again. You repeat until status is done. This loop gives you a stateful trajectory memory without managing sessions yourself.

bash
# Example using curl (replace with your own base64 screenshot and API key)
export COASTY_API_KEY="your_api_key_here"

BASE64_SCREENSHOT="$(base64 -i screenshot.png | tr -d '\n')"

curl -X POST https://coasty.ai/v1/predict \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "screenshot": "'"$BASE64_SCREENSHOT"'",
    "instruction": "Click the Apply button on the top right and enter my email.",
    "cua_version": "v3"
  }' | jq .

Request and response fields

  • screenshot (string): base64-encoded image. Required.
  • instruction (string): natural language command for the agent. Required.
  • cua_version (string): model version. Use v3 for the default agent.
  • actions (array of objects): each object contains action type, x coordinate, y coordinate, text, and optional keys. Returned on success.
  • status (string): either done or an error code. Loop until done.
  • request_id (string): unique request identifier for debugging.
  • price (number): the cost in credits for this prediction. It is $0.05 per call.

Loop capture, predict, act until status is done.

Where /v1/predict beats brittle automation

A computer use agent reads the screen like a person. It can click a button that changes its label, scroll through a long list, or type into a field that has no unique ID. It does not depend on a specific CSS selector or API endpoint. If the UI updates, the agent still sees the change and adapts its actions. This makes the /v1/predict endpoint ideal for automating legacy systems, complex web forms, or tools that lack a public API. You get a computer use agent that works across browsers, desktop apps, and terminals without brittle selectors.

The /v1/predict endpoint gives you a simple, powerful way to turn screenshots into actions. Build a computer use agent that clicks, types, and scrolls across any application. Sign up for a key at https://coasty.ai/developers and start automating with computer use.

© 2026 Coasty

Backed byYCombinator