Skip to content

Usage

Two ways to use Browser Use: the open-source Python library (self-run) and the hosted Cloud API v3 (verified working on this account). The Cloud API is the recommended path for production agent tasks.

Cloud API v3 (hosted, verified)

  • Base URL: https://api.browser-use.com
  • Auth header: X-Browser-Use-API-Key: bu_... (stored here as BROWSER_USE_CLOUD_API_KEY)
  • Version: v3. v2 is legacy, do not use it for new work.

Run an AI browser agent task

bash
# 1. Start a session with a natural-language task (it auto-creates a browser)
curl -X POST https://api.browser-use.com/api/v3/sessions \
  -H "X-Browser-Use-API-Key: $BROWSER_USE_CLOUD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"task":"Find the top 3 trending repos on GitHub today","model":"claude-sonnet-4.6"}'
# response: { "id": "SESSION_ID", "status": "running", "live_url": "https://..." }

# 2. Poll until the status is terminal, then read output
curl https://api.browser-use.com/api/v3/sessions/SESSION_ID \
  -H "X-Browser-Use-API-Key: $BROWSER_USE_CLOUD_API_KEY"
# response: { "status": "idle|stopped|error|timed_out", "output": ..., "step_count": N }

Poll every 2 to 5 seconds until status is no longer running. live_url is an embeddable live preview of the browser while it works.

Useful body options: model (e.g. claude-sonnet-4.6), output_schema (Pydantic schema for structured JSON results), proxy_country_code (geo routing), profile_id (load saved cookies/identity), keep_alive (reuse the session for follow-up tasks).

List browsers (non-billable auth check)

bash
curl https://api.browser-use.com/api/v3/browsers \
  -H "X-Browser-Use-API-Key: $BROWSER_USE_CLOUD_API_KEY"

SDK (auto-handles polling)

python
from browser_use_sdk.v3 import AsyncBrowserUse
client = AsyncBrowserUse()             # reads BROWSER_USE_API_KEY / X-Browser-Use-API-Key
run = client.run("Your task here")
async for msg in run:
    print(f"[{msg.role}] {msg.summary}")
print(run.result.output)               # final output

Open-source library (self-run)

bash
pip install browser-use
python
from browser_use import Agent
# drives a local browser with your own LLM key; good for dev, no Cloud account needed

Full reference: https://docs.browser-use.com/cloud/llms-full.txt