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

BROWSERBASE_API_KEY environment variable 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 prints to the console for real-time session monitoring.
Important environment variablesMake sure you have these environment variables in your
.env file:BROWSERBASE_API_KEYANTHROPIC_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 at support@browserbase.com for additional support
Browserbase and Browser Use sample code
Configure Browserbase to add additional web-browsing capabilities to your
Browser Use.