Skip to main content
There’s a new way to automate the web: by prompting. But a single prompt fails on complicated scripts. Stagehand lets you prompt at multiple levels of granularity, from agents to single actions, and interweave Playwright or traditional frameworks when you need them. Use any major model provider. 22k GitHub stars, 700k+ weekly downloads. Get started in 5 minutes.
This quickstart uses Model Gateway. LLM requests for Stagehand are routed through your Browserbase API key, so you don’t need a separate model provider account. You can also bring your own API key if you prefer.

Discord

Community support

Docs

Full documentation

Templates

Ready-to-use examples

Quickstart

1

Get your API key

Your API key is displayed in the Dashboard Navigation row. The API key is all you need to get started. The project is inferred from your API key.
2

Set environment variables

3

Install and run

Save as script.ts, then run:
4

Debug in Session Inspector

See every AI decision in the Stagehand tab of your session at https://browserbase.com/sessions/{session_id}.

Next steps

Stagehand docs

Learn about Stagehand primitives, models, and Browserbase configurations

npx create-browser-app

Scaffold a Stagehand project in one command. TypeScript, zero-config.