Files
browser-use/docs/quickstart.mdx
2025-08-24 19:58:19 -07:00

63 lines
931 B
Plaintext

---
title: "Quickstart"
description: ""
icon: "rocket"
---
## 1. Easy setup
Use [uv](https://docs.astral.sh/uv/) to create and activate the environment:
```bash
uv venv --python 3.12
```
```bash
# For Mac/Linux:
source .venv/bin/activate
# For Windows:
.venv\Scripts\activate
```
Install browser-use:
```bash
uv pip install browser-use
```
Install Chromium:
```bash
uvx playwright install chromium --with-deps
```
## 2. Choose your favorite LLM
Create a `.env` file and add your API key:
```bash .env
OPENAI_API_KEY=
```
See [Supported Models](/customize/supported-models) for other models.
## 3. Run your first agent
```python agent.py
from browser_use import Agent, ChatOpenAI
from dotenv import load_dotenv
import asyncio
load_dotenv()
llm = ChatOpenAI(model="gpt-4.1-mini")
task="Find the number 1 post on Show HN"
async def main():
agent = Agent(task, llm)
await agent.run()
asyncio.run(main())
```