Models
| Model | API String | Cost per Step |
|---|
| Browser Use 2.0 (default) | browser-use-2.0 | $0.006 |
| Browser Use LLM | browser-use-llm | $0.002 |
| O3 | o3 | $0.03 |
| Gemini 3 Pro Preview | gemini-3-pro-preview | $0.03 |
| Gemini 3 Flash Preview | gemini-3-flash-preview | $0.01 |
| Gemini Flash Latest | gemini-flash-latest | $0.0075 |
| Gemini Flash Lite Latest | gemini-flash-lite-latest | $0.005 |
| Claude Sonnet 4.5 | claude-sonnet-4-5-20250929 | $0.05 |
| Claude Sonnet 4.6 | claude-sonnet-4-6 | $0.05 |
Pass llm explicitly to select a model:
result = await client.run("...", llm="browser-use-2.0")
Files
Upload images, PDFs, documents, and text files (10 MB max) to sessions, and download output files from completed tasks.
Upload a file
Get a presigned URL, then upload via PUT.
import httpx
from browser_use_sdk import AsyncBrowserUse
client = AsyncBrowserUse()
session = await client.sessions.create()
upload = await client.files.session_url(
session.id,
file_name="input.pdf",
content_type="application/pdf",
size_bytes=1024,
)
with open("input.pdf", "rb") as f:
async with httpx.AsyncClient() as http:
await http.put(upload.presigned_url, content=f.read(), headers={"Content-Type": "application/pdf"})
result = await client.run("Summarize the uploaded PDF", session_id=session.id)
Presigned URLs expire after 120 seconds. Max file size: 10 MB.
Download task output files
result = await client.tasks.get(task_id)
for file in result.output_files:
output = await client.files.task_output(task_id, file.id)
print(output.presigned_url) # download URL
Streaming steps
Use async for to yield steps as the agent works.
from browser_use_sdk import AsyncBrowserUse
client = AsyncBrowserUse()
run = client.run("Find the cheapest flight from NYC to London on Google Flights")
async for step in run:
print(f"Step {step.number}: {step.next_goal}")
print(f" URL: {step.url}")
print(run.result.output) # final result after iteration
Key parameters
| Parameter | Type | Description |
|---|
task | str | What you want the agent to do. 1-50,000 characters. |
llm | str | Model override. Default: Browser Use 2.0. |
output_schema / schema | Pydantic / Zod | Schema for structured output. |
session_id | str | Reuse an existing session. Omit for auto-session. |
start_url | str | Initial page URL. Saves steps — send the agent directly there. |
secrets | dict | Domain-specific credentials. See Authentication. |
allowed_domains | list[str] | Restrict agent to these domains only. |
session_settings | SessionSettings | Proxy, profile, browser config. See Profiles. |
flash_mode | bool | Faster but less careful navigation. |
thinking | bool | Enable extended reasoning. |
vision | bool | str | Enable screenshots for the agent. |
highlight_elements | bool | Highlight interactive elements on the page. |
system_prompt_extension | str | Append custom instructions to the system prompt. |
judge | bool | Enable quality judge to verify output. |
skill_ids | list[str] | Skills the agent can use during the task. |
op_vault_id | str | 1Password vault ID for auto-fill credentials and 2FA. |
metadata | dict[str, str] | Custom metadata attached to the task. |