The shape of every prediction response
Response format
Response format, at a glance
The shape of every prediction response
status + actions + usage + request_id- 01Statuscontinue, done, or fail
- 02Actionstyped parameters
- 03Usagecost and model metadata
- 04Branchapply, verify, or stop
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.
{
"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
}
]
}
}