latestOpenAPI 3.1.0MIT2026-08-0481194343.8 KB

f50d93b0d8a1

sessions

Predict within an existing session

Managed-inference base: 4 credits per stateful prediction. The same trajectory-image, HD current/trajectory image, v1-engine, and combined system_prompt + trimmed instructions (>500 characters) surcharges as POST /v1/predict can apply; the stateful trajectory surcharge uses the provider-visible post-compaction image count. A session created with BYOK inherits that provider/key for every predict and debits zero Coasty platform credits while returning actual provider tokens. Session predict is a direct CUA primitive and remains provider-direct under a test Coasty key only when session create supplied the explicit per-request X-LLM-Api-Key; the provider account can then be billed. Test auth never resolves a stored live provider key for the session. Read effective deployed pricing from GET /v1/models under pricing.

post/v1/sessions/{session_id}/predict

Headers

Idempotency-Keystring

Optional client-supplied key (≤128 chars, [A-Za-z0-9_-:]) for safe retries. Keys are global within one concrete API-key credential plus live/test mode; never reuse one on another endpoint. 'Same request' = a SHA-256 of an explicit operation discriminator plus the canonical (sorted-key) JSON body (session_id is folded in for /sessions/{id}/predict). LLM-capable operations also bind the non-secret effective provider, role models, and one-way provider-key fingerprint; plaintext provider keys never enter the hash or replay record. Replays the response for 24 h when operation, body, and effective execution identity match (X-Coasty-Idempotent-Replay: true and X-Credits-Charged: 0). Action screenshot pixels are response-only and deliberately omitted from replay storage; a replay retains frame_id but returns screenshot=null and observation_available=false. Inference replays also set body usage.credits_charged=0 and usage.billed=false; machine-snapshot bodies retain the original gross charge for auditability. A retry while the original is still running waits up to ~25 s then returns the result, otherwise 409 IDEMPOTENCY_IN_FLIGHT (retry with the SAME key). Returns 422 IDEMPOTENCY_KEY_REUSED if any bound input differs. Rotating the API key starts a new replay namespace. Collect a lost result via GET /v1/idempotency/{key} using the original credential.

Request body

instructionstring required
include_reasoningboolean
include_raw_codeboolean

Response

Predicted actions for the next step.

request_idstring required
session_idstring required
stepinteger required
actionsActionResponse[] required— unresolved $ref
raw_codestring[]
reasoningstring
status'continue' | 'done' | 'fail' required

Authoritative model loop-control claim for this session step. done may describe the observed state or the proposed step outcome and may coexist with mutating actions; it is not proof of persistence and does not close the session. Execute only admitted actions, capture a fresh post-action screenshot, verify application state, then DELETE or reset the session at the intended flow boundary.

cua_versionstring nullable

Echo: the CUA engine version that actually served this step (e.g. "v5").