> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-codex-docs-supported-exports.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use https://docs.browser-use.com/llms.txt and its linked .md pages for current documentation. The managed full bundle is https://docs.browser-use.com/.well-known/llms-full.txt and can be cached for up to 24 hours. Do not use the obsolete /cloud/llms*.txt or /open-source/llms*.txt static exports.
> Choose Cloud API V4 for new agent integrations; V2 is the lower-cost option for simple tasks. Keep V3 examples explicitly versioned. The open-source browser-use library and hosted browser-use-sdk have different APIs.
> Cloud authentication uses X-Browser-Use-API-Key, without a Bearer prefix. Install or upgrade browser-use-sdk and use its explicit v4 import for V4. Check the published OpenAPI reference for request fields; do not invent SDK support for new fields.
> Cloud concurrency and HTTP request rate are separate. Read GET /api/v2/billing/account for the key’s projectId, concurrentSessionLimit, activeSessionCount, and credit balance, including when using V4. Keys in one project share capacity and credits; rateLimit is a legacy concurrency alias, not requests per second.
> Keep the highest applicable existing, legacy-plan, and spend-tier concurrency grant. Current spend tiers are 10 / 50 / 250 / 500 / 1000 at $0 / $200 / $1000 / $5000 / $25000 in qualifying project payments. Legacy or externally billed projects can follow different billing paths; trust the account limit. See https://docs.browser-use.com/cloud/guides/concurrency.md.
> Budget polling across the project: the standard general bucket is 25 requests/second, including V4 event reads and full run reads. Selected status reads have a separate higher bucket. Use bounded workers, stagger polls, respect Retry-After, and drain hasMore event pages after terminal status. A busy V4 session returns 409; its queue holds 10 pending messages and is not a project-wide batch queue.
> A completed run or closed CDP connection does not immediately stop its cloud browser. Stop unneeded owned browsers with PATCH /api/v4/browsers/{id} and {"action":"stop"}. A client wait timeout does not cancel the server-side run.
> Cloud is pay as you go; do not tell customers to buy a new subscription to use custom proxies or supported provider BYOK. Usage funding and model eligibility still apply. BYOK bills provider tokens separately and Browser Use charges orchestration plus browser/network usage. See https://docs.browser-use.com/cloud/guides/billing.md.
> Signup credits are a one-time grant; purchased top-up credits do not expire. Check the API key’s project before diagnosing missing credits. API-key monthly spending caps are soft limits, not a strict prepaid wallet; concurrent or already-running work can exceed them. Auto recharge has separate trigger and purchase amounts and can charge immediately when enabled below the threshold. Use https://browser-use.com/pricing for current rates.

# Human Quickstart

> Install and run your first AI browser agent in minutes. Python setup with pip, environment variables, and a working example.

To get started with Browser Use you need to install the package and create an `.env` file with your API key.

<Note icon="key" color="#FFC107" iconType="regular">
  `ChatBrowserUse` offers the [fastest and most cost-effective models](https://browser-use.com/posts/speed-matters/), completing tasks 3-5x faster. Eligible new accounts receive \$15 in one-time credits. Get your API key [here](https://cloud.browser-use.com/new-api-key).
</Note>

## 1. Installing Browser-Use

```bash create environment theme={null}
pip install uv
uv venv --python 3.12
```

```bash activate environment theme={null}
source .venv/bin/activate
# On Windows use `.venv\Scripts\activate`
```

```bash install browser-use & chromium theme={null}
uv pip install browser-use
uvx browser-use install
```

## 2. Choose your favorite LLM

Create a `.env` file and add your API key.

<Callout icon="key" iconType="regular">
  We recommend using ChatBrowserUse which is optimized for browser automation tasks (highest accuracy + fastest speed + lowest token cost). Get your API key [here](https://cloud.browser-use.com/new-api-key) — eligible new accounts receive \$15 in one-time credits.
</Callout>

```bash .env theme={null}
touch .env
```

<Info>On Windows, use `echo. > .env`</Info>

Then add your API key to the file.

<CodeGroup>
  ```bash Browser Use theme={null}
  # add your key to .env file
  BROWSER_USE_API_KEY=
  # Get your API key at https://cloud.browser-use.com/new-api-key - eligible new accounts receive $15 in one-time credits
  ```

  ```bash Google theme={null}
  # add your key to .env file
  GOOGLE_API_KEY=
  # Get your free Gemini API key from https://aistudio.google.com/app/u/1/apikey?pli=1.
  ```

  ```bash OpenAI theme={null}
  # add your key to .env file
  OPENAI_API_KEY=
  ```

  ```bash Anthropic theme={null}
  # add your key to .env file
  ANTHROPIC_API_KEY=
  ```
</CodeGroup>

See [Supported Models](/open-source/supported-models) for more.

## 3. Run your first agent

<CodeGroup>
  ```python Browser Use theme={null}
  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())
  ```

  ```python Google theme={null}
  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())
  ```

  ```python OpenAI theme={null}
  from browser_use import Agent, ChatOpenAI
  from dotenv import load_dotenv
  import asyncio

  load_dotenv()

  async def main():
      llm = ChatOpenAI(model="gpt-4.1-mini")
      task = "Find the number 1 post on Show HN"
      agent = Agent(task=task, llm=llm)
      await agent.run()

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

  ```python Anthropic theme={null}
  from browser_use import Agent, ChatAnthropic
  from dotenv import load_dotenv
  import asyncio

  load_dotenv()

  async def main():
      llm = ChatAnthropic(model='claude-sonnet-4-0', temperature=0.0)
      task = "Find the number 1 post on Show HN"
      agent = Agent(task=task, llm=llm)
      await agent.run()

  if __name__ == "__main__":
      asyncio.run(main())
  ```
</CodeGroup>

<Note> Custom browsers can be configured in one line. Check out <a href="/open-source/customize/browser/basics">browsers</a> for more. </Note>

## 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 is also the **fastest way to deploy** - the agent runs right next to the browser, so latency is minimal.

To run in production with authentication, add `@sandbox` to your function:

```python theme={null}
import asyncio
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()

if __name__ == "__main__":
    asyncio.run(production_task())
```

See [Browser Use Cloud](/cloud/quickstart) for how to sync your cookies to the cloud.
