Prerequisites
Before you begin, ensure you have:- Python 3.11 or later. Browser Use declares
requires-python >=3.11, so an older interpreter fails to resolve the package rather than reporting a clear error - A SambaCloud API key. Get one by creating a SambaCloud account and generating a key from the API keys tab
Browser Use needs two things from a model, and they are separate capabilities. It sends every screenshot to the model while
use_vision=True (the default), so the model must accept image input. It also asks for each next action as JSON using response_format with type: json_schema, so the model must support structured output. It does not use tool calling, so a model’s absence from the function calling list does not rule it out.This guide uses gemma-4-31B-it, which accepts image input and has constrained decoding enabled, so json_schema is enforced as the response is generated. See Choosing a model for the text-only alternative.1. Install Browser Use
create environment
activate environment
install browser-use and chromium
uv pip install does not fetch, so without it the first run fails when it tries to launch a browser. Expect about 180 MB and a few minutes; it prints Installation complete. when it finishes.
Run
browser-use install inside the activated virtual environment, not as uvx browser-use install. uvx ignores your environment and resolves its own copy of Browser Use, so you can end up with a browser installed for a different version than the one your code imports.2. Configure your SambaCloud key
Create a.env file in your project directory:
.env
On Windows, use
echo. > .env.env
3. Run your first agent
Browser Use has no dedicated SambaNova class. Connect to SambaCloud throughChatOpenAI with a custom base_url – the same pattern Browser Use uses for any OpenAI-compatible provider.
agent.py
final_result() returns, which is why the example captures result rather than discarding it.
Keep credentials out of the prompt
Pass anything secret throughsensitive_data rather than writing it into the task, and scope it to the domains that are allowed to receive it. Browser Use substitutes the value when it fills a field, so the literal never reaches the model:
headless=True on the profile:
Choosing a model
SambaCloud model support for Browser Use depends on the task:
Set
use_vision=False like this:
Troubleshooting
AuthenticationError: Incorrect API key
AuthenticationError: Incorrect API key
Confirm
SAMBANOVA_API_KEY is set in .env and that load_dotenv() runs before you construct ChatOpenAI. A key copied with a trailing space or newline also triggers this.Agent loops without taking useful actions, or errors on image input
Agent loops without taking useful actions, or errors on image input
Two different causes. If it errors on image input, the model is text only: switch to
gemma-4-31B-it, or keep your model and set use_vision=False. If it runs but never picks a useful action, the model is likely not honoring the json_schema response format that Browser Use uses to request each action, so choose a model with structured output support.NotFoundError: model not found
NotFoundError: model not found
The model string must match a current SambaCloud model ID exactly, and IDs are case-sensitive and take no provider prefix. Confirm it against SambaCloud models, or list the catalog directly with
curl https://api.sambanova.ai/v1/models, which needs no API key. A model that has been retired returns this error even though older guides still reference it.Chromium fails to launch
Chromium fails to launch
Run
browser-use install inside the activated virtual environment. Browser Use drives its own Chromium build, which uv pip install browser-use does not fetch, and the command prints Installation complete. when it succeeds. If you ran it as uvx browser-use install, run it again inside the environment: uvx resolves its own copy of Browser Use, so the browser it installed may belong to a different version than the one your code imports.Next steps
- Quickstart – make a plain SambaCloud API call, useful for confirming your key works before adding a browser
- SambaCloud models – current model IDs, context lengths, and which accept image input
- Structured output – the
response_formatmechanism Browser Use relies on for each action - API reference – endpoints and parameters
- Browser Use documentation – advanced configuration, custom browsers, and production deployment
- Browser Use supported models reference – full list of native and OpenAI-compatible integrations

