AI actions use an LLM and are metered. They need an API key for the model’s
provider (Anthropic, OpenAI, OpenRouter, Vercel, or OpenCode) on the box or
your account. Every method accepts a provider-prefixed
model override such
as "openai/gpt-4o". Without an override, the call uses the model the box
was configured with. If the box has no model, it falls back to
anthropic/claude-sonnet-4-5.Observe
observe() finds actionable elements matching an instruction. Use it to check the page before acting, or to build your own action loop:
Act
act() resolves and executes exactly one action described in natural language:
actions with the resolved selectors), whether it succeeded, and the token usage of the call.
Run
run() is the autonomous mode. The agent reads the page, acts, and repeats until the task is complete or it hits the step limit. Pass a schema to get structured data back at the end:
maxSteps: defaults to15, capped at30.schema: optional. Without it,runreturns its findings as text inresult.- The result includes
completed, a step-by-step trace insteps(each with the action taken, its reasoning, and the URL), and total token usage.
Which one to use
For fully scripted control with no LLM in the loop, connect over CDP with Playwright or Puppeteer instead. Both drive the same tabs, so you can mix scripted steps with AI steps. To watch or replay what the agent did, see Live View and Recordings.