What is the Session API?
The Session API gives you full, programmatic control over managed Chrome sessions:- Create/stop sessions on demand
- Retrieve a CDP URL to drive the browser with Playwright or Puppeteer
- Open/close tabs (targets) and query browser info
- Integrate sessions into backends, workflows, and automations
Prerequisites
- A Browser API key (from the Dashboard)
- Any HTTP client (curl/fetch) or Node.js 18+ if using the JS SDK
Option 1 — JavaScript SDK
You can use a tiny SDK to simplify session lifecycle and CDP discovery. Download the latest version here, then import it in your app.Extra SDK capabilities
The SDK you downloaded includes convenience methods you might find useful:createSession(targeting?: object)— POST /v1/consumer/session and wait until active (up to ~20s)getSessionStatus()— GET /v1/consumer/session?sessionId=…getBrowserCDPUrl()— Resolve a CDP URL suitable for Playwright/PuppeteergetBrowserInfo()— GET /json/version raw fields from the remote browsercreatePage(url?: string)— Open a new tab/target (defaultabout:blank)closePage(targetId: string)— Close a tab/targetendSession()— DELETE /v1/consumer/session?sessionId=…
Option 2 — REST API (fetch/curl)
You can call the REST endpoints directly if you prefer no SDK.1) Create a session
2) Wait for the session to become active
3) Get a CDP URL
Once the session is active, request the remote browser info and read thewebSocketDebuggerUrl.
webSocketDebuggerUrl (e.g., ws://127.0.0.1/devtools/browser/...).
Construct an external CDP URL by swapping the prefix:
4) Open a new page (tab)
5) Stop the session
Timeouts, retries, and tips
- Session activation: allow up to ~20 seconds for the browser to boot on cold nodes
- The SDK internally retries
createSessionup to 3 times with small backoff and waits foractive - CDP URLs expire with the session; create a new session to get a fresh URL
- For long-running automations, reconnect your client if the network blips — the remote browser keeps running until you stop it
See also
- Quickconnect (zero-config CDP): /browser-api/using-quickconnect
- CDP + Playwright/Puppeteer guide: /browser-api/guides/cdp-playwright
- Agent API quickstart: /agent-api/quickstart