A powerful & efficient browser agent that automates any task on the web.
To install, run:
npm install -g @visnia/browser-agent-sdk| Metric | BrowserUse Bench | BrowseWebApp Bench | ||||
|---|---|---|---|---|---|---|
| Ours | Browser-code | Browser Use | Browser Cloud v4 | Ours | Browser-code | |
| Open source | Yes | Yes | Yes | No | Yes | Yes |
| Model | gpt-5.6-luna | gpt-5.6-luna | gpt-5.6-luna | bu-v4-luna | gpt-5.6-luna | gpt-5.6-luna |
| Reasoning effort | xhigh | xhigh | xhigh | - | high | high |
| Success | 88% | 78% | 31% | 78% | 76% | 64% |
| Duration (seconds) | 32,694 | 47,970 | 6,787 | 24,505 | 15,653 | 32,036 |
| Cost | $5.37 | $8.34 | - | $6.31 | $3.73 | $7.45 |
| Successful tasks / $ | 16.40 | 9.35 | - | 12.37 | 18.77 | 8.86 |
- Node.js (v20 or later) and npm
- Google Chrome or a compatible Chromium installation
- An API key for the configured model provider, except when using vLLM or Codex. Supported providers include OpenAI, OpenRouter, Anthropic, Google, Together, Codex, and vLLM-compatible endpoints.
- For
codex, the Codex CLI installed onPATH(npm install -g @openai/codex). Browser Agent uses its ChatGPT OAuth session instead of an API key.
Set the environment variables for your selected model provider:
| Provider | Environment variables |
|---|---|
| openai | OPENAI_API_KEY |
| anthropic | ANTHROPIC_API_KEY |
GOOGLE_API_KEY |
|
| together | TOGETHER_API_KEY |
| openrouter | OPENROUTER_API_KEY |
| codex | Codex CLI OAuth login |
| vllm | VLLM_BASE_URL |
Create a configuration file:
provider: openai
model: gpt-5.6-sol
reasoning_effort: medium
tasks:
- task: "Find the first five articles on the OpenAI blog."
url: "https://openai.com/news/"Set the required provider variables shown above, then run:
browser-agent path/to/config.yamlTo use your ChatGPT account through Codex, install the Codex CLI and select the
codex provider. No API key or endpoint override is accepted:
provider: codex
model: gpt-5.6-luna
reasoning_effort: xhigh
tasks:
- task: "Find the first five articles on the OpenAI blog."
url: "https://openai.com/news/"We recommend using GPT 5.6 Luna, with reasoning effort set to xhigh, through OpenAI directly:
provider: openai
model: gpt-5.6-luna
reasoning_effort: xhighor OpenRouter:
provider: openrouter
model: openai/gpt-5.6-luna
reasoning_effort: xhighBrowser Agent provides TypeScript and Python SDKs for running browser automation tasks. Both SDKs install the matching CLI from the GitHub Release, verify its checksum, stream progress events, and return a final result.
Set the selected provider's API-key environment variable, such as OPENAI_API_KEY or OPENROUTER_API_KEY, or pass the API key directly when creating the agent. Codex instead uses the installed Codex CLI and its terminal OAuth flow.
Requires Node.js 20 or newer.
npm install @visnia/browser-agent-sdkimport { BrowserAgent } from "@visnia/browser-agent-sdk";
const agent = new BrowserAgent({
provider: "openai",
model: "gpt-5.4",
downloadDirectory: "./downloads",
});
const run = agent.run({
task: "Find the first five articles on the OpenAI blog.",
url: "https://openai.com/news/",
});
for await (const event of run.events()) {
console.log(event);
}
const result = await run.result;See the TypeScript SDK documentation.
Requires Python 3.11 or newer.
pip install browser-agent-python-sdkimport asyncio
from browser_agent import BrowserAgent, BrowserAgentTask
async def main():
agent = BrowserAgent(
provider="openai",
model="gpt-5.4",
download_directory="./downloads",
)
run = agent.run(
BrowserAgentTask(
"Find the first five articles on the OpenAI blog.",
"https://openai.com/news/",
)
)
async for event in run.events():
print(event)
result = await run.result
asyncio.run(main())See the Python SDK documentation.
For web tasks that require authentication, provide credentials in the YAML to allow the agent to login:
- The agent identifies the text boxes for email/username and password, and delegates entering credentials to a script, so that your credentials are never exposed to model providers
- Always encrypt credentials in the YAML config, so that your coding agents don't leak them to model providers.
Generate a base64-encoded 32-byte encryption key:
browser-agent generate-keyKeep this key secret and reuse the same value when encrypting and decrypting the credential fields.
After setting BROWSER_AGENT_AUTH_ENCRYPTION_KEY, encrypt a string with:
browser-agent encrypt "value-to-encrypt"Run the command separately for the domain URL, username, and password, replacing value-to-encrypt each time.
auth_credentials:
mode: encrypted
encrypted_domain_url: "bauth-v1:<encrypted-domain>"
encrypted_username: "bauth-v1:<encrypted-username>"
encrypted_password: "bauth-v1:<encrypted-password>"For credentials passed through an SDK, see the task configuration sections in the TypeScript SDK README and Python SDK README.
MIT.