LelantosLelantos

Browser Sandboxes

Browser-native sandboxes for automation, reconnect, and artifacts

These endpoints are a thin translation layer over POST /sandboxes: the browser engine value selects which uni-browser template backs the sandbox, and the response is projected into the browser-sandbox shape. Most users should drive these through the Browser SDK rather than calling REST directly.

Endpoint fields

Three fields on a browser-sandbox record are the keys to actually using it:

  • wsEndpoint - the CDP WebSocket URL, wss://{sandboxID}.{domain}/cdp. Connect a raw CDP client (Playwright, Puppeteer) here. See the CDP wire contract.
  • ndjsonEndpoint - the NDJSON action API URL, wss://{sandboxID}.{domain}/ndjson. Drive the browser with high-level verbs, no Playwright. See the RPC wire contract.
  • accessToken - the bearer token for both endpoints, sent as Sec-WebSocket-Protocol: bearer.<token> on the upgrade (token-in-URL is rejected). It is returned on create and on get/list for a running or paused sandbox, so a client that lost it can reconnect.

Artifact download

The artifact list and upload endpoints are below. The artifact byte-download route is registered outside this OpenAPI surface, so it is not rendered here:

GET /browser-sandboxes/{sandboxID}/artifacts/{artifactID}

It is the target of each artifact's downloadURL. Fetch it with your normal auth headers; bytes are always served as an attachment (Content-Disposition: attachment, nosniff). See Browser Concepts → Artifacts.

Suspend / resume is a vCPU freeze, not durable snapshot/restore. POST …/suspend and POST …/resume perform an in-RAM pause (identical to a regular sandbox pause); browser sandboxes do not support durable pause/recover. To keep a session, stay connected or reconnect with lel.browser.connect(sandboxId). See Browser Concepts.

List browser sandboxes

GET
/browser-sandboxes
X-API-Key<token>

In: header

Response Body

application/json

application/json

application/json

curl -X GET "https://api.lelantos.ai/browser-sandboxes"
[
  {
    "browserSandboxID": "string",
    "sandboxID": "string",
    "templateID": "string",
    "browser": "firefox",
    "status": "provisioning",
    "createdAt": "2019-08-24T14:15:22Z",
    "expiresAt": "2019-08-24T14:15:22Z",
    "domain": "string",
    "wsEndpoint": "string",
    "ndjsonEndpoint": "string",
    "accessToken": "string",
    "capabilities": [
      "string"
    ],
    "metadata": {
      "property1": "string",
      "property2": "string"
    }
  }
]
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

Create a browser sandbox

POST
/browser-sandboxes
X-API-Key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.lelantos.ai/browser-sandboxes" \  -H "Content-Type: application/json" \  -d '{}'
{
  "browserSandboxID": "string",
  "sandboxID": "string",
  "templateID": "string",
  "browser": "firefox",
  "status": "provisioning",
  "createdAt": "2019-08-24T14:15:22Z",
  "expiresAt": "2019-08-24T14:15:22Z",
  "domain": "string",
  "wsEndpoint": "string",
  "ndjsonEndpoint": "string",
  "accessToken": "string",
  "capabilities": [
    "string"
  ],
  "metadata": {
    "property1": "string",
    "property2": "string"
  }
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

Get browser sandbox detail

GET
/browser-sandboxes/{sandboxID}
X-API-Key<token>

In: header

Path Parameters

sandboxID*string

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://api.lelantos.ai/browser-sandboxes/string"
{
  "browserSandboxID": "string",
  "sandboxID": "string",
  "templateID": "string",
  "browser": "firefox",
  "status": "provisioning",
  "createdAt": "2019-08-24T14:15:22Z",
  "expiresAt": "2019-08-24T14:15:22Z",
  "domain": "string",
  "wsEndpoint": "string",
  "ndjsonEndpoint": "string",
  "accessToken": "string",
  "capabilities": [
    "string"
  ],
  "metadata": {
    "property1": "string",
    "property2": "string"
  }
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

Delete a browser sandbox

DELETE
/browser-sandboxes/{sandboxID}
X-API-Key<token>

In: header

Path Parameters

sandboxID*string

Response Body

application/json

application/json

application/json

curl -X DELETE "https://api.lelantos.ai/browser-sandboxes/string"
Empty
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

Suspend a browser sandbox

POST
/browser-sandboxes/{sandboxID}/suspend
X-API-Key<token>

In: header

Path Parameters

sandboxID*string

Response Body

application/json

application/json

application/json

curl -X POST "https://api.lelantos.ai/browser-sandboxes/string/suspend"
Empty
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

Resume a browser sandbox

POST
/browser-sandboxes/{sandboxID}/resume
X-API-Key<token>

In: header

Path Parameters

sandboxID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

body?unknown

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.lelantos.ai/browser-sandboxes/string/resume" \  -H "Content-Type: application/json" \  -d '{}'
{
  "browserSandboxID": "string",
  "sandboxID": "string",
  "templateID": "string",
  "browser": "firefox",
  "status": "provisioning",
  "createdAt": "2019-08-24T14:15:22Z",
  "expiresAt": "2019-08-24T14:15:22Z",
  "domain": "string",
  "wsEndpoint": "string",
  "ndjsonEndpoint": "string",
  "accessToken": "string",
  "capabilities": [
    "string"
  ],
  "metadata": {
    "property1": "string",
    "property2": "string"
  }
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

List browser contexts on a sandbox

GET
/browser-sandboxes/{sandboxID}/contexts
X-API-Key<token>

In: header

Path Parameters

sandboxID*string

Response Body

application/json

application/json

application/json

curl -X GET "https://api.lelantos.ai/browser-sandboxes/string/contexts"
{
  "contexts": [
    {
      "contextId": "string",
      "hasProxy": true,
      "pageCount": 0
    }
  ]
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

Create a browser context (optionally BYO-proxied) on a running browser sandbox

POST
/browser-sandboxes/{sandboxID}/contexts
X-API-Key<token>

In: header

Path Parameters

sandboxID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.lelantos.ai/browser-sandboxes/string/contexts" \  -H "Content-Type: application/json" \  -d '{}'
{
  "contextId": "string",
  "hasProxy": true,
  "pageCount": 0
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

Close a browser context

DELETE
/browser-sandboxes/{sandboxID}/contexts/{contextID}
X-API-Key<token>

In: header

Path Parameters

sandboxID*string
contextID*string

Response Body

application/json

application/json

application/json

curl -X DELETE "https://api.lelantos.ai/browser-sandboxes/string/contexts/string"
{
  "closed": true
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

List persisted artifacts for a browser sandbox

GET
/browser-sandboxes/{sandboxID}/artifacts
X-API-Key<token>

In: header

Path Parameters

sandboxID*string

Response Body

application/json

application/json

application/json

curl -X GET "https://api.lelantos.ai/browser-sandboxes/string/artifacts"
{
  "artifacts": [
    {
      "artifactID": "string",
      "kind": "screenshot",
      "createdAt": "2019-08-24T14:15:22Z",
      "downloadURL": "string",
      "contentType": "string",
      "sizeBytes": 0
    }
  ]
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

Persist a client-captured artifact into the server-side artifact store

POST
/browser-sandboxes/{sandboxID}/artifacts
X-API-Key<token>

In: header

Path Parameters

sandboxID*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.lelantos.ai/browser-sandboxes/string/artifacts" \  -H "Content-Type: application/json" \  -d '{    "kind": "screenshot",    "dataBase64": "string"  }'
{
  "artifactID": "string",
  "kind": "screenshot",
  "createdAt": "2019-08-24T14:15:22Z",
  "downloadURL": "string",
  "contentType": "string",
  "sizeBytes": 0
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}

List replay timeline events for a browser sandbox

GET
/browser-sandboxes/{sandboxID}/replay-events
X-API-Key<token>

In: header

Path Parameters

sandboxID*string

Response Body

application/json

application/json

application/json

curl -X GET "https://api.lelantos.ai/browser-sandboxes/string/replay-events"
{
  "events": [
    {
      "eventID": "string",
      "kind": "lifecycle",
      "message": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "metadata": {
        "property1": "string",
        "property2": "string"
      }
    }
  ]
}
{
  "code": 0,
  "message": "string"
}
{
  "code": 0,
  "message": "string"
}