Official Python SDK for Browser Use Cloud.
uv add browser-use-sdkGet your API key at cloud.browser-use.com/settings.
export BROWSER_USE_API_KEY=your_keyfrom browser_use_sdk.v4 import BrowserUse
with BrowserUse() as client:
run = client.runs.create("Find the top 3 trending repos on GitHub today")
result = client.runs.wait_for_completion(run.id)
print(result.result)This is the current Browser Use Agents interface. Browser Infrastructure's
browser-management resource currently lives in the explicit browser_use_sdk.v4
namespace; see the browser quickstart.
Add your provider API key in Browser Use project settings, then enable BYOK for v3 agent runs:
from browser_use_sdk.v3 import BrowserUse
client = BrowserUse(use_own_key=True)
result = client.run("Find the top 3 trending repos on GitHub today")
print(result.output)MIT
Pass a JSON Schema dictionary to runs.create(output_schema=...), then read the
parsed JSON value from runs.get(...).output or runs.wait_for_completion(...).output.
The async client supports the same parameters and fields. run.result remains the
text answer; run.output_schema echoes the requested schema. Omit output_schema
(or pass None) for an unstructured run.
from browser_use_sdk.v4 import BrowserUse
with BrowserUse() as client:
created = client.runs.create(
"Open https://example.com and return its page title.",
output_schema={
"type": "object",
"properties": {"title": {"type": "string"}},
"required": ["title"],
},
)
run = client.runs.wait_for_completion(created.id)
print(run.status, run.output)For Pydantic, pass MyModel.model_json_schema() and validate the returned value
with MyModel.model_validate(run.output); model classes are not converted
automatically. See sync and async examples.