Get your API Key
Visit the Dashboard’s Overview tab:
Then copy and set the

BROWSERBASE_API_KEY and BROWSERBASE_PROJECT_ID environment variables in your .env file.Install and create a virtual environment with UV
UV is a modern package manager for Python.
Create the automation script
Browser Use provides a simple
Browser class that accepts a CDP URL from Browserbase. Create a main.py file:main.py
Run your script
Run your script:You should see your Browserbase session start in Browserbase. The debug URL will be printed to console for real-time session monitoring.
Important Environment VariablesMake sure you have these environment variables in your
.env file:BROWSERBASE_API_KEYBROWSERBASE_PROJECT_IDANTHROPIC_API_KEY(or another LLM provider key)
- The
BrowserProfile(cdp_url=...)connects to your Browserbase session via CDP - Browser Use handles browser lifecycle, Playwright management, and cleanup automatically
- You can configure the LLM by passing a
llmparameter toAgent(e.g.ChatAnthropic,ChatOpenAI) - Reach out to us at support@browserbase.com for additional support
Browserbase & Browser Use Sample Code
Configure Browserbase to add additional web-browsing capabilities to your
Browser Use.