AI Task
Execute AI-powered browser automation tasks using natural language with optional geotargeting. This endpoint always streams responses using Server-Sent Events (SSE).
Streaming Response:
- All responses are streamed using Server-Sent Events (
text/event-stream) - Real-time progress updates and results as they’re generated
Geotargeting:
- Optionally specify a country code for geotargeted browsing
Use Cases:
- Web scraping and data extraction
- Form filling and interaction
- Navigation and information gathering
- Multi-step web workflows
- Content analysis from web pages
ParametersExpand Collapse
body: AgentAutomateParams { task, data, geo_target, 5 more }
Optional geotargeting parameters for proxy requests
Optional geotargeting parameters for proxy requests
Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., “US”, “GB”, “JP”). See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
ReturnsExpand 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.
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.
AI Task
import Tabstack from '@tabstack/sdk';
const client = new Tabstack({
apiKey: process.env['TABSTACK_API_KEY'], // This is the default and can be omitted
});
const automateEvent = await client.agent.automate({
task: 'Find the top 3 trending repositories and extract their names, descriptions, and star counts',
guardrails: "browse and extract only, don't interact with repositories",
url: 'https://github.com/trending',
});
console.log(automateEvent);{
"error": "maxIterations must be between 1 and 100"
}{
"error": "invalid URL format"
}{
"error": "task is required"
}Returns Examples
{
"error": "maxIterations must be between 1 and 100"
}{
"error": "invalid URL format"
}{
"error": "task is required"
}