Skip to main content
Use your existing Playwright code with a remote Browser Use Cloud browser. OpenAI runs the model loop. A small adapter exposes Playwright actions as tools. This example exposes read_page, click, type, and select_option. OpenAI shared the small adapter used here; it is not a general Playwright driver. Playwright methods become model tools only when the adapter implements them. For all 28 browser tools and Bash, use the Browser Use library driver.

Connect your remote browser

Replace local browser startup with these lines:
Chrome DevTools Protocol (CDP) connects Playwright to your remote Chromium browser. Your application runs Playwright and the OpenAI SDK. Browser Use Cloud hosts the browser.

Run the example

You need uv and API keys for Browser Use and OpenAI. You need no local Chromium installation or open-source Browser Use library.
Get your Browser Use key and OpenAI key. Choose an OpenAI model that supports Responses function tools. The model reads example.com, clicks its link, and summarizes the destination. The script stops the Cloud browser when the task ends.

Complete example

playwright_cloud.py
The adapter keeps element references from each page read. Read again after navigation or when an element reference becomes stale. This small example supports one page and a limited set of visible form controls. The confirmation callback approves actions for this example. Use tasks you authorize, and change the callback for your application’s permissions.

Choose your integration

Both integrations use Browser Use Cloud infrastructure. The adapter determines which actions the model can call.