Agent
AI Task
Submit Input Response
Research
ModelsExpand Collapse
AutomateEvent = V1AutomateEventAgentAction { data, event } | V1AutomateEventAgentExtracted { data, event } | V1AutomateEventAgentProcessing { data, event } | 30 moreA Server-Sent Event from /v1/automate. Typed discriminated union keyed on event.
A Server-Sent Event from /v1/automate. Typed discriminated union keyed on event.
V1AutomateEventAgentExtracted { data, event } Envelope for the “agent:extracted” event from /v1/automate.
Envelope for the “agent:extracted” event from /v1/automate.
V1AutomateEventAgentProcessing { data, event } Envelope for the “agent:processing” event from /v1/automate.
Envelope for the “agent:processing” event from /v1/automate.
V1AutomateEventAgentReasoned { data, event } Envelope for the “agent:reasoned” event from /v1/automate.
Envelope for the “agent:reasoned” event from /v1/automate.
V1AutomateEventAgentWaiting { data, event } Envelope for the “agent:waiting” event from /v1/automate.
Envelope for the “agent:waiting” event from /v1/automate.
V1AutomateEventAIGeneration { data, event } Envelope for the “ai:generation” event from /v1/automate.
Envelope for the “ai:generation” event from /v1/automate.
data: Data { finishReason, iterationId, prompt, 8 more } Event data when AI generation occurs
Event data when AI generation occurs
messages?: Array<System { content, role, providerOptions } | User { content, role, providerOptions } | Assistant { content, role, providerOptions } | Tool { content, role, providerOptions } >
System { content, role, providerOptions } A system message. It can contain system information.
Note: using the “system” part of the prompt is strongly preferred to increase the resilience against prompt injection attacks, and because not all providers support several system messages.
A system message. It can contain system information.
Note: using the “system” part of the prompt is strongly preferred to increase the resilience against prompt injection attacks, and because not all providers support several system messages.
User { content, role, providerOptions } A user message. It can contain text or a combination of text and images.
A user message. It can contain text or a combination of text and images.
content: string | Array<Text { text, type, providerOptions } | Image { image, type, mediaType, providerOptions } | File { data, mediaType, type, 2 more } >Content of a user message. It can be a string or an array of text and image parts.
Content of a user message. It can be a string or an array of text and image parts.
Array<Text { text, type, providerOptions } | Image { image, type, mediaType, providerOptions } | File { data, mediaType, type, 2 more } >
Text { text, type, providerOptions } Text content part of a prompt. It contains a string of text.
Text content part of a prompt. It contains a string of text.
Image { image, type, mediaType, providerOptions } Image content part of a prompt. It contains an image.
Image content part of a prompt. It contains an image.
image: string | UnionMember1 { buffer, byteLength, byteOffset, 2 more } | ByteLength { byteLength } | V1GlobalBuffer { buffer, byteLength, byteOffset, 2 more } Image data. Can either be:
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
- URL: a URL that points to the image
Image data. Can either be:
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
- URL: a URL that points to the image
File { data, mediaType, type, 2 more } File content part of a prompt. It contains a file.
File content part of a prompt. It contains a file.
data: string | UnionMember1 { buffer, byteLength, byteOffset, 2 more } | ByteLength { byteLength } | V1GlobalBuffer { buffer, byteLength, byteOffset, 2 more } File data. Can either be:
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
- URL: a URL that points to the image
File data. Can either be:
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
- URL: a URL that points to the image
Assistant { content, role, providerOptions } An assistant message. It can contain text, tool calls, or a combination of text and tool calls.
An assistant message. It can contain text, tool calls, or a combination of text and tool calls.
content: string | Array<Text { text, type, providerOptions } | File { data, mediaType, type, 2 more } | Reasoning { text, type, providerOptions } | 3 more>Content of an assistant message. It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
Content of an assistant message. It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
Array<Text { text, type, providerOptions } | File { data, mediaType, type, 2 more } | Reasoning { text, type, providerOptions } | 3 more>
Text { text, type, providerOptions } Text content part of a prompt. It contains a string of text.
Text content part of a prompt. It contains a string of text.
File { data, mediaType, type, 2 more } File content part of a prompt. It contains a file.
File content part of a prompt. It contains a file.
data: string | UnionMember1 { buffer, byteLength, byteOffset, 2 more } | ByteLength { byteLength } | V1GlobalBuffer { buffer, byteLength, byteOffset, 2 more } File data. Can either be:
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
- URL: a URL that points to the image
File data. Can either be:
- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer
- URL: a URL that points to the image
Reasoning { text, type, providerOptions } Reasoning content part of a prompt. It contains a reasoning.
Reasoning content part of a prompt. It contains a reasoning.
ToolCall { input, toolCallId, toolName, 3 more } Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
Arguments of the tool call. This is a JSON-serializable object that matches the tool’s input schema.
ToolResult { output, toolCallId, toolName, 2 more } Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
output: Text { type, value, providerOptions } | Json { type, value, providerOptions } | ExecutionDenied { type, providerOptions, reason } | 3 moreResult of the tool call. This is a JSON-serializable object.
Result of the tool call. This is a JSON-serializable object.
Text { type, value, providerOptions }
Json { type, value, providerOptions }
value: string | number | boolean | 2 more | nullA JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
ExecutionDenied { type, providerOptions, reason }
ErrorText { type, value, providerOptions }
ErrorJson { type, value, providerOptions }
value: string | number | boolean | 2 more | nullA JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
Content { type, value }
value: Array<Text { text, type, providerOptions } | Media { data, mediaType, type } | FileData { data, mediaType, type, 2 more } | 6 more>
Text { text, type, providerOptions }
FileData { data, mediaType, type, 2 more }
FileURL { type, url, providerOptions }
FileID { fileId, type, providerOptions }
fileId: string | Record<string, string>ID of the file.
If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. ‘openai’ or ‘anthropic’.
ID of the file.
If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. ‘openai’ or ‘anthropic’.
ImageData { data, mediaType, type, providerOptions }
ImageURL { type, url, providerOptions }
ImageFileID { fileId, type, providerOptions }
fileId: string | Record<string, string>Image that is referenced using a provider file id.
If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. ‘openai’ or ‘anthropic’.
Image that is referenced using a provider file id.
If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. ‘openai’ or ‘anthropic’.
Tool { content, role, providerOptions } A tool message. It contains the result of one or more tool calls.
A tool message. It contains the result of one or more tool calls.
content: Array<ToolResult { output, toolCallId, toolName, 2 more } | ToolApprovalResponse { approvalId, approved, type, 2 more } >Content of a tool message. It is an array of tool result parts.
Content of a tool message. It is an array of tool result parts.
ToolResult { output, toolCallId, toolName, 2 more } Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
output: Text { type, value, providerOptions } | Json { type, value, providerOptions } | ExecutionDenied { type, providerOptions, reason } | 3 moreResult of the tool call. This is a JSON-serializable object.
Result of the tool call. This is a JSON-serializable object.
Text { type, value, providerOptions }
Json { type, value, providerOptions }
value: string | number | boolean | 2 more | nullA JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
ExecutionDenied { type, providerOptions, reason }
ErrorText { type, value, providerOptions }
ErrorJson { type, value, providerOptions }
value: string | number | boolean | 2 more | nullA JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
A JSON value can be a string, number, boolean, object, array, or null. JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
Content { type, value }
value: Array<Text { text, type, providerOptions } | Media { data, mediaType, type } | FileData { data, mediaType, type, 2 more } | 6 more>
Text { text, type, providerOptions }
FileData { data, mediaType, type, 2 more }
FileURL { type, url, providerOptions }
FileID { fileId, type, providerOptions }
fileId: string | Record<string, string>ID of the file.
If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. ‘openai’ or ‘anthropic’.
ID of the file.
If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. ‘openai’ or ‘anthropic’.
ImageData { data, mediaType, type, providerOptions }
ImageURL { type, url, providerOptions }
ImageFileID { fileId, type, providerOptions }
fileId: string | Record<string, string>Image that is referenced using a provider file id.
If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. ‘openai’ or ‘anthropic’.
Image that is referenced using a provider file id.
If you use multiple providers, you need to specify the provider specific ids using the Record option. The key is the provider name, e.g. ‘openai’ or ‘anthropic’.
V1AutomateEventAIGenerationError { data, event } Envelope for the “ai:generation:error” event from /v1/automate.
Envelope for the “ai:generation:error” event from /v1/automate.
V1AutomateEventBrowserActionCompleted { data, event } Envelope for the “browser:action_completed” event from /v1/automate.
Envelope for the “browser:action_completed” event from /v1/automate.
V1AutomateEventBrowserActionStarted { data, event } Envelope for the “browser:action_started” event from /v1/automate.
Envelope for the “browser:action_started” event from /v1/automate.
V1AutomateEventBrowserNavigated { data, event } Envelope for the “browser:navigated” event from /v1/automate.
Envelope for the “browser:navigated” event from /v1/automate.
V1AutomateEventBrowserReconnected { data, event } Envelope for the “browser:reconnected” event from /v1/automate.
Envelope for the “browser:reconnected” event from /v1/automate.
V1AutomateEventBrowserScreenshotCaptured { data, event } Envelope for the “browser:screenshot_captured” event from /v1/automate.
Envelope for the “browser:screenshot_captured” event from /v1/automate.
V1AutomateEventBrowserScreenshotCapturedImage { data, event } Envelope for the “browser:screenshot_captured_image” event from /v1/automate.
Envelope for the “browser:screenshot_captured_image” event from /v1/automate.
V1AutomateEventCdpEndpointConnected { data, event } Envelope for the “cdp:endpoint_connected” event from /v1/automate.
Envelope for the “cdp:endpoint_connected” event from /v1/automate.
V1AutomateEventCdpEndpointCycle { data, event } Envelope for the “cdp:endpoint_cycle” event from /v1/automate.
Envelope for the “cdp:endpoint_cycle” event from /v1/automate.
V1AutomateEventComplete { data, event } Envelope for the “complete” event from /v1/automate.
Envelope for the “complete” event from /v1/automate.
data: Data { finalAnswer, stats, success, error } Payload for the complete stream event. Structurally identical to TaskExecutionResult from webAgent.ts — the complete event’s data is the agent’s final TaskExecutionResult, stringified onto the SSE stream.
Payload for the complete stream event. Structurally identical to TaskExecutionResult from webAgent.ts — the complete event’s data is the agent’s final TaskExecutionResult, stringified onto the SSE stream.
V1AutomateEventError { data, event } Envelope for the “error” event from /v1/automate.
Envelope for the “error” event from /v1/automate.
data: Data { error, success } Payload for the top-level error stream event. Emitted when an uncaught error escapes the task runner. Mirrors ErrorResponse from the server package’s taskRunner.ts — kept structurally aligned so schema and runtime stay consistent. Distinct from agent-level error events like ai:generation:error and task:validation_error, which are emitted through the normal event emitter during the agent loop.
Payload for the top-level error stream event. Emitted when an uncaught error escapes the task runner. Mirrors ErrorResponse from the server package’s taskRunner.ts — kept structurally aligned so schema and runtime stay consistent. Distinct from agent-level error events like ai:generation:error and task:validation_error, which are emitted through the normal event emitter during the agent loop.
V1AutomateEventInteractiveFormDataError { data, event } Envelope for the “interactive:form_data:error” event from /v1/automate.
Envelope for the “interactive:form_data:error” event from /v1/automate.
data: Data { fieldErrors, fields, formDescription, 5 more } Event data when form validation fails and the agent re-requests data. Carries both the error context and the fields that need new values. Callers respond to this the same way as a request event.
Event data when form validation fails and the agent re-requests data. Carries both the error context and the fields that need new values. Callers respond to this the same way as a request event.
V1AutomateEventInteractiveFormDataRequest { data, event } Envelope for the “interactive:form_data:request” event from /v1/automate.
Envelope for the “interactive:form_data:request” event from /v1/automate.
V1AutomateEventSystemDebugCompression { data, event } Envelope for the “system:debug_compression” event from /v1/automate.
Envelope for the “system:debug_compression” event from /v1/automate.
V1AutomateEventSystemDebugMessage { data, event } Envelope for the “system:debug_message” event from /v1/automate.
Envelope for the “system:debug_message” event from /v1/automate.
V1AutomateEventTaskCompleted { data, event } Envelope for the “task:completed” event from /v1/automate.
Envelope for the “task:completed” event from /v1/automate.
V1AutomateEventTaskMetricsIncremental { data, event } Envelope for the “task:metrics_incremental” event from /v1/automate.
Envelope for the “task:metrics_incremental” event from /v1/automate.
V1AutomateEventTaskSetup { data, event } Envelope for the “task:setup” event from /v1/automate.
Envelope for the “task:setup” event from /v1/automate.
V1AutomateEventTaskTraceContext { data, event } Envelope for the “task:trace_context” event from /v1/automate.
Envelope for the “task:trace_context” event from /v1/automate.
V1AutomateEventTaskValidated { data, event } Envelope for the “task:validated” event from /v1/automate.
Envelope for the “task:validated” event from /v1/automate.
ResearchEvent = V1ResearchEventAnalyzingEnd { data, event } | V1ResearchEventAnalyzingStart { data, event } | V1ResearchEventComplete { data, event } | 20 moreA Server-Sent Event from /v1/research. Typed discriminated union keyed on event.
A Server-Sent Event from /v1/research. Typed discriminated union keyed on event.
V1ResearchEventAnalyzingEnd { data, event } Envelope for the “analyzing:end” event from /v1/research.
Envelope for the “analyzing:end” event from /v1/research.
V1ResearchEventAnalyzingStart { data, event } Envelope for the “analyzing:start” event from /v1/research.
Envelope for the “analyzing:start” event from /v1/research.
V1ResearchEventComplete { data, event } Envelope for the “complete” event from /v1/research.
Envelope for the “complete” event from /v1/research.
data: Data { message, metadata, report, timestamp } complete - Research finished successfully
complete - Research finished successfully
metadata: Metadata { executedQueries, mode, prompt, 11 more } Research metadata
Note: citedPages, gapEvaluations, outline, and judgments are optional to support fast mode, which skips these phases for maximum speed.
Research metadata
Note: citedPages, gapEvaluations, outline, and judgments are optional to support fast mode, which skips these phases for maximum speed.
mode: "fast" | "balanced" | "deep" | 2 moreResearch mode determines depth, thinking budget, and quality controls
Modes (in order of cost/thoroughness):
- fast: Quick answers with minimal validation (~$2, 1 iteration, no judge)
- balanced: Standard research with moderate depth (~$8, 3 iterations, Flash models, no judge)
- deep: Thorough research with judge review (~$15, 5 iterations, Flash models, with judge)
- max: Maximum quality with Pro models (~$40, 5 iterations, Pro models, with judge)
- ultra: Ultimate tier - all Pro models, 10 iterations (expensive, for when accuracy is paramount)
Research mode determines depth, thinking budget, and quality controls
Modes (in order of cost/thoroughness):
- fast: Quick answers with minimal validation (~$2, 1 iteration, no judge)
- balanced: Standard research with moderate depth (~$8, 3 iterations, Flash models, no judge)
- deep: Thorough research with judge review (~$15, 5 iterations, Flash models, with judge)
- max: Maximum quality with Pro models (~$40, 5 iterations, Pro models, with judge)
- ultra: Ultimate tier - all Pro models, 10 iterations (expensive, for when accuracy is paramount)
citedPages?: Array<CitedPage>Pages cited in the report, ordered by first citation appearance
Pages cited in the report, ordered by first citation appearance
gapEvaluations?: Array<GapEvaluation>
Based on unanswered/partial questions, what specific information is still needed?
questionAssessments: Array<QuestionAssessment>Assessment of each research question’s status and findings
Assessment of each research question’s status and findings
researchCoverage: "Light" | "Moderate" | "Solid" | "Comprehensive"Research coverage level - assesses quality across all questions.
Hierarchy: Light < Moderate < Solid < Comprehensive
- Light: Basic info on some questions, most need more depth → Continue
- Moderate: Multiple questions answered, some remain partial → Continue
- Solid: Most questions well-answered with validated sources → Sufficient to stop
- Comprehensive: All questions thoroughly answered, exceptional depth → Definitely stop
Research coverage level - assesses quality across all questions.
Hierarchy: Light < Moderate < Solid < Comprehensive
- Light: Basic info on some questions, most need more depth → Continue
- Moderate: Multiple questions answered, some remain partial → Continue
- Solid: Most questions well-answered with validated sources → Sufficient to stop
- Comprehensive: All questions thoroughly answered, exceptional depth → Definitely stop
Explicit decision: should research continue with another iteration?
- Considers: how many questions unanswered/partial, coverage for mode, remaining iterations
- Drives query generation: true → generate queries, false → stop researching
metrics?: Metrics { cachedFetches, cachedSearches, fetches, 7 more } Complete research metrics
Complete research metrics
V1ResearchEventError { data, event } Envelope for the “error” event from /v1/research.
Envelope for the “error” event from /v1/research.
V1ResearchEventEvaluatingEnd { data, event } Envelope for the “evaluating:end” event from /v1/research.
Envelope for the “evaluating:end” event from /v1/research.
V1ResearchEventEvaluatingStart { data, event } Envelope for the “evaluating:start” event from /v1/research.
Envelope for the “evaluating:start” event from /v1/research.
V1ResearchEventFollowingEnd { data, event } Envelope for the “following:end” event from /v1/research.
Envelope for the “following:end” event from /v1/research.
V1ResearchEventFollowingStart { data, event } Envelope for the “following:start” event from /v1/research.
Envelope for the “following:start” event from /v1/research.
V1ResearchEventIterationEnd { data, event } Envelope for the “iteration:end” event from /v1/research.
Envelope for the “iteration:end” event from /v1/research.
V1ResearchEventIterationStart { data, event } Envelope for the “iteration:start” event from /v1/research.
Envelope for the “iteration:start” event from /v1/research.
V1ResearchEventJudgingStart { data, event } Envelope for the “judging:start” event from /v1/research.
Envelope for the “judging:start” event from /v1/research.
V1ResearchEventOutliningEnd { data, event } Envelope for the “outlining:end” event from /v1/research.
Envelope for the “outlining:end” event from /v1/research.
V1ResearchEventOutliningStart { data, event } Envelope for the “outlining:start” event from /v1/research.
Envelope for the “outlining:start” event from /v1/research.
V1ResearchEventPlanningStart { data, event } Envelope for the “planning:start” event from /v1/research.
Envelope for the “planning:start” event from /v1/research.
V1ResearchEventPrefetchingEnd { data, event } Envelope for the “prefetching:end” event from /v1/research.
Envelope for the “prefetching:end” event from /v1/research.
V1ResearchEventPrefetchingStart { data, event } Envelope for the “prefetching:start” event from /v1/research.
Envelope for the “prefetching:start” event from /v1/research.
V1ResearchEventSearchingEnd { data, event } Envelope for the “searching:end” event from /v1/research.
Envelope for the “searching:end” event from /v1/research.
V1ResearchEventSearchingStart { data, event } Envelope for the “searching:start” event from /v1/research.
Envelope for the “searching:start” event from /v1/research.