Skip to main content
To get started with Browser Use you need to install the package and create an .env file with your API key.
ChatBrowserUse offers the fastest and most cost-effective models, completing tasks 3-5x faster. Get started with $10 of free LLM credits.

1. Installing Browser-Use

create environment
pip install uv
uv venv --python 3.12
activate environment
source .venv/bin/activate
# On Windows use `.venv\Scripts\activate`
install browser-use & chromium
uv pip install browser-use
uvx browser-use install

2. Choose your favorite LLM

Create a .env file and add your API key.
We recommend using ChatBrowserUse which is optimized for browser automation tasks (highest accuracy + fastest speed + lowest token cost). Don’t have one? We give you $10 to try it out here.
.env
touch .env
On Windows, use echo. > .env
Then add your API key to the file.
# add your key to .env file
BROWSER_USE_API_KEY=
# Get 10$ of free credits at https://cloud.browser-use.com/new-api-key
See Supported Models for more.

3. Run your first agent

from browser_use import Agent, ChatBrowserUse
from dotenv import load_dotenv
import asyncio

load_dotenv()

async def main():
    llm = ChatBrowserUse()
    task = "Find the number 1 post on Show HN"
    agent = Agent(task=task, llm=llm)
    await agent.run()

if __name__ == "__main__":
    asyncio.run(main())
Custom browsers can be configured in one line. Check out browsers for more.

4. Going to Production

Sandboxes are the easiest way to run Browser-Use in production. We handle agents, browsers, persistence, auth, cookies, and LLMs. It’s also the fastest way to deploy - the agent runs right next to the browser, so latency is minimal. To run in production with authentication, just add @sandbox to your function:
from browser_use import Browser, sandbox, ChatBrowserUse
from browser_use.agent.service import Agent

@sandbox(cloud_profile_id='your-profile-id')
async def production_task(browser: Browser):
    agent = Agent(task="Your authenticated task", browser=browser, llm=ChatBrowserUse())
    await agent.run()

await production_task()
See Going to Production for how to sync your cookies to the cloud.