Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

replace gpt-4.1 with mini

Magnus Müller7ba8ba59586d
diff --git a/examples/custom-functions/action_filters.py b/examples/custom-functions/action_filters.py
index a2060e197..fde356cf5 100644
--- a/examples/custom-functions/action_filters.py
+++ b/examples/custom-functions/action_filters.py
@@ -95,7 +95,7 @@ async def main():
"""Main function to run the example"""
browser_session = BrowserSession()
await browser_session.start()
- llm = ChatOpenAI(model='gpt-4.1')
+ llm = ChatOpenAI(model='gpt-4.1-mini')
# Create the agent
agent = Agent( # disco mode will not be triggered on apple.com because the LLM won't be able to see that action available, it should work on Google.com though.
diff --git a/examples/custom-functions/advanced_search.py b/examples/custom-functions/advanced_search.py
index efeae01d1..b091095d3 100644
--- a/examples/custom-functions/advanced_search.py
+++ b/examples/custom-functions/advanced_search.py
@@ -93,7 +93,7 @@ names = [
async def main():
task = 'use search_web with "find email address of the following ETH professor:" for each of the following persons in a list of actions. Finally return the list with name and email if provided - do always 5 at once'
task += '\n' + '\n'.join(names)
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
browser_profile = BrowserProfile()
agent = Agent(task=task, llm=model, controller=controller, browser_profile=browser_profile)
diff --git a/examples/custom-functions/file_upload.py b/examples/custom-functions/file_upload.py
index f2312469d..9138730b4 100644
--- a/examples/custom-functions/file_upload.py
+++ b/examples/custom-functions/file_upload.py
@@ -68,7 +68,7 @@ async def main():
"""Main function to run the example"""
browser_session = BrowserSession()
await browser_session.start()
- llm = ChatOpenAI(model='gpt-4.1')
+ llm = ChatOpenAI(model='gpt-4.1-mini')
# List of file paths the agent is allowed to upload
# In a real scenario, you'd want to be very careful about what files
diff --git a/examples/custom-functions/notification.py b/examples/custom-functions/notification.py
index 325f30c17..7b01b07cf 100644
--- a/examples/custom-functions/notification.py
+++ b/examples/custom-functions/notification.py
@@ -34,7 +34,7 @@ async def done(text: str):
async def main():
task = 'go to brower-use.com and then done'
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
agent = Agent(task=task, llm=model, controller=controller)
await agent.run()
diff --git a/examples/custom-functions/onepassword_2fa.py b/examples/custom-functions/onepassword_2fa.py
index 5b73d88a6..ef6780594 100644
--- a/examples/custom-functions/onepassword_2fa.py
+++ b/examples/custom-functions/onepassword_2fa.py
@@ -46,7 +46,7 @@ async def main():
# Example task using the 1Password 2FA action
task = 'Go to account.google.com, enter username and password, then if prompted for 2FA code, get 2FA code from 1Password for and enter it'
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
agent = Agent(task=task, llm=model, controller=controller)
result = await agent.run()
diff --git a/examples/custom-functions/save_to_file_hugging_face.py b/examples/custom-functions/save_to_file_hugging_face.py
index dbfd280f8..2a7d98946 100644
--- a/examples/custom-functions/save_to_file_hugging_face.py
+++ b/examples/custom-functions/save_to_file_hugging_face.py
@@ -40,7 +40,7 @@ def save_models(params: Models):
async def main():
task = 'Look up models with a license of cc-by-sa-4.0 and sort by most likes on Hugging face, save top 5 to file.'
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
agent = Agent(task=task, llm=model, controller=controller)
await agent.run()
diff --git a/examples/features/custom_output.py b/examples/features/custom_output.py
index 40319afd0..b6c43f530 100644
--- a/examples/features/custom_output.py
+++ b/examples/features/custom_output.py
@@ -36,7 +36,7 @@ controller = Controller(output_model=Posts)
async def main():
task = 'Go to hackernews show hn and give me the first 5 posts'
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
agent = Agent(task=task, llm=model, controller=controller)
history = await agent.run()
diff --git a/examples/features/custom_system_prompt.py b/examples/features/custom_system_prompt.py
index 88f1474f3..f9475ae62 100644
--- a/examples/features/custom_system_prompt.py
+++ b/examples/features/custom_system_prompt.py
@@ -28,7 +28,7 @@ extend_system_message = (
async def main():
task = 'do google search to find images of Elon Musk'
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
agent = Agent(task=task, llm=model, extend_system_message=extend_system_message)
print(
diff --git a/examples/features/initial_actions.py b/examples/features/initial_actions.py
index 0e0f60615..6ba530aa1 100644
--- a/examples/features/initial_actions.py
+++ b/examples/features/initial_actions.py
@@ -10,7 +10,7 @@ load_dotenv()
from browser_use import Agent, ChatOpenAI
-llm = ChatOpenAI(model='gpt-4.1')
+llm = ChatOpenAI(model='gpt-4.1-mini')
initial_actions = [
{'go_to_url': {'url': 'https://www.google.com', 'new_tab': True}},
diff --git a/examples/features/multi-tab_handling.py b/examples/features/multi-tab_handling.py
index 27f8f158c..7c8a8bb31 100644
--- a/examples/features/multi-tab_handling.py
+++ b/examples/features/multi-tab_handling.py
@@ -17,7 +17,7 @@ load_dotenv()
from browser_use import Agent, ChatOpenAI
# video: https://preview.screen.studio/share/clenCmS6
-llm = ChatOpenAI(model='gpt-4.1')
+llm = ChatOpenAI(model='gpt-4.1-mini')
agent = Agent(
task='open 3 tabs with elon musk, trump, and steve jobs, then go back to the first and stop',
llm=llm,
diff --git a/examples/features/outsource_state.py b/examples/features/outsource_state.py
index d99dbc632..0c286c5c4 100644
--- a/examples/features/outsource_state.py
+++ b/examples/features/outsource_state.py
@@ -35,7 +35,7 @@ async def main():
for i in range(10):
agent = Agent(
task=task,
- llm=ChatOpenAI(model='gpt-4.1'),
+ llm=ChatOpenAI(model='gpt-4.1-mini'),
browser_session=browser_session,
injected_agent_state=agent_state,
page_extraction_llm=ChatOpenAI(model='gpt-4.1-mini'),
diff --git a/examples/features/parallel_agents.py b/examples/features/parallel_agents.py
index 97b417242..58f3177d3 100644
--- a/examples/features/parallel_agents.py
+++ b/examples/features/parallel_agents.py
@@ -20,7 +20,7 @@ browser_session = BrowserSession(
user_data_dir='~/.config/browseruse/profiles/default',
)
)
-llm = ChatOpenAI(model='gpt-4.1')
+llm = ChatOpenAI(model='gpt-4.1-mini')
async def main():
diff --git a/examples/features/pause_agent.py b/examples/features/pause_agent.py
index 3b3dd792f..dc7148c99 100644
--- a/examples/features/pause_agent.py
+++ b/examples/features/pause_agent.py
@@ -14,7 +14,7 @@ from browser_use import Agent, ChatOpenAI
class AgentController:
def __init__(self):
- llm = ChatOpenAI(model='gpt-4.1')
+ llm = ChatOpenAI(model='gpt-4.1-mini')
self.agent = Agent(
task='open in one action https://www.google.com, https://www.wikipedia.org, https://www.youtube.com, https://www.github.com, https://amazon.com',
llm=llm,
diff --git a/examples/features/result_processing.py b/examples/features/result_processing.py
index a8020d469..9a55a1ccf 100644
--- a/examples/features/result_processing.py
+++ b/examples/features/result_processing.py
@@ -14,7 +14,7 @@ from browser_use.agent.views import AgentHistoryList
from browser_use.browser import BrowserProfile, BrowserSession
from browser_use.llm import ChatOpenAI
-llm = ChatOpenAI(model='gpt-4.1')
+llm = ChatOpenAI(model='gpt-4.1-mini')
async def main():
diff --git a/examples/features/validate_output.py b/examples/features/validate_output.py
index ee592db3c..31ffed812 100644
--- a/examples/features/validate_output.py
+++ b/examples/features/validate_output.py
@@ -39,7 +39,7 @@ async def done(params: DoneResult):
async def main():
task = 'Go to hackernews hn and give me the top 1 post'
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
agent = Agent(task=task, llm=model, controller=controller, validate_output=True)
# NOTE: this should fail to demonstrate the validator
await agent.run(max_steps=5)
diff --git a/examples/integrations/gmail_2fa_integration.py b/examples/integrations/gmail_2fa_integration.py
index 7ca4c5fc1..b5cceb811 100644
--- a/examples/integrations/gmail_2fa_integration.py
+++ b/examples/integrations/gmail_2fa_integration.py
@@ -254,7 +254,7 @@ async def main():
print()
# Initialize LLM
- llm = ChatOpenAI(model='gpt-4.1')
+ llm = ChatOpenAI(model='gpt-4.1-mini')
# Step 4: Test Gmail functionality
print('🔍 Step 4: Testing Gmail email retrieval...')
diff --git a/examples/ui/gradio_demo.py b/examples/ui/gradio_demo.py
index 50575b203..502d817d7 100644
--- a/examples/ui/gradio_demo.py
+++ b/examples/ui/gradio_demo.py
@@ -69,7 +69,7 @@ async def run_browser_task(
try:
agent = Agent(
task=task,
- llm=ChatOpenAI(model='gpt-4.1'),
+ llm=ChatOpenAI(model='gpt-4.1-mini'),
)
result = await agent.run()
# TODO: The result could be parsed better
diff --git a/examples/use-cases/captcha.py b/examples/use-cases/captcha.py
index 97437a62c..9dad9189b 100644
--- a/examples/use-cases/captcha.py
+++ b/examples/use-cases/captcha.py
@@ -22,7 +22,7 @@ from browser_use import Agent, ChatOpenAI
async def main():
- llm = ChatOpenAI(model='gpt-4.1')
+ llm = ChatOpenAI(model='gpt-4.1-mini')
agent = Agent(
task='go to https://captcha.com/demos/features/captcha-demo.aspx and solve the captcha',
llm=llm,
diff --git a/examples/use-cases/find_influencer_profiles.py b/examples/use-cases/find_influencer_profiles.py
index 9b2567e0f..3dd8a98d0 100644
--- a/examples/use-cases/find_influencer_profiles.py
+++ b/examples/use-cases/find_influencer_profiles.py
@@ -68,7 +68,7 @@ async def main():
'Go to this tiktok video url, open it and extract the @username from the resulting url. Then do a websearch for this username to find all his social media profiles. Return me the links to the social media profiles with the platform name.'
' https://www.tiktokv.com/share/video/7470981717659110678/ '
)
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
agent = Agent(task=task, llm=model, controller=controller)
history = await agent.run()
diff --git a/examples/use-cases/google_sheets.py b/examples/use-cases/google_sheets.py
index f93076ed0..15df9b259 100644
--- a/examples/use-cases/google_sheets.py
+++ b/examples/use-cases/google_sheets.py
@@ -45,7 +45,7 @@ async def main():
await browser_session.start()
try:
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
# eraser = Agent(
# task="""
diff --git a/examples/use-cases/online_coding_agent.py b/examples/use-cases/online_coding_agent.py
index d9f55e20d..052adfbd8 100644
--- a/examples/use-cases/online_coding_agent.py
+++ b/examples/use-cases/online_coding_agent.py
@@ -20,7 +20,7 @@ if not os.getenv('OPENAI_API_KEY'):
async def main():
browser_session = BrowserSession()
- model = ChatOpenAI(model='gpt-4.1')
+ model = ChatOpenAI(model='gpt-4.1-mini')
# Initialize browser agent
agent1 = Agent(
diff --git a/examples/use-cases/play_chess.py b/examples/use-cases/play_chess.py
index 378e3dbdf..e987bff03 100755
--- a/examples/use-cases/play_chess.py
+++ b/examples/use-cases/play_chess.py
@@ -422,7 +422,7 @@ async def main():
8. Repeat steps 4-7 until the game ends. If anything seems wrong, use 'Read Chess Board' again.
9. Announce the final result.
""",
- llm=ChatOpenAI(model='gpt-4.1'),
+ llm=ChatOpenAI(model='gpt-4.1-mini'),
controller=controller,
)
result = await agent.run()
diff --git a/examples/use-cases/scrolling_page.py b/examples/use-cases/scrolling_page.py
index d0c9412cd..d85080872 100644
--- a/examples/use-cases/scrolling_page.py
+++ b/examples/use-cases/scrolling_page.py
@@ -40,7 +40,7 @@ This script demonstrates the new enhanced scrolling capabilities:
- Container-aware scrolling prevents unwanted side effects
"""
-llm = ChatOpenAI(model='gpt-4.1')
+llm = ChatOpenAI(model='gpt-4.1-mini')
browser_profile = BrowserProfile(headless=False)
browser_session = BrowserSession(browser_profile=browser_profile)
diff --git a/examples/use-cases/shopping.py b/examples/use-cases/shopping.py
index a2c12fd3a..ac6043925 100644
--- a/examples/use-cases/shopping.py
+++ b/examples/use-cases/shopping.py
@@ -113,7 +113,7 @@ browser_session = BrowserSession()
agent = Agent(
task=task,
- llm=ChatOpenAI(model='gpt-4.1'),
+ llm=ChatOpenAI(model='gpt-4.1-mini'),
browser_session=browser_session,
)