Quickstart
-
Create a secret key. In the dashboard, open Connect and create a secret key (
sk_…). Keep it on your server: it spends your organization’s balance.Terminal window export BROWSER_USE_API_KEY=sk_...The variable has Browser Use’s name so that its SDKs pick it up as they are. Any name works.
-
Install a client. BrowserReal speaks plain HTTP. With Python, Browser Use’s SDK saves you writing the calls. Drive the browser with the Playwright, Puppeteer or Browser Use you already use, as they are: there is no browser to download, and nothing to patch for stealth.
Terminal window pip install browser-use-sdk playwrightTerminal window npm i playwright -
Start a browser, use it, stop it.
import asyncio, osfrom browser_use_sdk.v4 import AsyncBrowserUsefrom playwright.async_api import async_playwrightasync def main():async with AsyncBrowserUse(api_key=os.environ["BROWSER_USE_API_KEY"],base_url="https://api.datum.org/api/v4",) as client:browser = await client.browsers.create(timeout=15)try:async with async_playwright() as p:chrome = await p.chromium.connect_over_cdp(browser.cdp_url)page = await chrome.contexts[0].new_page()await page.goto("https://example.com")print(await page.title())finally:await client.browsers.stop(browser.id) # saves the profile, ends the billingasyncio.run(main())import { chromium } from 'playwright';const api = (path: string, init: RequestInit = {}) =>fetch(`https://api.datum.org/api/v4${path}`, {...init,headers: { 'X-Browser-Use-API-Key': process.env.BROWSER_USE_API_KEY!, 'Content-Type': 'application/json' },}).then(response => response.json());const browser = await api('/browsers', { method: 'POST', body: JSON.stringify({ timeout: 15 }) });const chrome = await chromium.connectOverCDP(browser.cdpUrl);try {const page = await chrome.contexts()[0].newPage();await page.goto('https://example.com');console.log(await page.title());} finally {await chrome.close(); // your connection onlyawait api(`/browsers/${browser.id}`, { method: 'PATCH', body: JSON.stringify({ action: 'stop' }) });}Terminal window curl -X POST https://api.datum.org/api/v4/browsers \-H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY" \-H "Content-Type: application/json" \-d '{"timeout": 15}'# → { "id": "…", "cdpUrl": "wss://…", "liveUrl": "https://…", … }curl -X PATCH https://api.datum.org/api/v4/browsers/BROWSER_ID \-H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY" \-H "Content-Type: application/json" \-d '{"action": "stop"}' -
Watch it. Open the browser’s
liveUrl, or find it on the dashboard’s Sessions page, to see the screen and take control yourself. Every session, with its cost and recording, is in History.
With a Browser Use agent
Section titled “With a Browser Use agent”Hand the browser to a Browser Use agent by its CDP address:
from browser_use import Agent, Browser, ChatAnthropic
agent = Agent( task="Find the top story on news.ycombinator.com", llm=ChatAnthropic(model="claude-sonnet-4-5"), browser=Browser(cdp_url=browser.cdp_url),)await agent.run()- Stay signed in between runs with a profile.
- Browse from a country with a residential proxy.
- See every option of
POST /browsers.