StagehandOptions
Index
Properties
optionalapiKey
API key - interpreted based on the env setting:
- When
env: 'LOCAL': LLM provider API key (OpenAI, Anthropic, or Google) - When
env: 'BROWSERBASE': Browserbase API key
For LOCAL env, can also be set via environment variables:
- OpenAI:
OPENAI_API_KEY - Anthropic:
ANTHROPIC_API_KEY - Google:
GOOGLE_API_KEY
optionalcacheDir
Cache directory for observation caching to improve performance.
optionaldomSettleTimeout
Time to wait for DOM to stabilize before performing AI operations (ms).
optionalenv
Environment to run Stagehand in.
'LOCAL': Use local browser (default)'BROWSERBASE': Use Browserbase cloud browsers
optionalllmClient
Custom LLM client for AI operations.
optionallogInferenceToFile
Enable logging of AI inference details to file for debugging.
optionalmodel
AI model to use for act(), extract(), observe() operations. Can be a string like "openai/gpt-4.1-mini" or a detailed ModelConfiguration object.
optionalprojectId
Browserbase project ID (required when env is 'BROWSERBASE').
optionalselfHeal
Enable automatic error recovery for failed AI operations.
optionalsystemPrompt
Custom system prompt for AI operations.
optionalverbose
Logging verbosity level.
- 0: Minimal logging
- 1: Standard logging
- 2: Debug logging
Stagehand-specific configuration options.