Coasty/

Developer API

Reference

The shape of every prediction response

Response format

Response format, at a glance

The shape of every prediction response

status + actions + usage + request_id
The response joins status, actions, reasoning, usage, model attribution, and request correlation into one branchable contract.

Predict and session-predict share the core action, status, reasoning, raw-code, and usage shape. Predict additionally echoes screen_width and screen_height; session-predict instead returns session_id and step. actions is the ordered list to execute; status tells you whether to keep going (continue), stop successfully (done), or stop because the task is impossible (fail). usage reports tokens and the dollar cost of the call (cost_cents).

Billed success responses also carry two headers you can read without parsing the body: X-Credits-Charged (what this call cost) and X-Credits-Remaining (your wallet balance after it). In the body, the same numbers appear as usage.credits_charged and usage.cost_cents. On an sk-coasty-test- key both are always 0. Every response produced by the Coasty application carries X-Request-Id for the current HTTP attempt. X-Coasty-Request-Id and the body request_id normally match it, but an exact replay can preserve the original operation id in one or both. Log every distinct value. A CDN/network failure can instead return non-JSON without Coasty headers.

On a failed billed request, X-Credits-Refunded is the authoritative confirmation that credits were returned, and X-Credits-Charged is then0. If settlement cannot be confirmed, the API returns503 BILLING_UNAVAILABLE without the refund header. Follow the error'sretry_with_same_idempotency_key field rather than retrying by status alone.

JSON
{
  "request_id": "req_8f2c1e9a",
  "status": "continue",
  "reasoning": "The login form is visible. I'll click the email field, then type the address.",
  "actions": [
    {
      "action_type": "click",
      "params": {
        "x": 512,
        "y": 340,
        "button": "left",
        "clicks": 1
      },
      "description": "",
      "raw_code": "pyautogui.click(512, 340, clicks=1, button='left')"
    },
    {
      "action_type": "type_text",
      "params": {
        "text": "[email protected]"
      },
      "description": "",
      "raw_code": "pyautogui.write('[email protected]')"
    }
  ],
  "raw_code": [
    "pyautogui.click(512, 340, clicks=1, button='left')",
    "pyautogui.write('[email protected]')"
  ],
  "cua_version": "v5",
  "screen_width": 1920,
  "screen_height": 1080,
  "usage": {
    "input_tokens": 1523,
    "output_tokens": 245,
    "credits_charged": 6,
    "cost_cents": 6,
    "breakdown": [
      {
        "item": "base",
        "credits": 5
      },
      {
        "item": "hd_images",
        "credits": 1,
        "count": 1
      }
    ]
  }
}
FieldDescription
request_idUnique id for the call. Include it when contacting support.
statusOne of continue, done, fail.
actionsOrdered list of actions to perform this step.
reasoningThe model's explanation; an empty string when include_reasoning is false.
raw_codeAlways-present canonical debug representation regenerated from sanitized structured actions, never arbitrary model text. include_raw_code=false clears top-level raw_code to [] and per-action raw_code to an empty string. Treat action_type + params as authoritative; never evaluate this field on an external machine.
usageTokens plus the cost of the request (see the two fields below).
usage.credits_chargedDeveloper API wallet units billed (1 unit = $0.01).
usage.cost_centsUSD-cent amount, numerically equal to credits_charged; divide by 100 for USD.
API reference — Coasty Computer Use API | Coasty - AI Computer-Use Agent