Browserbase provides browser automation tools for AI agents powered by Stagehand. Navigate websites, take screenshots, click buttons, fill forms, extract structured data, and execute multi-step browser tasks in cloud-hosted sessions with built-in CAPTCHA solving and anti-bot stealth mode.
pnpm add @browserbasehq/ai-sdk# Add to your .env fileBROWSERBASE_API_KEY=your_api_key_hereimport { generateText, stepCountIs } from 'ai';import { createBrowserbaseTools } from '@browserbasehq/ai-sdk';
const browserbase = createBrowserbaseTools();
const { text } = await generateText({ model: 'google/gemini-3-pro-preview', tools: browserbase.tools, stopWhen: stepCountIs(10), prompt: 'Open https://news.ycombinator.com and summarize the top 3 stories.',});
console.log(text);await browserbase.closeSession();