GET /v1/vision/sessions/{session_id}/cdp
Opens a WebSocket that speaks the Chrome DevTools Protocol for this session only, so Playwright (`chromium.connectOverCDP`), Puppeteer (`puppeteer.connect`) or any CDP client can drive the browser. The proxy exposes only the session's own targets. It refuses `SystemInfo.*`, `Tethering.*`, `Extensions.*`, `Cast.*`, and `Browser.*` except the methods Playwright and Puppeteer need to drive a browser (`getVersion`, the permission methods, window bounds, `setDownloadBehavior` and `cancelDownload`); host file access (`DOM.setFileInputFiles`, file drags); downloads to host paths (they land in the session's own directory, wiped with the browser); and navigation to anything but `http:`, `https:` and `about:blank` (`file:`, `chrome:`, `chrome-extension:`, `view-source:`, `devtools:`, `data:`). These answer `cdp_method_blocked` in the CDP error (`error.data.code`). `Target.createBrowserContext` with `proxyServer`, `proxyBypassList` or `originsWithUniversalNetworkAccess` answers `forbidden` (403): every context of a session uses the session's egress. Authenticate with the `Authorization` header or a ticket from `POST /v1/vision/sessions/{session_id}/ticket`. A client that falls more than a few MB behind is disconnected, and so is one that sends a message over 32 MiB. A message with a repeated member (two `method`s, say) answers the JSON-RPC parse error `-32700`.

Authentication

Bearer Token (b3os_sk_ API key or b3os_pat_ token) API Key (cookie: __Host-b3os_session) API Key (query: ticket)

Path Parameters

session_id string required path
The session ID (`brs_…`).
Example: "brs_01m5t3y30wcksxf22t9gwk9fwb"

Query Parameters

ticket string optional query
A single-use stream ticket from the resource's `POST …/ticket` operation, for clients that cannot set headers (browser `WebSocket` and `EventSource`); see the `ticket` security scheme. WebSocket clients may send it as a subprotocol instead: `Sec-WebSocket-Protocol: b3os.v1, b3os.ticket.<ticket>`. Query strings are redacted from logs.

Responses

101 Switching protocols. Messages are CDP JSON in text frames.

No response body

400 The request failed validation (`invalid_request`, `invalid_url`).
401 Missing, malformed, expired or revoked credentials (`unauthorized`).
403 Authenticated but not allowed (`forbidden`, `egress_denied`).
404 No such browser session in this project (`session_not_found`).
409 The session already closed (`session_closed`).
429 A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
500 Something failed inside B3OS (`internal`). Retry with backoff.
503 The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
curl -X GET 'https://beta-api.b3os.org/v1/vision/sessions/brs_01m5t3y30wcksxf22t9gwk9fwb/cdp' \  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta-api.b3os.org/v1/vision/sessions/brs_01m5t3y30wcksxf22t9gwk9fwb/cdp', {  method: 'GET',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN"  }});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.get('https://beta-api.b3os.org/v1/vision/sessions/brs_01m5t3y30wcksxf22t9gwk9fwb/cdp', headers=headers)print(response.json())
400 Response
{  "type": "https://docs.beta.b3os.org/errors#invalid_request",  "title": "Invalid request",  "status": 400,  "code": "invalid_request",  "detail": "1 field failed validation",  "instance": "req_01m5t4yg394wegr3j4y01qb363",  "errors": [    {      "pointer": "/url",      "detail": "must be an absolute http or https URL"    }  ]}
Ask a question... ⌘I