AI Evaluate
AI
AI Evaluate
Run an AI prompt against the current page — either a single-shot extraction (simple) or a multi-step browser agent (agent).
POST
AI Evaluate
Overview
Runs an LLM-driven evaluation against the session’s active page. Two modes:simple— one-shot: the current page’s DOM + screenshot are sent to the model, which answers the prompt (optionally against a JSON schema).agent— multi-step: the model can drive the browser, clicking and navigating for up tomaxStepsiterations.
POST /browser/sessions/{id}/ai/evaluate/stream.
Path Parameters
Browser session ID (UUID).
Body
Natural-language instruction for the model.
One of
simple, agent.For
agent mode, the maximum number of browser actions the model may take.Explicit LLM model ID (e.g.
claude-sonnet-4-20250514, gpt-4o). Defaults to the account’s configured default.Optional JSON schema. When supplied, the response
result is constrained to match.Example Request
Response
Success Response (200)
True when the evaluation finished. False when it aborted (see
error).Model output. When
schema was supplied, conforms to that schema.Error message when
success is false.Number of browser actions taken (agent mode).
Model ID that was used.
Total tokens consumed by the evaluation.
Error Responses
| Status | Description |
|---|---|
400 | Invalid body — missing prompt, unknown mode, or malformed schema. |
401 | Unauthorized — invalid or missing API key. |
404 | Session not found or not owned by the caller. |
503 | The model provider or browser session is temporarily unreachable. |