API Guide
REST endpoints for creating sessions, starting runs, and checking their status. All endpoints return JSON. Replace{threadId} and {runId} with values from previous calls.
Authentication & Headers
- Every request must include
Authorization: Bearer <API_KEY>; keys are provisioned per workspace and can be rotated without downtime. - Use
X-Client-Id(optional) if you need multi-tenant attribution in logs. - Requests without valid credentials return
401.
Standard Error Format
All non-2xx responses follow the same envelope:Rate Limits & Timeouts
- Default limit is 60 requests/min per API key. Responses include
X-RateLimit-RemainingandRetry-Afterwhen throttled (HTTP 429). - Long running run-creation calls keep the HTTP connection open for up to 15s; sandbox work continues asynchronously.
- Web clients should back off exponentially on 429/5xx responses.
Sandbox Lifecycle
- Runs surface current sandbox info in
metadataand thread metadata so that external clients can reattach to desktops. sandboxStatustransitions:initializing→ provisioning requestedready→ desktop reachable;sandboxId&vncUrlvalidrestored→ existing sandbox reusedfailed→ provisioning failed; no desktop available
- Extend lifetime using
/api/sandbox/extend; repeated calls before expiry stack 15-minute increments.
Endpoints
Create a session
POST /api/sessions
Body
Get a session
GET /api/sessions/{threadId}
Response (200)
Start a run in a session
POST /api/sessions/{threadId}/runs
Body
Get a run
GET /api/sessions/{threadId}/runs/{runId}
Response (200)
Extend sandbox lifetime
POST /api/sandbox/extend
Body