Method Signature
Configuration
Agent mode. Currently only
'cua' (Computer Use Agent) is supported.Model configuration. Can be a model string in
provider/model format or a detailed configuration object.String format: 'provider/model'Examples:'openai/computer-use-preview''anthropic/claude-3-5-sonnet-20241022''google/gemini-2.0-flash-exp'
Custom system prompt to guide agent behavior. Defaults to:
Milliseconds to wait between agent actions. Must be a non-negative number. Set to
0 for no delay.Model Configuration
When using the object format formodel, provide an OpensteerAgentModelConfig:
Model name in
provider/model format. Must include a slash separator.Examples:'openai/computer-use-preview''anthropic/claude-3-5-sonnet-20241022''google/gemini-2.0-flash-exp'
API key for the provider. If not provided, reads from environment variables:
- OpenAI:
OPENAI_API_KEY - Anthropic:
ANTHROPIC_API_KEY - Google:
GOOGLE_GENERATIVE_AI_API_KEY,GEMINI_API_KEY, orGOOGLE_API_KEY
Custom base URL for the provider API. Useful for proxies or compatible services.
Organization ID for OpenAI (if applicable).
Thinking budget for OpenAI extended reasoning models. Controls the amount of reasoning tokens allocated.
Environment identifier for Google models (provider-specific configuration).
Return Value
Returns anOpensteerAgentInstance with:
Examples
Simple String Model
OpenAI with Custom Configuration
Anthropic Configuration
Google Gemini Configuration
Custom Base URL (Proxy or Compatible Service)
Using Environment Variables Only
No Wait Between Actions
Provider-Specific Notes
OpenAI
- Requires
OPENAI_API_KEYenvironment variable orapiKeyin config - Supports
organizationfor team/org accounts - Extended reasoning models support
thinkingBudgetparameter - Model example:
'openai/computer-use-preview'
Anthropic
- Requires
ANTHROPIC_API_KEYenvironment variable orapiKeyin config - Claude models with computer use capabilities
- Model example:
'anthropic/claude-3-5-sonnet-20241022'
- Requires
GOOGLE_GENERATIVE_AI_API_KEY,GEMINI_API_KEY, orGOOGLE_API_KEY - Supports
environmentparameter for environment-specific configuration - Gemini models with multimodal capabilities
- Model example:
'google/gemini-2.0-flash-exp'
Error Handling
Configuration errors throw specific error types:Notes
- Only one agent execution can run at a time per agent instance
- Agent instances are tied to the browser instance they’re created from
- Model format must always be
provider/modelwith a forward slash - API keys are required either via config or environment variables
- The system prompt significantly affects agent behavior and decision-making
- Higher
waitBetweenActionsMsvalues improve reliability but slow execution