Skip to main content
Use Browser Use Cloud as the remote browser for OpenAI models. Start with the library driver and a remote Cloud browser. The separate Playwright example provides another connection: The OpenAI SDK defines the tools and runs the model loop. Browser Use supplies the remote browser. The library driver also supplies browser actions.

Browser Use library driver

Install the tested Browser Use release with the OpenAI tools extra:
Set your keys and model:
Get your Browser Use API key. Choose an OpenAI model that supports Responses function tools. OpenAI 3.x uses httpx2 for custom HTTP clients. Use OpenAI’s DefaultAsyncHttpxClient when configuring a custom client. The following example uses a remote browser:
The driver creates and closes its own browser. You can also pass an already connected BrowserSession. The caller keeps responsibility for that borrowed session. Use BrowserUse() for a local browser after installing Chromium with uvx browser-use install.

Remote browsers with Playwright

This path uses the Cloud SDK without the open-source Browser Use agent. You do not need local Chromium. Create a separate environment:
Set your keys and model:
Get your Browser Use API key. Choose an OpenAI model that supports Responses function tools. Download both files from the remote browser example:
  • browser_use_driver.py
  • browser_use_responses.py
Keep the files together and run:
The example creates a dedicated Cloud browser and connects through Chrome DevTools Protocol (CDP). It gives the model two tools: navigation and page-text reading. It permits navigation only within example.com. It closes the connection and stops its browser after the run. Both providers charge for their respective services. The example prints the model answer after the driver reads the page. Check the page result and browser cleanup separately.

Library driver actions

The default tools cover navigation, tabs, page reads, element search, screenshots, zoom, clicks, typing, keys, scrolling, selection, and waits. The SDK exposes list_tabs from the driver’s state method. Enable additional methods with additional_members:
The example confirmation callback only permits navigation. Change that callback to approve the actions your task needs. The driver also implements run_script for explicitly approved page JavaScript. A script timeout stops waiting; it does not guarantee that page execution stops. This version does not implement scoped reads, console/network diagnostics, uploads, or downloads. It does not include Bash. The remote browser filesystem differs from the application filesystem.

References and approvals

Read the page before using an element reference. A new page read replaces that tab’s references. Navigation, detached elements, and tab changes can invalidate references. Page reads use the main document’s accessibility tree. They do not guarantee complete iframe or shadow-root coverage. Screenshots and coordinate actions provide another way to inspect and operate the page. OpenAI’s toolset validates inputs and invokes your confirmation callback before actions. The URL callback checks requested navigation; it does not replace network controls. Keep task permissions and provider settings in application code. See the OpenAI browser helper reference.