1. Fast setup

create environment
uv venv --python 3.12
activate environment
source .venv/bin/activate
install browser-use & chromium
uv pip install browser-use
uvx playwright install chromium --with-deps 

2. Choose your favorite LLM

Create a .env file and add your API key. Don’t have one? Start with a free Gemini key.
create .env file
touch .env
add your key to .env file
GEMINI_API_KEY=
See Supported Models for more.

3. Run your first agent

agent.py
from browser_use import Agent, ChatGoogle
from dotenv import load_dotenv
import asyncio

load_dotenv()

async def main():
    llm = ChatGoogle(model="gemini-2.5-flash")
    task = "Find the number 1 post on Show HN"
    agent = Agent(task=task, llm=llm)
    await agent.run()

if __name__ == "__main__":
    asyncio.run(main())