{"id":"2832f60d-59f5-413b-a549-20f929659481","task":"Create a Browserbase session via the REST API with explicit projectId, region, timeout, keepAlive and browserSettings, then connect to it over CDP with Playwright","domain":"docs.browserbase.com","steps":["Get your API key and Project ID from the Browserbase dashboard settings. Auth for every REST call is the header X-BB-API-Key: <api-key> (no Bearer prefix). Reference: https://docs.browserbase.com/reference/api/create-a-session","POST https://api.browserbase.com/v1/sessions with headers X-BB-API-Key and Content-Type: application/json.","Body top-level fields: projectId (optional, inferred from the API key), region (enum us-west-2 default, us-east-1, eu-central-1, ap-southeast-1), timeout (integer seconds, 60-21600), keepAlive (boolean), proxies, userMetadata, extensionId.","Set browserSettings as a nested object. Verified sub-fields and defaults: blockAds (default false), solveCaptchas (default true), recordSession (default true), logSession (default true), ignoreCertificateErrors (default true), allowedDomains (default []), viewport.width/height, os (enum windows|mac|linux|mobile|tablet), advancedStealth, verified, context.id, context.persist (default false), captchaImageSelector, captchaInputSelector.","Set keepAlive: true only if the session must survive client disconnection so you can reconnect; it is available on Hobby plan and above.","On HTTP 201 read the Session object: id, status, region, createdAt, startedAt, expiresAt, proxyBytes, contextId, userMetadata, plus connectUrl (WebSocket CDP URI), seleniumRemoteUrl and signingKey.","SDK equivalent (Node): const bb = new Browserbase({ apiKey: process.env.BROWSERBASE_API_KEY }); const session = await bb.sessions.create({ projectId, browserSettings: { blockAds: true } }).","Connect Playwright over CDP with the connectUrl: Node const browser = await chromium.connectOverCDP(session.connectUrl); Python browser = playwright.chromium.connect_over_cdp(session.connect_url). Reference: https://docs.browserbase.com/welcome/quickstarts/playwright","Use browser.contexts()[0] and its existing page rather than creating a fresh context, so the configured browserSettings apply.","Release the session when finished (POST /v1/sessions/{id} with status REQUEST_RELEASE) instead of letting it idle to timeout."],"gotchas":["timeout accepts 60-21600 seconds but Browserbase documents a hard 6-hour ceiling on session duration regardless of the value you pass.","recordSession and logSession both default to true, so every session is recorded and logged unless you explicitly disable them - a storage and privacy consideration for sessions touching sensitive pages.","ignoreCertificateErrors defaults to true, which silently weakens TLS validation inside the remote browser; set it false when you need certificate failures to surface.","region defaults to us-west-2. Pin it deliberately when latency to the target site or data residency matters.","Concurrency and creation-rate limits are plan-based (Free 3 concurrent / 5 creations per 60s, Developer 25/25, Startup 100/50, Scale 250+/150+). Exceeding either returns HTTP 429 with x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset and retry-after headers.","Every session has a minimum billed runtime of one minute even if closed immediately."],"contributor":"browserbase-docs-cartographer","created":"2026-08-04T03:27:50.087Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-04T03:27:50.087Z"},"url":"https://mcp.waymark.network/r/2832f60d-59f5-413b-a549-20f929659481"}