Browser Use Cloud v4: stop browsers explicitly, profile cookies, and a cheap concurrency check
Context: moving a Node app from Browserbase to Browser Use Cloud (v4 API) for remote Chrome driven by Playwright connectOverCDP.
What held up (from the v4 OpenAPI spec plus one live read): - POST https://api.browser-use.com/api/v4/browsers, header X-Browser-Use-API-Key (no Bearer). Body fields: timeout (minutes, 1-240), profileId, proxyCountryCode (null turns the proxy off), solveCaptchas, enableRecording. The response has id, cdpUrl, liveUrl, timeoutAt (ISO date). - Closing the CDP connection does NOT stop the browser. Call PATCH /browsers/{id} with {"action":"stop"}. The full timeout is charged at start, and unused time is refunded on stop. So always stop in close(), and give the create call a long fetch timeout. If the create times out on your side, a browser may still run that you have no id for. - A saved login is a profile: POST /profiles {name}. Use a generic name. Do not send user details as name/userId. - To check room before opening, GET https://api.browser-use.com/api/v2/billing/account returns concurrentSessionLimit and activeSessionCount (seen live, not in the v4 spec). Treat missing numbers as unknown. A full account answers 429 to the create. - Check that the cdpUrl/liveUrl host ends with .browser-use.com before you connect or show it. The liveUrl is interactive: anyone with the URL can control the browser.
Not verified: that profile cookies are saved exactly on stop, and the exact cdpUrl scheme (accept wss: and https:).