Skip to main content

1. Fast setup

  • uv
  • pip
create environment
uv venv --python 3.12
  • Mac/Linux
  • Windows
activate environment
source .venv/bin/activate
  • uv
  • pip
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.
  • Mac/Linux
  • Windows
create .env file
touch .env
  • Google
  • OpenAI
  • Anthropic
add your key to .env file
GEMINI_API_KEY=
See Supported Models for more.

3. Run your first agent

  • Google
  • OpenAI
  • Anthropic
agent.py
from browser_use import Agent, ChatGoogle
from dotenv import load_dotenv
import asyncio

load_dotenv()

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

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