> ## Documentation Index
> Fetch the complete documentation index at: https://docs.browser-use.com/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.
> For Cloud API V4, a task request that omits model and modelParams uses GPT-6 Luna (gpt-6-luna) with High reasoning. Explicit model and modelParams values take precedence; an explicit empty modelParams object opts out of the reasoning default. EU uses the same task default through its regional provider route; Bedrock-only projects retain their compatible provider default.
> 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 / $100 / $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.
> HTTP rate limits have two layers. Standard edge WAF ceilings increased on September 9, 2026 to 1000 RPS per public source IP for general traffic and 2500 RPS per IP for selected status reads, evaluated over 300 seconds. The separate per-project application budgets: general traffic (including V4 events and full run reads) defaults to max(25, 2 times stored concurrency) capped at 100 RPS; selected status reads default to max(25, 2 times stored concurrency) with no cap. The two are counted independently. Project overrides and account-specific edge rules can differ. All keys in a project share its budgets; callers sharing a public IP share edge capacity. See https://docs.browser-use.com/cloud/guides/concurrency.md.
> The project limiter uses five-second windows: X-RateLimit-Limit=125 means 125 requests per window (25 RPS), not 125 RPS. Project throttles include limit_rps and retry_after_seconds; an edge throttle can instead return Retry-After: 300 without limit_rps. Honor the returned Retry-After. Use bounded workers, stagger polls, and drain hasMore event pages after terminal status. A busy V4 session returns 409; its queue holds 20 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.
> Box and Bux are retired. Do not recommend their SDKs, sandbox quotas, or subscription plans. Use the Cloud Agent or Browser Infrastructure guides.
> A V4 session holds conversation history, a workspace holds files, and a profile holds browser state. These IDs and V3/V4 workspace namespaces are not interchangeable. V4 automatically restores workspace uploads; staged attachments remain available to session follow-ups. Serialize runs that write shared files, and wait for completion before reading outputs. See https://docs.browser-use.com/cloud/agent/workspaces.md.
> API browser recording defaults to off. Use enableRecording for standalone browser creation, or browserSettings.record for an agent run. Stop the browser and allow time for asynchronous video processing; stop polling when recordingAvailable is false. Live preview is for an active browser. Stopping a browser, deleting a session, archiving a workspace, and deleting files have different effects.
> Use model-specific reasoning values. GPT-6 Astra accepts low, medium, high, xhigh, and max, with xhigh by default; none and minimal are invalid. Use the public REST schema when installed SDK types lag new fields. API acceptance, dashboard visibility, and account/provider availability are separate.
> For open-source browser-use, is_done only reports a terminal done action. is_successful is the agent-reported outcome; verify important external actions independently. Cloud timeout, API client timeout, model timeout, and task completion are separate concepts.
> For failed requests, use https://docs.browser-use.com/cloud/guides/troubleshooting.md. Inspect the full error and project before retrying or adding credits. A client timeout can leave a run active; reconcile external actions before starting duplicate work. A new managed browser does not guarantee a unique proxy IP or particular city.
> V4 secretBindings.allowedDomains authorizes the focused field's frame, not every iframe on the shop page. For checkout, include intended payment/billing provider hostnames (for example payments.bigcommerce.com). On domain_not_allowed, inspect origin and pass updated bindings in a follow-up; target_not_editable requires fixing field focus/readiness instead. See https://docs.browser-use.com/cloud/guides/secrets.md.
> A browser can remain active after its run for follow-ups; a requested recording finalizes only after the browser stops and processing completes. Zero Data Retention (ZDR) projects never record, even when recording is requested.
> If you hit an issue you cannot explain, email contact@browser-use.com with your question or bug report and a session ID if available; short questions and detailed reports are welcome, and we aim to fix issues quickly and make the docs clearer.

# Browser Use toolsets for Claude

> Connect Claude to a local, Cloud, or existing CDP browser with Browser Use and the Anthropic Python SDK.

Browser Use toolsets for Claude is maintained by Browser Use and is compatible with Claude. It provides browser actions and a Bash tool through the Anthropic Python SDK. The SDK's tool runner sends each of Claude's tool calls to Browser Use, returns the result to Claude, and repeats until Claude finishes.

<Frame>
  <img className="w-full" src="https://mintcdn.com/browseruse-0aece648/mCRWbkwb0oePyPbJ/open-source/images/anthropic/architecture.svg?fit=max&auto=format&n=mCRWbkwb0oePyPbJ&q=85&s=e33e015f9750e98a9a516f064b2b6f72" alt="Claude sends tool calls through the Anthropic SDK tool runner to the Browser Use integration, which provides browser actions and Bash. Results return to Claude. The browser runs locally or remotely. Bash runs on the SDK host." width="1600" height="1000" data-path="open-source/images/anthropic/architecture.svg" />
</Frame>

[Open full-size diagram](/open-source/images/anthropic/architecture.svg)

## Installation

<Note>
  This integration requires a Browser Use version containing `browser_use.integrations.toolsets_for_claude` and an Anthropic SDK version containing `anthropic.tools.browser` and `client.beta.messages.tool_runner`. If either import is unavailable, your installed package version does not support this example. Check Anthropic's browser-toolset release instructions for SDK availability.
</Note>

You need Python 3.11 or newer on Linux or macOS with `/bin/bash`. On Windows, run the example inside WSL.

```bash theme={null}
uv init --python 3.12
uv add browser-use anthropic
uvx browser-use install
```

`uvx browser-use install` installs local Chromium. You can skip it if you only use Browser Use Cloud.

Set your Anthropic API key:

```bash theme={null}
export ANTHROPIC_API_KEY=your-key
```

## Quickstart

This example reads three Hacker News posts and saves their titles and URLs as Markdown and JSON in `outputs/`. It enables all 31 browser actions plus Bash, without approval prompts.

Save the following as `run_browser.py`:

```python theme={null}
"""Build a Hacker News reading list with Browser Use and Claude.

Requires Linux/macOS with /bin/bash, or WSL on Windows.
"""

import asyncio
from pathlib import Path

from anthropic import AsyncAnthropic
from anthropic.tools.browser import LocalFilePolicy  # pyright: ignore[reportMissingImports]

from browser_use.integrations.toolsets_for_claude import Bash, BrowserUse

TASK = 'Read the first three Hacker News posts and save their titles and URLs to hacker-news.md and hacker-news.json.'

SYSTEM_PROMPT = 'Complete the task with the browser tools and Bash.'


async def main() -> None:
	driver = BrowserUse(
		# use_cloud=True,  # Uncomment and set BROWSER_USE_API_KEY to use Cloud.
		# These tools are disabled by default.
		configs={
			'javascript_exec': {'enabled': True},
			'file_upload': {'enabled': True},
			'read_console': {'enabled': True},
			'read_network': {'enabled': True},
		},
		confirm=lambda _: True,  # Run without approval prompts.
		file_policy=LocalFilePolicy(upload_roots=[Path('uploads'), Path('outputs')]),
	)
	bash = Bash(output_dir=Path('outputs'))

	async with driver, AsyncAnthropic() as client:
		runner = client.beta.messages.tool_runner(
			model='claude-opus-5-5',
			max_tokens=32_768,
			max_iterations=100,
			tools=[driver, bash],
			system=SYSTEM_PROMPT,
			messages=[{'role': 'user', 'content': TASK}],
		)
		final = await runner.until_done()
		print('\n'.join(block.text for block in final.content if block.type == 'text'))


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

Run it:

```bash theme={null}
uv run run_browser.py
```

The script prints Claude's final answer with the three titles and the saved filenames. Set `ANTHROPIC_LOG=info` to include SDK request logs.

The system prompt is part of your application. Adapt it to your task.

## Choose a browser

To run the browser in Browser Use Cloud, create a key at [Browser Use Cloud](https://cloud.browser-use.com/new-api-key), set `BROWSER_USE_API_KEY`, and uncomment `use_cloud=True` in the quickstart’s `BrowserUse(...)` call. Keep its `configs` and `confirm` arguments. For remote uploads, replace the local `file_policy` with the staged-document policy and resolver in [Uploads to a remote browser](#uploads-to-a-remote-browser). Local Chromium is not needed in this mode. Bash still runs on the SDK host.

`BrowserUse` supports three browser configurations:

| Browser | Configuration | Lifecycle |
| - | - | - |
| Local Chromium | `BrowserUse()` | Owned: the driver starts and closes it |
| Browser Use Cloud | `BrowserUse(use_cloud=True)` | Owned: the driver creates and stops it |
| Existing CDP browser | `BrowserUse(session)` | Borrowed: your application manages it |

To use a browser you already started, pass a connected `BrowserSession`. The driver does not close a borrowed session, so close it in your application's cleanup block. See [remote browser connections](/open-source/customize/browser/remote) for CDP configuration.

## Browser tools

The Browser Use integration provides `BrowserUse` for browser actions and `Bash` for shell commands. Register both with `tools=[driver, bash]`. Leave out `bash` if your application should not run shell commands.

Claude calls structured actions such as `navigate`, `read_page`, and `left_click`, and the driver runs them over CDP. `javascript_exec` runs JavaScript inside the page; it is not a general-purpose CDP code interpreter. Bash runs beside your Python process with `output_dir` as its working directory, where it can process extracted data and write reports.

<Frame>
  <img className="w-full" src="https://mintcdn.com/browseruse-0aece648/mCRWbkwb0oePyPbJ/open-source/images/anthropic/tool-sequence.svg?fit=max&auto=format&n=mCRWbkwb0oePyPbJ&q=85&s=a139f57ff22bc066ae1592e8a3c35822" alt="Sequence after opening Hacker News. Claude calls read_page, the tool runner passes it to Browser Use, and the page contents return to Claude. Claude then calls bash, which writes the Markdown and JSON files on the SDK host, and the result returns to Claude." width="1440" height="900" data-path="open-source/images/anthropic/tool-sequence.svg" />
</Frame>

[Open full-size diagram](/open-source/images/anthropic/tool-sequence.svg)

<Accordion title="All 31 browser actions">
  * Navigation: `navigate`, `new_tab`, `list_tabs`, `switch_tab`, `close_tab`.
  * Page state: `screenshot`, `zoom`, `read_page`, `find`, `get_page_text`, `wait`.
  * Pointer: `left_click`, `right_click`, `middle_click`, `double_click`, `triple_click`, `hover`, `mouse_move`, `left_mouse_down`, `left_mouse_up`, `left_click_drag`, `scroll`, `scroll_to`.
  * Input: `type`, `key`, `hold_key`, `form_input`, `file_upload`.
  * Diagnostics: `read_console`, `read_network`, `javascript_exec`.
</Accordion>

The quickstart enables all 31 browser actions plus Bash. A bare `BrowserUse()` follows Anthropic's defaults: 27 actions enabled, with `javascript_exec`, `file_upload`, `read_console`, and `read_network` off. The quickstart turns those four on with `configs`:

```python theme={null}
configs={
    'javascript_exec': {'enabled': True},
    'file_upload': {'enabled': True},
    'read_console': {'enabled': True},
    'read_network': {'enabled': True},
}
```

Your application supplies the tools to Claude through `tools=[driver, bash]`. The SDK sends the browser toolset and its `configs` to Anthropic, and Claude chooses calls from the enabled actions. Disabled actions are withheld from Claude and rejected by the SDK if requested. Registering `driver` alone does not include Bash. `javascript_exec` runs JavaScript inside the page; Bash runs commands on the SDK host.

To opt out, set an action's `enabled` value to `False` in the `configs` passed to `BrowserUse(...)`. To remove Bash, use `tools=[driver]` and update the task and system prompt so they do not request shell commands.

## File uploads and downloads

File paths in browser actions refer to the browser host. With local Chromium, that is the same machine as your Python process: an approved local file can be uploaded, and downloaded bytes can be read locally. A remote browser has its own filesystem.

<Frame>
  <img className="w-full" src="https://mintcdn.com/browseruse-0aece648/mCRWbkwb0oePyPbJ/open-source/images/anthropic/files-between-hosts.svg?fit=max&auto=format&n=mCRWbkwb0oePyPbJ&q=85&s=528aafeeb4c8102a5d8e0d5bf66e8766" alt="A report starts on the SDK host. The application copies bytes to the remote browser host before file_upload can select the staged file. Download notifications return metadata; the application must retrieve the bytes before Bash can read a local copy. These transfers are not built into the driver." width="1440" height="900" data-path="open-source/images/anthropic/files-between-hosts.svg" />
</Frame>

[Open full-size diagram](/open-source/images/anthropic/files-between-hosts.svg)

### Uploads to a remote browser

For a remote upload, your application must first copy the file's bytes to the browser host. Then it can give Claude an approved document ID and map that ID to the staged path. `file_upload` selects the staged file in the page's file input.

The transfer step is separate from the driver. The code below begins after `report.pdf` is already on the browser host:

```python theme={null}
from anthropic.tools.browser import LocalFilePolicy
from browser_use.integrations.toolsets_for_claude import BrowserUse

# session is an already connected remote BrowserSession.
# The file must already exist on that browser's machine.
remote_paths = {'report': '/staged/report.pdf'}

driver = BrowserUse(
    session,
    configs={'file_upload': {'enabled': True}},
    confirm=lambda _: True,
    file_policy=LocalFilePolicy(upload_document_ids=remote_paths.keys()),
    document_resolver=lambda document_id: remote_paths[document_id],
)
```

The resolver maps IDs to paths and does not copy bytes. `BrowserUse(use_cloud=True)` does not provide automatic upload staging or download retrieval. The open-source `Agent` has the same browser-host path requirement for uploads.

### Downloads from a remote browser

A download notification reports that the browser finished a download. The reported path is metadata about the browser host and does not mean the file exists on the SDK host. Retrieve the file to the SDK host before asking Bash to read it.

The quickstart needs no transfer, because Bash writes the Markdown and JSON directly on the SDK host.

## Approvals

Enabling `file_upload` or `javascript_exec` requires a confirmation callback. The SDK calls it before executing a browser action, after checking that the action is enabled and its inputs and file selection are allowed.

The quickstart uses `confirm=lambda _: True` to approve browser actions automatically. Replace it with the callback below to ask for approval when Claude uploads a file or runs page JavaScript. It approves other browser actions automatically. The callback can use a terminal prompt, a review screen in your app, or your own approval service.

<Frame>
  <img className="w-full" src="https://mintcdn.com/browseruse-0aece648/JULQx8fbv_7orjAS/open-source/images/anthropic/approval-gate.svg?fit=max&auto=format&n=JULQx8fbv_7orjAS&q=85&s=48e2d1167862a7ac9fb5fe15288005b5" alt="Claude requests an action. The confirmation callback either allows the driver to execute it or declines it. A callback error also prevents execution. The action output, refusal, or error returns to Claude; approval covers one action." width="850" height="660" data-path="open-source/images/anthropic/approval-gate.svg" />
</Frame>

[Open full-size diagram](/open-source/images/anthropic/approval-gate.svg) · [See the file-upload sequence](/open-source/images/anthropic/confirmation-callback.svg)

```python theme={null}
import asyncio
from pathlib import Path

from anthropic.tools.browser import ConfirmContext, LocalFilePolicy
from browser_use.integrations.toolsets_for_claude import BrowserUse


async def confirm(context: ConfirmContext) -> bool:
    if context.member not in {'file_upload', 'javascript_exec'}:
        return True
    details = context.input.model_dump_json(exclude_none=True)
    answer = await asyncio.to_thread(
        input,
        f"Action: {context.member}\nPage: {context.tab_url}\n{details}\nAllow this action? [y/N] ",
    )
    return answer.strip().lower() == 'y'


driver = BrowserUse(
    configs={
        'file_upload': {'enabled': True},
        'javascript_exec': {'enabled': True},
    },
    confirm=confirm,
    file_policy=LocalFilePolicy(upload_roots=[Path('uploads'), Path('outputs')]),
)
```

For example, an upload request could show this prompt (the paths and page below are illustrative):

```text theme={null}
Action: file_upload
Page: https://example.com/application
{"target":{"type":"ref","ref":"ref_7"},"paths":["/your-project/uploads/report.pdf"]}
Allow this action? [y/N]
```

| Callback outcome | What happens |
| - | - |
| User enters `y` or `Y` | Returns `True`; the driver executes this action. |
| User presses Enter or enters another answer | Returns `False`; the action does not execute. |
| The prompt or approval service raises an exception | The action does not execute; the SDK reports an error. |

Approval applies to this action only. Later calls pass through the callback again. The file allowlist restricts local uploads to `uploads/` and `outputs/`, so files written by Bash can also be approved for upload. Remote browsers require staging on the browser host, as described in [Uploads to a remote browser](#uploads-to-a-remote-browser).

This callback prompts for upload and JavaScript and approves all other browser actions. Add checks for actions with side effects, such as sending a message, submitting a purchase, or deleting a record.

Browser confirmation does not cover Bash. Omit Bash or apply a separate execution policy if shell commands need approval. Bash limits execution time and returned output, and removes ambient credentials from its child environment. Its working directory is not an operating-system sandbox, so run untrusted tasks in an isolated environment.

***

Read the [Claude browser-toolset quickstarts](https://github.com/anthropics/claude-quickstarts/tree/main/browser-toolset) for the upstream SDK contract.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.