
Integrations
How to add a proxy to Browser Use
Create the Browser with proxy=ProxySettings(server, username, password) pointing at the TrueProxies gateway, and give each agent its own Browser with a session ID on the username.
Tested October 1, 2026 with Browser Use 0.13.10 through the TrueProxies residential gateway. Reviewed by John Hale. Last updated October 1, 2026.
Browser Use Cloud ships its own proxies and also accepts a custom proxy (host, port, username, password) when you create a cloud browser. This page covers the open-source library running your own Chromium.
Prerequisites
- Python 3.11 or newer,
pip install browser-use, and a Chromium build (the library installs one on first run). - A Residential IPv4 GB-based service (Traffic pack) and its credentials from the dashboard, exported as PROXY_HOST, PROXY_USER and PROXY_PASS.
- An LLM API key for the agent itself; the proxy carries page loads, not model calls.
Basic proxy setup
The gateway host, your username and password are in the dashboard. Keep them in environment variables; never in a prompt, a repo or a log. The proxy belongs to the Browser, so every page the agent opens leaves through it. Open api.ipify.org first to confirm the exit.
import asyncio, os
from browser_use import Agent, Browser, ChatOpenAI
from browser_use.browser import ProxySettings
browser = Browser(
headless=True,
proxy=ProxySettings(
server=f"http://{os.environ['PROXY_HOST']}:8080",
username=os.environ["PROXY_USER"],
password=os.environ["PROXY_PASS"],
),
)
async def main():
agent = Agent(
task="Open https://api.ipify.org?format=json and return the ip field, then open https://example.com/ and return its title.",
llm=ChatOpenAI(model="gpt-4o-mini"),
browser=browser,
)
history = await agent.run(max_steps=6)
print(history.final_result())
asyncio.run(main())One sticky session per agent
An agent's task is a sequence of page loads that should look like one visitor. Sessions live on the username: USER-session-crawl01-lifetime-600 keeps one exit for ten minutes under the ID crawl01; add -country-us or -city-berlin for location. Leave the session off to rotate per request. Give each agent its own Browser whose username carries a unique session ID and a lifetime at least as long as the task, and never share a Browser between agents.
import asyncio, os
from browser_use import Agent, Browser, ChatOpenAI
from browser_use.browser import ProxySettings
HOST, USER, PASS = os.environ["PROXY_HOST"], os.environ["PROXY_USER"], os.environ["PROXY_PASS"]
def browser_for(agent_id: str, lifetime: int = 900, country: str = "us") -> Browser:
return Browser(
headless=True,
proxy=ProxySettings(
server=f"http://{HOST}:8080",
username=f"{USER}-country-{country}-session-{agent_id}-lifetime-{lifetime}",
password=PASS,
),
)
async def run(agent_id: str, task: str):
agent = Agent(task=task, llm=ChatOpenAI(model="gpt-4o-mini"), browser=browser_for(agent_id))
return (await agent.run(max_steps=10)).final_result()
async def main():
results = await asyncio.gather(
run("agent01", "Open https://example.com/ and return the title and first paragraph."),
run("agent02", "Open https://example.org/ and return the title and first paragraph."),
)
print(results)
asyncio.run(main())Cut traffic: block images, fonts and media
An agent reads text; it rarely needs the images, fonts and media a page loads. Blocking them in Chromium cut full-render traffic by about half in our measurements, and it makes pages load faster through a residential exit. Browser Use exposes the underlying browser arguments; pass Chromium's image-disabling flag, or route requests through a CDP rule that aborts those resource types, and measure the difference on your own targets.
Verify traffic goes through the proxy
Have the agent open https://api.ipify.org?format=json as its first step and log the ip field. It should be a residential address in the country on the username, and two agents with different session IDs should report different exits.
Measured results
Browser Use 0.13.10, October 1, 2026, through the TrueProxies residential gateway. Exit IPs seen: 5 distinct residential exits across 5 browsers. The gateway billed 7 MB for 5 page loads, about 1.40 MB per page.
| Configuration | Successful | Median time per page |
|---|---|---|
| Browser with ProxySettings, one session per browser | 5 of 5 | 13.6 s |
Errors we hit, and the fixes
Page reads return nothing when you reach for a Page object
In Browser Use 0.13 the navigation and page state live on the Browser itself: await browser.navigate_to(url), await browser.get_current_page_title(), await browser.get_state_as_text(). Our first run called title and content methods on the object returned by get_current_page() and read empty strings while the pages had in fact loaded through the proxy. Use the Browser methods, or let the Agent read the page for you.
Two agents share one exit
A Browser created without a session ID on the username rotates per request, and two Browsers with the same session ID share one exit. Give every Browser its own ID: in the run above, five Browsers with agent01 to agent05 reported five different residential addresses.
FAQ
Questions about Browser Use and proxies
Where do I set the proxy in Browser Use?
On the Browser: Browser(proxy=ProxySettings(server=..., username=..., password=...)). Every page that Browser opens uses it. On Browser Use Cloud, pass custom_proxy with host, port, username and password when creating the browser.
How do I give each agent its own IP?
Create one Browser per agent and put a unique session ID with a lifetime on that Browser's username, such as `USER-session-agent01-lifetime-900`. Agents then keep separate residential exits for the length of their tasks.
Does Browser Use cloud include proxies?
Yes. Cloud browsers come with proxies by country and also accept a custom HTTP or SOCKS5 proxy with your own credentials. The open-source library uses whatever proxy you configure on the Browser.
How much traffic does an agent task use?
A task is several full browser page loads, so budget browser-level traffic per page. The measured results above give the billed MB for the tasks in this run; blocking images, fonts and media roughly halves it.
Sizing an agent fleetRun your own targets through the gateway before you buy.