{"openapi":"3.0.3","info":{"contact":{},"description":"Production API for web content extraction, transformation, research, and automation. Organize your workflows with semantic endpoints for extracting structured data, generating AI-powered content, conducting research, and automating browser tasks.","title":"tabs-api","version":"1.0"},"servers":[{"url":"https://api.tabstack.ai/v1"}],"paths":{"/automate":{"post":{"description":"Execute AI-powered browser automation tasks using natural language with optional geotargeting. This endpoint **always streams** responses using Server-Sent Events (SSE).\n\n**Streaming Response:**\n- All responses are streamed using Server-Sent Events (`text/event-stream`)\n- Real-time progress updates and results as they're generated\n\n**Geotargeting:**\n- Optionally specify a country code for geotargeted browsing\n\n**Use Cases:**\n- Web scraping and data extraction\n- Form filling and interaction\n- Navigation and information gathering\n- Multi-step web workflows\n- Content analysis from web pages","operationId":"automateV1","requestBody":{"content":{"application/json":{"examples":{"dataExtraction":{"summary":"Extract trending repositories","value":{"guardrails":"browse and extract only, don't interact with repositories","task":"Find the top 3 trending repositories and extract their names, descriptions, and star counts","url":"https://github.com/trending"}},"formFilling":{"summary":"Fill out contact form","value":{"data":{"email":"alex@example.com","message":"Interested in learning more about your enterprise plan","name":"Alex Johnson"},"task":"Submit the contact form with my information","trusted_hostnames":["company.com"],"url":"https://company.com/contact"}},"unsafeMode":{"summary":"Disable the action firewall (trusted environments only)","value":{"data":{"amount":"42.00","username":"alex"},"task":"Log in and submit the expense report","unsafe_mode":true,"url":"https://internal.example.com/expenses"}},"webScraping":{"summary":"Scrape product information","value":{"guardrails":"extract product details only, don't add to cart or checkout","task":"Find the product name, price, and availability status","url":"https://example-store.com/product/wireless-headphones"}}},"schema":{"$ref":"#/components/schemas/v1.AutomateRequest"}}},"description":"Request body with optional geotargeting","required":true},"responses":{"200":{"content":{"text/event-stream":{"examples":{"githubTrending":{"summary":"Extract GitHub trending repositories","value":"event: start\ndata: {\"task\": \"Find the top 3 trending repositories\", \"url\": \"https://github.com/trending\"}\n\nevent: agent:processing\ndata: {\"operation\": \"Creating task plan\", \"hasScreenshot\": false}\n\nevent: browser:navigated\ndata: {\"title\": \"Trending - GitHub\", \"url\": \"https://github.com/trending\"}\n\nevent: agent:extracted\ndata: {\"extractedData\": \"[{\\\"name\\\": \\\"awesome-ai\\\", \\\"stars\\\": \\\"45.2k\\\"}]\"}\n\nevent: task:completed\ndata: {\"success\": true, \"finalAnswer\": \"Top 3 trending repos extracted\"}\n\nevent: complete\ndata: {\"success\": true}\n\nevent: done\ndata: {}\n"},"productLookup":{"summary":"Extract product information","value":"event: start\ndata: {\"task\": \"Find product details\", \"url\": \"https://store.com/product\"}\n\nevent: browser:navigated\ndata: {\"title\": \"Product Page\", \"url\": \"https://store.com/product\"}\n\nevent: agent:extracted\ndata: {\"extractedData\": \"{\\\"name\\\": \\\"Headphones\\\", \\\"price\\\": \\\"$299.99\\\"}\"}\n\nevent: task:completed\ndata: {\"success\": true}\n\nevent: done\ndata: {}\n"}},"schema":{"$ref":"#/components/schemas/v1.AutomateEvent"}}},"description":"Task executed successfully (always streaming)\n\n**Streaming Response using Server-Sent Events:**\nAll responses from the automate endpoint are streamed using Server-Sent Events.\n\n**Event Format:**\n- Each event starts with `event: <type>` followed by `data: <JSON>`\n- Empty lines separate events\n\n**Event Types:**\n\n**Task Events:**\n- `start`: Task initialization\n- `task:setup`: Task configuration\n- `task:started`: Task execution begins\n- `task:completed`: Task finished successfully\n- `task:aborted`: Task was terminated\n- `task:validated`: Task completion validation\n- `task:validation_error`: Validation failed\n\n**Agent Events:**\n- `agent:processing`: Agent thinking/planning\n- `agent:status`: Status updates and plans\n- `agent:step`: Processing step iterations\n- `agent:action`: Actions being performed\n- `agent:reasoned`: Agent reasoning output\n- `agent:extracted`: Data extraction results\n- `agent:waiting`: Agent waiting for operations\n\n**Browser Events:**\n- `browser:navigated`: Page navigation events\n- `browser:action_started`: Browser action initiated\n- `browser:action_completed`: Browser action finished\n- `browser:screenshot_captured`: Screenshot taken\n\n**System Events:**\n- `system:debug_compression`: Debug compression info\n- `system:debug_message`: Debug messages\n\n**Stream Control:**\n- `complete`: End of stream with results\n- `done`: Stream termination\n- `error`: Error occurred\n"},"400":{"content":{"application/json":{"examples":{"invalidIterations":{"value":{"error":"maxIterations must be between 1 and 100"}},"invalidUrl":{"value":{"error":"invalid URL format"}},"missingTask":{"value":{"error":"task is required"}}}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Bad request - Invalid task or missing required fields"},"401":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Unauthorized - Invalid or missing Bearer token"},"402":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Payment Required - organization is out of credits"},"429":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Too Many Requests - rate limit exceeded"},"500":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Internal server error"},"503":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Service unavailable - Automate service not configured"}},"security":[{"BearerAuth":[]}],"summary":"AI Task","tags":["Automate"],"x-position":4}},"/automate/{requestID}/input":{"post":{"description":"Submit a response to an interactive form data request from an in-progress automation task. When the AI agent encounters a form requiring user data, it emits an `interactive:form_data:request` or `interactive:form_data:error` SSE event containing a `requestId`. Use this endpoint to provide the requested data or cancel the request.\n\n**Lifecycle:**\n- Input requests expire after 2 minutes by default\n- Expired, already-answered, or unknown requests return `410 Gone`\n- A `requestID` belonging to another organization is not visible to you and returns `410 Gone`\n- Successful submissions return `202 Accepted` (fire-and-forget from caller's perspective)","operationId":"automateInputV1","parameters":[{"description":"The request ID from the interactive:form_data:request SSE event","in":"path","name":"requestID","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.AutomateInputRequest"}}},"description":"Input response with field values or cancellation","required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.AutomateInputResponse"}}},"description":"Input response accepted and forwarded to the automation task"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Bad request - Invalid JSON"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Unauthorized - Invalid or missing Bearer token"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Payment Required - organization is out of credits"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Gone - Input request has expired or already been answered"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Too Many Requests - rate limit exceeded"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Internal server error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Service unavailable - Input service not configured"}},"security":[{"BearerAuth":[]}],"summary":"Submit Input Response","tags":["Automate"]}},"/extract/json":{"post":{"description":"Fetches a URL and extracts structured data according to a provided JSON schema","operationId":"extractJsonV1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ExtractJSONRequest"}}},"description":"Request body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ExtractJSONResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"examples":{"invalidJson":{"value":{"error":"invalid JSON request body"}},"invalidSchema":{"value":{"error":"json schema must be a valid object"}},"missingSchema":{"value":{"error":"json schema is required"}},"missingUrl":{"value":{"error":"url is required"}}},"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Bad request - invalid input"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Unauthorized - Invalid or missing Bearer token"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Payment Required - organization is out of credits"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Invalid URL or inaccessible resource"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Too Many Requests - rate limit exceeded"},"500":{"content":{"application/json":{"examples":{"fetchError":{"value":{"error":"failed to fetch URL"}},"generationError":{"value":{"error":"failed to generate JSON"}},"tooLarge":{"value":{"error":"web page is too large"}}},"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Server error"}},"security":[{"BearerAuth":[]}],"summary":"JSON","tags":["Extract"],"x-position":2}},"/extract/markdown":{"post":{"description":"Fetches a URL and converts its HTML content to clean Markdown format with optional metadata extraction","operationId":"extractMarkdownV1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ExtractMarkdownRequest"}}},"description":"Request body","required":true},"responses":{"200":{"content":{"application/json":{"examples":{"withMetadata":{"summary":"Response with separate metadata field (when metadata=true)","value":{"content":"# Example Article Title\n\nThis is the article content converted to markdown...","metadata":{"author":"Example Author","description":"This is an example article description","image":"https://example.com/images/article.jpg","publisher":"Example Publisher","site_name":"Example Blog","title":"Example Article Title","type":"article","url":"https://example.com/blog/article"},"url":"https://example.com/blog/article"}},"withoutMetadata":{"summary":"Default response (metadata in YAML frontmatter)","value":{"content":"---\ntitle: Example Article Title\ndescription: This is an example article description\nauthor: Example Author\npublisher: Example Publisher\nimage: https://example.com/images/article.jpg\nsite_name: Example Blog\nurl: https://example.com/blog/article\ntype: article\n---\n\n# Example Article Title\n\nThis is the article content converted to markdown...","url":"https://example.com/blog/article"}}},"schema":{"$ref":"#/components/schemas/v1.ExtractMarkdownResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Bad request - URL is required"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Unauthorized - Invalid or missing Bearer token"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Payment Required - organization is out of credits"},"422":{"content":{"application/json":{"examples":{"internalResource":{"value":{"error":"access to internal resources is not allowed"}},"invalidUrl":{"value":{"error":"url is invalid"}}},"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Invalid URL or inaccessible resource"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Too Many Requests - rate limit exceeded"},"500":{"content":{"application/json":{"examples":{"conversionError":{"value":{"error":"failed to convert HTML to Markdown"}},"fetchError":{"value":{"error":"failed to fetch URL"}}},"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Server error"}},"security":[{"BearerAuth":[]}],"summary":"Markdown","tags":["Extract"],"x-position":1}},"/generate/json":{"post":{"description":"Fetches URL content, extracts data, and transforms it using AI based on custom instructions. Use this to generate new content, summaries, or restructured data.","operationId":"generateJsonV1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.GenerateJSONRequest"}}},"description":"Request body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.GenerateJSONResponse"}}},"description":"OK"},"400":{"content":{"application/json":{"examples":{"invalidJson":{"value":{"error":"invalid JSON request body"}},"invalidSchema":{"value":{"error":"json schema must be a valid object"}},"missingInstructions":{"value":{"error":"instructions are required"}},"missingSchema":{"value":{"error":"json schema is required"}},"missingUrl":{"value":{"error":"url is required"}}},"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Bad request - invalid input"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Unauthorized - Invalid or missing Bearer token"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Payment Required - organization is out of credits"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Invalid URL or inaccessible resource"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Too Many Requests - rate limit exceeded"},"500":{"content":{"application/json":{"examples":{"fetchError":{"value":{"error":"failed to fetch URL"}},"tooLarge":{"value":{"error":"web page is too large"}},"transformError":{"value":{"error":"failed to transform data"}}},"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Server error"}},"security":[{"BearerAuth":[]}],"summary":"JSON","tags":["Generate"],"x-position":3}},"/research":{"post":{"description":"Execute AI-powered research queries that search the web, analyze sources, and synthesize comprehensive answers. This endpoint **always streams** responses using Server-Sent Events (SSE).\n\n**Streaming Response:**\n- All responses are streamed using Server-Sent Events (`text/event-stream`)\n- Real-time progress updates as research progresses through phases\n\n**Research Modes:**\n- `fast` - Quick answers with minimal web searches (default)\n- `balanced` - Standard research with multiple iterations\n\n**Use Cases:**\n- Answering complex questions with cited sources\n- Synthesizing information from multiple web sources\n- Research reports on specific topics\n- Fact-checking and verification tasks","operationId":"researchV1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ResearchRequest"}}},"description":"Request body","required":true},"responses":{"200":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ResearchEvent"}}},"description":"SSE stream with research progress and results"},"400":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Bad request - Invalid query or missing required fields"},"401":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Unauthorized - Invalid or missing Bearer token"},"402":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Payment Required - organization is out of credits"},"429":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Too Many Requests - rate limit exceeded"},"500":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Internal server error"},"503":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/v1.ErrorResponse"}}},"description":"Service unavailable - Research service not configured"}},"security":[{"BearerAuth":[]}],"summary":"Research","tags":["Research"]}}},"components":{"schemas":{"api_v1.ExtractJSONRequest":{"properties":{"effort":{"example":"standard"},"json_schema":{"example":{"properties":{"stories":{"items":{"properties":{"author":{"description":"Author username","type":"string"},"points":{"description":"Story points","type":"number"},"title":{"description":"Story title","type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}}},"api_v1.ExtractJSONResponse":{"description":"The extracted data matching the provided schema","example":{"stories":[{"author":"techuser","points":342,"title":"New AI Model Released"},{"author":"dbexpert","points":156,"title":"Database Performance Tips"}]}},"api_v1.GenerateJSONRequest":{"properties":{"effort":{"example":"standard"},"json_schema":{"example":{"properties":{"summaries":{"items":{"properties":{"category":{"description":"Story category (tech/business/science/etc)","type":"string"},"summary":{"description":"One-sentence summary of the story","type":"string"},"title":{"description":"Story title","type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}}},"api_v1.GenerateJSONResponse":{"description":"The transformed data matching the provided schema","example":{"summaries":[{"category":"tech","summary":"A research lab announced a new large language model that achieves state-of-the-art performance on reasoning tasks.","title":"New AI Model Released"},{"category":"tech","summary":"An engineer shares optimization techniques that reduced their database query times by 90%.","title":"Database Performance Tips"},{"category":"business","summary":"A company developing carbon capture technology secured $50M in Series B funding.","title":"Climate Tech Startup Raises Funding"}]}},"geotarget.GeoTarget":{"properties":{"country":{"description":"Country code using ISO 3166-1 alpha-2 standard (2 letters, e.g., \"US\", \"GB\", \"JP\").\nSee: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2","example":"US","type":"string"}},"type":"object"},"pagemetadata.Metadata":{"properties":{"author":{"description":"Author information from HTML metadata","example":"Example Author","type":"string","x-order":"2"},"created_at":{"description":"Document creation date (ISO 8601)","example":"2024-01-15T10:30:00Z","type":"string","x-order":"10"},"creator":{"description":"Creator application (e.g., \"Microsoft Word\")","example":"Microsoft Word","type":"string","x-order":"12"},"description":{"description":"Page description from Open Graph or HTML","example":"This is an example article description","type":"string","x-order":"1"},"favicon":{"description":"Favicon URL (resolved to absolute) parsed from <link rel=\"icon\"> / \"shortcut icon\" / \"apple-touch-icon\"","example":"https://example.com/favicon.ico","format":"uri","type":"string","x-order":"16"},"image":{"description":"Featured image URL from Open Graph","example":"https://example.com/images/article.jpg","format":"uri","type":"string","x-order":"4"},"keywords":{"description":"PDF keywords as array","example":["keyword1","keyword2"],"items":{"type":"string"},"type":"array","x-order":"9"},"modified_at":{"description":"Document modification date (ISO 8601)","example":"2024-01-20T15:45:00Z","type":"string","x-order":"11"},"page_count":{"description":"Number of pages (PDF documents)","example":42,"type":"integer","x-order":"14"},"pdf_version":{"description":"PDF version (e.g., \"1.5\")","example":"1.5","type":"string","x-order":"15"},"producer":{"description":"PDF producer software (e.g., \"Adobe PDF Library\")","example":"Adobe PDF Library 15.0","type":"string","x-order":"13"},"publisher":{"description":"Publisher information from Open Graph","example":"Example Publisher","type":"string","x-order":"3"},"site_name":{"description":"Site name from Open Graph","example":"Example Blog","type":"string","x-order":"5"},"subject":{"description":"PDF-specific metadata fields (populated for PDF documents)\nPDF subject or summary","example":"Document subject","type":"string","x-order":"8"},"title":{"description":"Page title from Open Graph or HTML","example":"Example Article Title","type":"string","x-order":"0"},"type":{"description":"Content type from Open Graph (e.g., article, website)","example":"article","type":"string","x-order":"7"},"url":{"description":"Canonical URL from Open Graph","example":"https://example.com/blog/article","format":"uri","type":"string","x-order":"6"}},"type":"object"},"tabs-api_internal_pilo.Request":{"properties":{"data":{"example":{"language":"Python","timeRange":"today"}}}},"v1.AutomateEvent":{"type":"object","description":"A Server-Sent Event from /v1/automate. Typed discriminated union keyed on event.","required":["event","data"],"discriminator":{"propertyName":"event","mapping":{"agent:action":"#/components/schemas/v1.AutomateEvent_AgentAction","agent:extracted":"#/components/schemas/v1.AutomateEvent_AgentExtracted","agent:processing":"#/components/schemas/v1.AutomateEvent_AgentProcessing","agent:reasoned":"#/components/schemas/v1.AutomateEvent_AgentReasoned","agent:status":"#/components/schemas/v1.AutomateEvent_AgentStatus","agent:step":"#/components/schemas/v1.AutomateEvent_AgentStep","agent:waiting":"#/components/schemas/v1.AutomateEvent_AgentWaiting","ai:generation":"#/components/schemas/v1.AutomateEvent_AiGeneration","ai:generation:error":"#/components/schemas/v1.AutomateEvent_AiGenerationError","browser:action_completed":"#/components/schemas/v1.AutomateEvent_BrowserActionCompleted","browser:action_started":"#/components/schemas/v1.AutomateEvent_BrowserActionStarted","browser:navigated":"#/components/schemas/v1.AutomateEvent_BrowserNavigated","browser:reconnected":"#/components/schemas/v1.AutomateEvent_BrowserReconnected","browser:screenshot_captured":"#/components/schemas/v1.AutomateEvent_BrowserScreenshotCaptured","browser:screenshot_captured_image":"#/components/schemas/v1.AutomateEvent_BrowserScreenshotCapturedImage","cdp:endpoint_connected":"#/components/schemas/v1.AutomateEvent_CdpEndpointConnected","cdp:endpoint_cycle":"#/components/schemas/v1.AutomateEvent_CdpEndpointCycle","complete":"#/components/schemas/v1.AutomateEvent_Complete","done":"#/components/schemas/v1.AutomateEvent_Done","error":"#/components/schemas/v1.AutomateEvent_Error","interactive:form_data:error":"#/components/schemas/v1.AutomateEvent_InteractiveFormDataError","interactive:form_data:request":"#/components/schemas/v1.AutomateEvent_InteractiveFormDataRequest","system:debug_compression":"#/components/schemas/v1.AutomateEvent_SystemDebugCompression","system:debug_message":"#/components/schemas/v1.AutomateEvent_SystemDebugMessage","task:aborted":"#/components/schemas/v1.AutomateEvent_TaskAborted","task:completed":"#/components/schemas/v1.AutomateEvent_TaskCompleted","task:metrics":"#/components/schemas/v1.AutomateEvent_TaskMetrics","task:metrics_incremental":"#/components/schemas/v1.AutomateEvent_TaskMetricsIncremental","task:setup":"#/components/schemas/v1.AutomateEvent_TaskSetup","task:started":"#/components/schemas/v1.AutomateEvent_TaskStarted","task:trace_context":"#/components/schemas/v1.AutomateEvent_TaskTraceContext","task:validated":"#/components/schemas/v1.AutomateEvent_TaskValidated","task:validation_error":"#/components/schemas/v1.AutomateEvent_TaskValidationError"}},"oneOf":[{"$ref":"#/components/schemas/v1.AutomateEvent_AgentAction"},{"$ref":"#/components/schemas/v1.AutomateEvent_AgentExtracted"},{"$ref":"#/components/schemas/v1.AutomateEvent_AgentProcessing"},{"$ref":"#/components/schemas/v1.AutomateEvent_AgentReasoned"},{"$ref":"#/components/schemas/v1.AutomateEvent_AgentStatus"},{"$ref":"#/components/schemas/v1.AutomateEvent_AgentStep"},{"$ref":"#/components/schemas/v1.AutomateEvent_AgentWaiting"},{"$ref":"#/components/schemas/v1.AutomateEvent_AiGeneration"},{"$ref":"#/components/schemas/v1.AutomateEvent_AiGenerationError"},{"$ref":"#/components/schemas/v1.AutomateEvent_BrowserActionCompleted"},{"$ref":"#/components/schemas/v1.AutomateEvent_BrowserActionStarted"},{"$ref":"#/components/schemas/v1.AutomateEvent_BrowserNavigated"},{"$ref":"#/components/schemas/v1.AutomateEvent_BrowserReconnected"},{"$ref":"#/components/schemas/v1.AutomateEvent_BrowserScreenshotCaptured"},{"$ref":"#/components/schemas/v1.AutomateEvent_BrowserScreenshotCapturedImage"},{"$ref":"#/components/schemas/v1.AutomateEvent_CdpEndpointConnected"},{"$ref":"#/components/schemas/v1.AutomateEvent_CdpEndpointCycle"},{"$ref":"#/components/schemas/v1.AutomateEvent_Complete"},{"$ref":"#/components/schemas/v1.AutomateEvent_Done"},{"$ref":"#/components/schemas/v1.AutomateEvent_Error"},{"$ref":"#/components/schemas/v1.AutomateEvent_InteractiveFormDataError"},{"$ref":"#/components/schemas/v1.AutomateEvent_InteractiveFormDataRequest"},{"$ref":"#/components/schemas/v1.AutomateEvent_SystemDebugCompression"},{"$ref":"#/components/schemas/v1.AutomateEvent_SystemDebugMessage"},{"$ref":"#/components/schemas/v1.AutomateEvent_TaskAborted"},{"$ref":"#/components/schemas/v1.AutomateEvent_TaskCompleted"},{"$ref":"#/components/schemas/v1.AutomateEvent_TaskMetrics"},{"$ref":"#/components/schemas/v1.AutomateEvent_TaskMetricsIncremental"},{"$ref":"#/components/schemas/v1.AutomateEvent_TaskSetup"},{"$ref":"#/components/schemas/v1.AutomateEvent_TaskStarted"},{"$ref":"#/components/schemas/v1.AutomateEvent_TaskTraceContext"},{"$ref":"#/components/schemas/v1.AutomateEvent_TaskValidated"},{"$ref":"#/components/schemas/v1.AutomateEvent_TaskValidationError"}]},"v1.AutomateInputFieldValue":{"properties":{"ref":{"example":"E42","type":"string","x-order":"0"},"value":{"example":"user@example.com","type":"string","x-order":"1"}},"type":"object"},"v1.AutomateInputRequest":{"properties":{"cancelled":{"description":"Set to true to cancel/decline the request","type":"boolean","x-order":"1"},"fields":{"description":"Field values as array of {ref, value} pairs (required when not cancelled)","items":{"$ref":"#/components/schemas/v1.AutomateInputFieldValue"},"type":"array","x-order":"0"}},"type":"object"},"v1.AutomateInputResponse":{"properties":{"status":{"example":"accepted","type":"string"}},"type":"object"},"v1.AutomateRequest":{"properties":{"data":{"description":"JSON data to provide context for form filling or complex tasks","type":"object","x-order":"2"},"geo_target":{"allOf":[{"$ref":"#/components/schemas/geotarget.GeoTarget"}],"description":"Optional geotargeting parameters for proxy requests","x-order":"6"},"guardrails":{"description":"Safety constraints for execution","example":"browse and extract data only, don't star or fork repositories","type":"string","x-order":"3"},"interactive":{"default":false,"description":"Enable interactive mode to allow human-in-the-loop input during task execution","example":false,"type":"boolean","x-order":"7"},"maxIterations":{"default":50,"description":"Maximum task iterations","example":50,"maximum":100,"minimum":1,"type":"integer","x-order":"4"},"maxValidationAttempts":{"default":3,"description":"Maximum validation attempts","example":3,"maximum":10,"minimum":1,"type":"integer","x-order":"5"},"task":{"description":"The task description in natural language","example":"Find the top 3 trending repositories on GitHub and extract their names, descriptions, and star counts","type":"string","x-order":"0"},"trusted_hostnames":{"description":"TrustedHostnames lists hostnames where the action firewall is bypassed for fills and submissions.\nWARNING: on listed hosts, prompt injection from page content can drive the agent to fill and submit any field, including personal and credential data. Use only for sites you fully trust to receive your data.","items":{"type":"string"},"type":"array","x-order":"8"},"unsafe_mode":{"default":false,"description":"UnsafeMode disables the action firewall entirely.\nWARNING: prompt injection from page content can then cause the agent to submit your data, including credentials, personal information, and conversation context, to attacker-controlled forms. Only enable for trusted, controlled environments.","example":false,"type":"boolean","x-order":"9"},"url":{"description":"Starting URL for the task","example":"https://github.com/trending","format":"uri","type":"string","x-order":"1"}},"required":["task"],"type":"object"},"v1.ErrorResponse":{"properties":{"error":{"description":"Human-readable error message","example":"url is required","type":"string"}},"required":["error"],"type":"object"},"v1.ExtractJSONRequest":{"properties":{"effort":{"default":"standard","description":"Fetch effort level controlling speed vs. capability tradeoff. \"min\": fastest, no fallback (1-5s). \"standard\": balanced with enhanced reliability (default, 3-15s). \"max\": full browser rendering for JS-heavy sites (15-60s).","enum":["min","standard","max"],"example":"standard","type":"string","x-order":"4"},"geo_target":{"allOf":[{"$ref":"#/components/schemas/geotarget.GeoTarget"}],"description":"Optional geotargeting parameters for proxy requests","x-order":"3"},"json_schema":{"description":"JSON schema definition that describes the structure of data to extract. If the schema includes a \"page_title\" or \"favicon\" property, those fields are automatically filled from page metadata when the AI leaves them empty.","example":{"properties":{"stories":{"items":{"properties":{"author":{"description":"Author username","type":"string"},"points":{"description":"Story points","type":"number"},"title":{"description":"Story title","type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"type":"object","x-order":"1"},"nocache":{"default":false,"description":"Bypass cache and force fresh data retrieval","example":false,"type":"boolean","x-order":"2"},"url":{"description":"URL to fetch and extract data from","example":"https://news.ycombinator.com","format":"uri","type":"string","x-order":"0"}},"required":["json_schema","url"],"type":"object"},"v1.ExtractJSONResponse":{"additionalProperties":true,"type":"object"},"v1.ExtractMarkdownRequest":{"properties":{"content":{"default":"main","description":"Content scope. \"main\" (default) returns the main article content; \"full\" returns the whole page, including navigation, footer, and links.","enum":["main","full"],"example":"main","type":"string","x-order":"5"},"effort":{"default":"standard","description":"Fetch effort level controlling speed vs. capability tradeoff. \"min\": fastest, no fallback (1-5s). \"standard\": balanced with enhanced reliability (default, 3-15s). \"max\": full browser rendering for JS-heavy sites (15-60s).","enum":["min","standard","max"],"example":"standard","type":"string","x-order":"4"},"geo_target":{"allOf":[{"$ref":"#/components/schemas/geotarget.GeoTarget"}],"description":"Optional geotargeting parameters for proxy requests","x-order":"3"},"metadata":{"default":false,"description":"Include Open Graph and HTML metadata as a separate field in the response","example":true,"type":"boolean","x-order":"1"},"nocache":{"default":false,"description":"Bypass cache and force fresh data retrieval","example":false,"type":"boolean","x-order":"2"},"url":{"description":"URL to fetch and convert to markdown","example":"https://example.com/blog/article","format":"uri","type":"string","x-order":"0"}},"required":["url"],"type":"object"},"v1.ExtractMarkdownResponse":{"properties":{"content":{"description":"The markdown content (includes metadata as YAML frontmatter by default)","example":"# Example Article Title\n\nThis is the article content converted to markdown...","type":"string","x-order":"1"},"metadata":{"allOf":[{"$ref":"#/components/schemas/pagemetadata.Metadata"}],"description":"Extracted metadata from the page (only included when metadata parameter is true)","x-order":"2"},"url":{"description":"The URL that was converted to markdown","example":"https://example.com/blog/article","format":"uri","type":"string","x-order":"0"}},"required":["content","url"],"type":"object"},"v1.GenerateJSONRequest":{"properties":{"effort":{"default":"standard","description":"Fetch effort level controlling speed vs. capability tradeoff. \"min\": fastest, no fallback (1-5s). \"standard\": balanced with enhanced reliability (default, 3-15s). \"max\": full browser rendering for JS-heavy sites (15-60s).","enum":["min","standard","max"],"example":"standard","type":"string","x-order":"5"},"geo_target":{"allOf":[{"$ref":"#/components/schemas/geotarget.GeoTarget"}],"description":"Optional geotargeting parameters for proxy requests","x-order":"4"},"instructions":{"description":"Instructions describing how to transform the data. Maximum 20,000 characters.","example":"For each story, categorize it (tech/business/science/other) and write a one-sentence summary describing the story in simple terms.","maxLength":20000,"type":"string","x-order":"2"},"json_schema":{"description":"JSON schema defining the structure of the transformed output","example":{"properties":{"summaries":{"items":{"properties":{"category":{"description":"Story category (tech/business/science/etc)","type":"string"},"summary":{"description":"One-sentence summary of the story","type":"string"},"title":{"description":"Story title","type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"type":"object","x-order":"1"},"nocache":{"default":false,"description":"Bypass cache and force fresh data retrieval","example":false,"type":"boolean","x-order":"3"},"url":{"description":"URL to fetch content from","example":"https://news.ycombinator.com","format":"uri","type":"string","x-order":"0"}},"required":["instructions","json_schema","url"],"type":"object"},"v1.GenerateJSONResponse":{"additionalProperties":true,"type":"object"},"v1.ResearchEvent":{"type":"object","description":"A Server-Sent Event from /v1/research. Typed discriminated union keyed on event.","required":["event","data"],"discriminator":{"propertyName":"event","mapping":{"analyzing:end":"#/components/schemas/v1.ResearchEvent_AnalyzingEnd","analyzing:start":"#/components/schemas/v1.ResearchEvent_AnalyzingStart","complete":"#/components/schemas/v1.ResearchEvent_Complete","error":"#/components/schemas/v1.ResearchEvent_Error","evaluating:end":"#/components/schemas/v1.ResearchEvent_EvaluatingEnd","evaluating:start":"#/components/schemas/v1.ResearchEvent_EvaluatingStart","following:end":"#/components/schemas/v1.ResearchEvent_FollowingEnd","following:start":"#/components/schemas/v1.ResearchEvent_FollowingStart","iteration:end":"#/components/schemas/v1.ResearchEvent_IterationEnd","iteration:start":"#/components/schemas/v1.ResearchEvent_IterationStart","judging:end":"#/components/schemas/v1.ResearchEvent_JudgingEnd","judging:start":"#/components/schemas/v1.ResearchEvent_JudgingStart","outlining:end":"#/components/schemas/v1.ResearchEvent_OutliningEnd","outlining:start":"#/components/schemas/v1.ResearchEvent_OutliningStart","planning:end":"#/components/schemas/v1.ResearchEvent_PlanningEnd","planning:start":"#/components/schemas/v1.ResearchEvent_PlanningStart","prefetching:end":"#/components/schemas/v1.ResearchEvent_PrefetchingEnd","prefetching:start":"#/components/schemas/v1.ResearchEvent_PrefetchingStart","searching:end":"#/components/schemas/v1.ResearchEvent_SearchingEnd","searching:start":"#/components/schemas/v1.ResearchEvent_SearchingStart","start":"#/components/schemas/v1.ResearchEvent_Start","writing:end":"#/components/schemas/v1.ResearchEvent_WritingEnd","writing:start":"#/components/schemas/v1.ResearchEvent_WritingStart"}},"oneOf":[{"$ref":"#/components/schemas/v1.ResearchEvent_AnalyzingEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_AnalyzingStart"},{"$ref":"#/components/schemas/v1.ResearchEvent_Complete"},{"$ref":"#/components/schemas/v1.ResearchEvent_Error"},{"$ref":"#/components/schemas/v1.ResearchEvent_EvaluatingEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_EvaluatingStart"},{"$ref":"#/components/schemas/v1.ResearchEvent_FollowingEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_FollowingStart"},{"$ref":"#/components/schemas/v1.ResearchEvent_IterationEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_IterationStart"},{"$ref":"#/components/schemas/v1.ResearchEvent_JudgingEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_JudgingStart"},{"$ref":"#/components/schemas/v1.ResearchEvent_OutliningEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_OutliningStart"},{"$ref":"#/components/schemas/v1.ResearchEvent_PlanningEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_PlanningStart"},{"$ref":"#/components/schemas/v1.ResearchEvent_PrefetchingEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_PrefetchingStart"},{"$ref":"#/components/schemas/v1.ResearchEvent_SearchingEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_SearchingStart"},{"$ref":"#/components/schemas/v1.ResearchEvent_Start"},{"$ref":"#/components/schemas/v1.ResearchEvent_WritingEnd"},{"$ref":"#/components/schemas/v1.ResearchEvent_WritingStart"}]},"v1.ResearchRequest":{"properties":{"fetch_timeout":{"description":"Timeout in seconds for fetching web pages","example":30,"type":"integer","x-order":"2"},"mode":{"default":"fast","description":"Research mode: fast (quick answers, default), balanced (standard research)","enum":["fast","balanced"],"example":"fast","type":"string","x-order":"1"},"nocache":{"description":"Bypass cache and force fresh research","example":false,"type":"boolean","x-order":"3"},"query":{"description":"The research query or question to answer. Maximum 10,000 characters.","example":"What are the latest developments in quantum computing?","maxLength":10000,"type":"string","x-order":"0"}},"required":["query"],"type":"object"},"v1.ResearchEvent_AnalyzingEnd":{"type":"object","description":"Envelope for the \"analyzing:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"analyzing:end"},"data":{"$ref":"#/components/schemas/v1.AnalyzingEndEvent"}}},"v1.ResearchEvent_AnalyzingStart":{"type":"object","description":"Envelope for the \"analyzing:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"analyzing:start"},"data":{"$ref":"#/components/schemas/v1.AnalyzingStartEvent"}}},"v1.ResearchEvent_Complete":{"type":"object","description":"Envelope for the \"complete\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"complete"},"data":{"$ref":"#/components/schemas/v1.CompleteEvent"}}},"v1.ResearchEvent_Error":{"type":"object","description":"Envelope for the \"error\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"error"},"data":{"$ref":"#/components/schemas/v1.ErrorEvent"}}},"v1.ResearchEvent_EvaluatingEnd":{"type":"object","description":"Envelope for the \"evaluating:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"evaluating:end"},"data":{"$ref":"#/components/schemas/v1.EvaluatingEndEvent"}}},"v1.ResearchEvent_EvaluatingStart":{"type":"object","description":"Envelope for the \"evaluating:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"evaluating:start"},"data":{"$ref":"#/components/schemas/v1.EvaluatingStartEvent"}}},"v1.ResearchEvent_FollowingEnd":{"type":"object","description":"Envelope for the \"following:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"following:end"},"data":{"$ref":"#/components/schemas/v1.FollowingEndEvent"}}},"v1.ResearchEvent_FollowingStart":{"type":"object","description":"Envelope for the \"following:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"following:start"},"data":{"$ref":"#/components/schemas/v1.FollowingStartEvent"}}},"v1.ResearchEvent_IterationEnd":{"type":"object","description":"Envelope for the \"iteration:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"iteration:end"},"data":{"$ref":"#/components/schemas/v1.IterationEndEvent"}}},"v1.ResearchEvent_IterationStart":{"type":"object","description":"Envelope for the \"iteration:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"iteration:start"},"data":{"$ref":"#/components/schemas/v1.IterationStartEvent"}}},"v1.ResearchEvent_JudgingEnd":{"type":"object","description":"Envelope for the \"judging:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"judging:end"},"data":{"$ref":"#/components/schemas/v1.JudgingEndEvent"}}},"v1.ResearchEvent_JudgingStart":{"type":"object","description":"Envelope for the \"judging:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"judging:start"},"data":{"$ref":"#/components/schemas/v1.JudgingStartEvent"}}},"v1.ResearchEvent_OutliningEnd":{"type":"object","description":"Envelope for the \"outlining:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"outlining:end"},"data":{"$ref":"#/components/schemas/v1.OutliningEndEvent"}}},"v1.ResearchEvent_OutliningStart":{"type":"object","description":"Envelope for the \"outlining:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"outlining:start"},"data":{"$ref":"#/components/schemas/v1.OutliningStartEvent"}}},"v1.ResearchEvent_PlanningEnd":{"type":"object","description":"Envelope for the \"planning:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"planning:end"},"data":{"$ref":"#/components/schemas/v1.PlanningEndEvent"}}},"v1.ResearchEvent_PlanningStart":{"type":"object","description":"Envelope for the \"planning:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"planning:start"},"data":{"$ref":"#/components/schemas/v1.PlanningStartEvent"}}},"v1.ResearchEvent_PrefetchingEnd":{"type":"object","description":"Envelope for the \"prefetching:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"prefetching:end"},"data":{"$ref":"#/components/schemas/v1.PrefetchingEndEvent"}}},"v1.ResearchEvent_PrefetchingStart":{"type":"object","description":"Envelope for the \"prefetching:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"prefetching:start"},"data":{"$ref":"#/components/schemas/v1.PrefetchingStartEvent"}}},"v1.ResearchEvent_SearchingEnd":{"type":"object","description":"Envelope for the \"searching:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"searching:end"},"data":{"$ref":"#/components/schemas/v1.SearchingEndEvent"}}},"v1.ResearchEvent_SearchingStart":{"type":"object","description":"Envelope for the \"searching:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"searching:start"},"data":{"$ref":"#/components/schemas/v1.SearchingStartEvent"}}},"v1.ResearchEvent_Start":{"type":"object","description":"Envelope for the \"start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"start"},"data":{"$ref":"#/components/schemas/v1.StartEvent"}}},"v1.ResearchEvent_WritingEnd":{"type":"object","description":"Envelope for the \"writing:end\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"writing:end"},"data":{"$ref":"#/components/schemas/v1.WritingEndEvent"}}},"v1.ResearchEvent_WritingStart":{"type":"object","description":"Envelope for the \"writing:start\" event from /v1/research.","required":["event","data"],"properties":{"event":{"type":"string","const":"writing:start"},"data":{"$ref":"#/components/schemas/v1.WritingStartEvent"}}},"v1.Activity":{"description":"Activity types for research workflow","enum":["prefetching","planning","iteration","searching","analyzing","following","evaluating","outlining","writing","judging"],"type":"string"},"v1.AnalyzingEndEvent":{"additionalProperties":false,"properties":{"analyzed":{"type":"number"},"failed":{"type":"number"},"iteration":{"type":"number"},"message":{"type":"string"},"samples":{"items":{"$ref":"#/components/schemas/v1.PageSample"},"type":"array"},"timestamp":{"type":"number"}},"required":["message","iteration","analyzed","failed","samples","timestamp"],"type":"object"},"v1.AnalyzingStartEvent":{"additionalProperties":false,"properties":{"iteration":{"type":"number"},"message":{"type":"string"},"pageCount":{"type":"number"},"timestamp":{"type":"number"}},"required":["message","iteration","pageCount","timestamp"],"type":"object"},"v1.CompleteEvent":{"additionalProperties":false,"description":"complete - Research finished successfully","properties":{"message":{"type":"string"},"metadata":{"$ref":"#/components/schemas/v1.ResearchMetadata"},"report":{"type":"string"},"timestamp":{"type":"number"}},"required":["message","report","metadata","timestamp"],"type":"object"},"v1.ErrorEvent":{"additionalProperties":false,"description":"error - Research failed","properties":{"activity":{"$ref":"#/components/schemas/v1.Activity"},"error":{"additionalProperties":false,"properties":{"message":{"type":"string"},"name":{"type":"string"},"stack":{"type":"string"}},"required":["name","message"],"type":"object"},"iteration":{"type":"number"},"message":{"type":"string"},"timestamp":{"type":"number"}},"required":["message","error","timestamp"],"type":"object"},"v1.EvaluatingEndEvent":{"additionalProperties":false,"properties":{"coverage":{"enum":["Light","Moderate","Solid","Comprehensive"],"type":"string"},"gaps":{"type":"string"},"iteration":{"type":"number"},"message":{"type":"string"},"nextQueries":{"items":{"type":"string"},"type":"array"},"questionAssessments":{"items":{"$ref":"#/components/schemas/v1.QuestionAssessment"},"type":"array"},"shouldContinue":{"type":"boolean"},"timestamp":{"type":"number"}},"required":["message","iteration","coverage","gaps","shouldContinue","questionAssessments","nextQueries","timestamp"],"type":"object"},"v1.EvaluatingStartEvent":{"additionalProperties":false,"properties":{"iteration":{"type":"number"},"message":{"type":"string"},"pagesAnalyzed":{"description":"Total pages analyzed so far (including this iteration)","type":"number"},"questionCount":{"description":"Number of research questions being assessed","type":"number"},"timestamp":{"type":"number"}},"required":["message","iteration","pagesAnalyzed","questionCount","timestamp"],"type":"object"},"v1.FollowingEndEvent":{"additionalProperties":false,"properties":{"failed":{"type":"number"},"followed":{"type":"number"},"iteration":{"type":"number"},"message":{"type":"string"},"samples":{"items":{"$ref":"#/components/schemas/v1.PageSample"},"type":"array"},"timestamp":{"type":"number"}},"required":["message","iteration","followed","failed","samples","timestamp"],"type":"object"},"v1.FollowingStartEvent":{"additionalProperties":false,"properties":{"iteration":{"type":"number"},"linkCount":{"type":"number"},"message":{"type":"string"},"timestamp":{"type":"number"}},"required":["message","iteration","linkCount","timestamp"],"type":"object"},"v1.GapEvaluation":{"additionalProperties":false,"description":"Gap evaluation results from research strategist","properties":{"gapDescription":{"description":"Based on unanswered/partial questions, what specific information is still needed?","type":"string"},"newResearchQuestions":{"description":"New research questions to add (optional, use sparingly)\n- Only if original decomposition missed something critical\n- Maximum 2-3 new questions total across all iterations\n- Most iterations should return empty array or omit this field","items":{"type":"string"},"type":"array"},"questionAssessments":{"description":"Assessment of each research question's status and findings","items":{"$ref":"#/components/schemas/v1.ResearchQuestionAssessment"},"type":"array"},"researchCoverage":{"description":"Research coverage level - assesses quality across all questions.\n\nHierarchy: Light < Moderate < Solid < Comprehensive\n\n- **Light**: Basic info on some questions, most need more depth → Continue\n- **Moderate**: Multiple questions answered, some remain partial → Continue\n- **Solid**: Most questions well-answered with validated sources → Sufficient to stop\n- **Comprehensive**: All questions thoroughly answered, exceptional depth → Definitely stop","enum":["Light","Moderate","Solid","Comprehensive"],"type":"string"},"searchQueries":{"description":"Search queries to address identified gaps (only when shouldContinueResearch is true)\n- Target unanswered questions first, then partial questions\n- 3-10 targeted queries if shouldContinueResearch is true\n- Omit or provide empty array if shouldContinueResearch is false","items":{"type":"string"},"type":"array"},"shouldContinueResearch":{"description":"Explicit decision: should research continue with another iteration?\n- Considers: how many questions unanswered/partial, coverage for mode, remaining iterations\n- Drives query generation: true → generate queries, false → stop researching","type":"boolean"}},"required":["questionAssessments","researchCoverage","gapDescription","shouldContinueResearch"],"type":"object"},"v1.IterationEndEvent":{"additionalProperties":false,"properties":{"isLast":{"description":"Whether this is the final iteration","type":"boolean"},"iteration":{"type":"number"},"message":{"type":"string"},"stopReason":{"description":"Why research iterations stopped (only present when isLast is true)","enum":["max_iterations","coverage_sufficient"],"type":"string"},"timestamp":{"type":"number"}},"required":["message","iteration","isLast","timestamp"],"type":"object"},"v1.IterationStartEvent":{"additionalProperties":false,"properties":{"iteration":{"type":"number"},"maxIterations":{"description":"Maximum iterations for this research mode","type":"number"},"message":{"type":"string"},"queries":{"description":"Search queries to execute in this iteration","items":{"type":"string"},"type":"array"},"timestamp":{"type":"number"}},"required":["message","iteration","maxIterations","queries","timestamp"],"type":"object"},"v1.JudgingEndEvent":{"additionalProperties":false,"properties":{"approved":{"type":"boolean"},"attempt":{"type":"number"},"feedback":{"type":"string"},"message":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}},"required":["message","attempt","score","approved","timestamp"],"type":"object"},"v1.JudgingStartEvent":{"additionalProperties":false,"properties":{"attempt":{"type":"number"},"maxAttempts":{"description":"Maximum attempts allowed (1 + maxRevisions)","type":"number"},"message":{"type":"string"},"timestamp":{"type":"number"}},"required":["message","attempt","maxAttempts","timestamp"],"type":"object"},"v1.JudgmentResult":{"additionalProperties":false,"description":"Judgment result from research judge","properties":{"approved":{"type":"boolean"},"feedback":{"type":"string"},"observation":{"type":"string"},"score":{"type":"number"}},"required":["observation","score","approved"],"type":"object"},"v1.Mode":{"description":"Research mode determines depth, thinking budget, and quality controls\n\nModes (in order of cost/thoroughness):\n- **fast**: Quick answers with minimal validation (~$2, 1 iteration, no judge)\n- **balanced**: Standard research with moderate depth (~$8, 3 iterations, Flash models, no judge)\n- **deep**: Thorough research with judge review (~$15, 5 iterations, Flash models, with judge)\n- **max**: Maximum quality with Pro models (~$40, 5 iterations, Pro models, with judge)\n- **ultra**: Ultimate tier - all Pro models, 10 iterations (expensive, for when accuracy is paramount)","enum":["fast","balanced","deep","max","ultra"],"type":"string"},"v1.OutliningEndEvent":{"additionalProperties":false,"properties":{"message":{"type":"string"},"sourcesSelected":{"type":"number"},"timestamp":{"type":"number"}},"required":["message","sourcesSelected","timestamp"],"type":"object"},"v1.OutliningStartEvent":{"additionalProperties":false,"properties":{"message":{"type":"string"},"pagesAnalyzed":{"description":"Total pages analyzed across all iterations","type":"number"},"qualityPageCount":{"description":"Pages that meet quality threshold (medium+ relevance and reliability)","type":"number"},"timestamp":{"type":"number"}},"required":["message","pagesAnalyzed","qualityPageCount","timestamp"],"type":"object"},"v1.PageSample":{"additionalProperties":false,"description":"Page sample - lightweight representation for event payloads","properties":{"domain":{"type":"string"},"relevance":{"enum":["low","medium","high"],"type":"string"},"reliability":{"enum":["low","medium","high"],"type":"string"},"summary":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"urlSource":{"$ref":"#/components/schemas/v1.UrlSource"}},"required":["url","domain","title","urlSource"],"type":"object"},"v1.PlanningEndEvent":{"additionalProperties":false,"properties":{"complexity":{"enum":["simple","moderate","complex"],"type":"string"},"message":{"type":"string"},"objective":{"type":"string"},"plan":{"type":"string"},"queries":{"items":{"type":"string"},"type":"array"},"questions":{"items":{"type":"string"},"type":"array"},"timestamp":{"type":"number"}},"required":["message","objective","questions","complexity","plan","queries","timestamp"],"type":"object"},"v1.PlanningStartEvent":{"additionalProperties":false,"properties":{"hasPrefetchedContext":{"description":"Whether prefetched user-provided URLs exist for context","type":"boolean"},"message":{"type":"string"},"timestamp":{"type":"number"}},"required":["message","hasPrefetchedContext","timestamp"],"type":"object"},"v1.PrefetchingEndEvent":{"additionalProperties":false,"properties":{"failed":{"type":"number"},"fetched":{"type":"number"},"message":{"type":"string"},"timestamp":{"type":"number"}},"required":["message","fetched","failed","timestamp"],"type":"object"},"v1.PrefetchingStartEvent":{"additionalProperties":false,"properties":{"message":{"type":"string"},"timestamp":{"type":"number"},"urlCount":{"type":"number"},"urls":{"items":{"type":"string"},"type":"array"}},"required":["message","urls","urlCount","timestamp"],"type":"object"},"v1.QuestionAssessment":{"allOf":[{"$ref":"#/components/schemas/v1.ResearchQuestionAssessment"}],"description":"Question assessment for evaluating:end payload"},"v1.ResearchMetadata":{"additionalProperties":false,"description":"Research metadata\n\nNote: citedPages, gapEvaluations, outline, and judgments are optional to support fast mode, which skips these phases for maximum speed.","properties":{"citedPages":{"description":"Pages cited in the report, ordered by first citation appearance","items":{"additionalProperties":false,"properties":{"claims":{"items":{"type":"string"},"type":"array"},"depth":{"type":"number"},"fullText":{"description":"Full page text (fetched markdown or search excerpts). Only populated when `includeFullText: true` in ResearchOptions.\n- Fast mode: Parallel API excerpts (~5000 chars)\n- Other modes: Fetched page markdown","type":"string"},"id":{"type":"string"},"parentUrl":{"type":"string"},"relevance":{"enum":["low","medium","high"],"type":"string"},"reliability":{"enum":["low","medium","high"],"type":"string"},"sourceQueries":{"items":{"type":"string"},"type":"array"},"summary":{"description":"LLM-generated summary. Undefined in fast mode (no content analysis).","type":"string"},"title":{"type":"string"},"url":{"type":"string"},"urlSource":{"$ref":"#/components/schemas/v1.UrlSource"}},"required":["id","url","sourceQueries","claims"],"type":"object"},"type":"array"},"executedQueries":{"items":{"items":{"type":"string"},"type":"array"},"type":"array"},"gapEvaluations":{"items":{"$ref":"#/components/schemas/v1.GapEvaluation"},"type":"array"},"judgments":{"items":{"$ref":"#/components/schemas/v1.JudgmentResult"},"type":"array"},"metrics":{"$ref":"#/components/schemas/v1.ResearchMetrics"},"mode":{"$ref":"#/components/schemas/v1.Mode"},"outline":{"$ref":"#/components/schemas/v1.ResearchOutline"},"prompt":{"type":"string"},"queryComplexity":{"enum":["simple","moderate","complex"],"type":"string"},"researchObjective":{"type":"string"},"researchPlan":{"type":"string"},"researchQuestions":{"items":{"type":"string"},"type":"array"},"totalPagesAnalyzed":{"description":"Total pages analyzed across all iterations","type":"number"},"urlSources":{"additionalProperties":false,"properties":{"extractedLinks":{"type":"number"},"searchResults":{"type":"number"},"userProvided":{"type":"number"}},"required":["userProvided","searchResults","extractedLinks"],"type":"object"}},"required":["prompt","researchQuestions","researchObjective","queryComplexity","researchPlan","totalPagesAnalyzed","executedQueries","mode"],"type":"object"},"v1.ResearchMetrics":{"additionalProperties":false,"description":"Complete research metrics","properties":{"cachedFetches":{"description":"Cached fetch count (subset of fetches)","type":"number"},"cachedSearches":{"additionalProperties":{"type":"number"},"description":"Cached search count by provider name (subset of searches)","type":"object"},"fetches":{"description":"Fetch count (number of pages fetched)","type":"number"},"iterations":{"description":"Number of research iterations performed","type":"number"},"phases":{"additionalProperties":{"additionalProperties":false,"properties":{"duration":{"type":"number"}},"required":["duration"],"type":"object"},"description":"Phase timings with duration in milliseconds","type":"object"},"robotsBlocked":{"description":"Number of URLs blocked by robots.txt","type":"number"},"searches":{"additionalProperties":{"type":"number"},"description":"Search count by provider name (e.g., \"bright-data\", \"parallel\")","type":"object"},"successRates":{"allOf":[{"$ref":"#/components/schemas/v1.SuccessRates"}],"description":"Success rates (0-1) for various operations"},"tokens":{"additionalProperties":{"$ref":"#/components/schemas/v1.TokenUsage"},"description":"Token usage by model ID (e.g., \"gemini-2.5-flash\")","type":"object"},"totalDuration":{"description":"Total duration in milliseconds","type":"number"}},"required":["tokens","searches","cachedSearches","fetches","cachedFetches","robotsBlocked","phases","successRates","totalDuration","iterations"],"type":"object"},"v1.ResearchOutline":{"additionalProperties":false,"description":"Report outline from research writer","properties":{"directAnswer":{"type":"string"},"keyTakeaways":{"items":{"type":"string"},"type":"array"},"outline":{"type":"string"},"relevantSourceIds":{"items":{"type":"string"},"type":"array"}},"required":["directAnswer","keyTakeaways","relevantSourceIds","outline"],"type":"object"},"v1.ResearchQuestionAssessment":{"additionalProperties":false,"description":"Assessment of a single research question","properties":{"findings":{"description":"What we learned (if answered/partial) or what's missing (if unanswered)","type":"string"},"question":{"description":"The research question being assessed","type":"string"},"status":{"description":"Status: answered (clear info), partial (some info, gaps remain), unanswered (no relevant info)","enum":["answered","partial","unanswered"],"type":"string"}},"required":["question","status","findings"],"type":"object"},"v1.SearchingEndEvent":{"additionalProperties":false,"properties":{"iteration":{"type":"number"},"message":{"type":"string"},"timestamp":{"type":"number"},"urlsFound":{"type":"number"},"urlsNew":{"type":"number"}},"required":["message","iteration","urlsFound","urlsNew","timestamp"],"type":"object"},"v1.SearchingStartEvent":{"additionalProperties":false,"properties":{"iteration":{"type":"number"},"message":{"type":"string"},"queries":{"items":{"type":"string"},"type":"array"},"timestamp":{"type":"number"}},"required":["message","iteration","queries","timestamp"],"type":"object"},"v1.StartEvent":{"additionalProperties":false,"description":"start - Research begins","properties":{"message":{"type":"string"},"timestamp":{"type":"number"}},"required":["message","timestamp"],"type":"object"},"v1.SuccessRates":{"additionalProperties":false,"description":"Success rate metrics","properties":{"analyzes":{"type":"number"},"fetches":{"type":"number"},"searches":{"type":"number"}},"required":["searches","fetches","analyzes"],"type":"object"},"v1.TokenUsage":{"additionalProperties":false,"description":"Token usage for a specific model","properties":{"input":{"type":"number"},"output":{"type":"number"}},"required":["input","output"],"type":"object"},"v1.UrlSource":{"description":"URL source tracking - where a URL came from","enum":["user-input","search-result","extracted-link"],"type":"string"},"v1.WritingEndEvent":{"additionalProperties":false,"properties":{"attempt":{"type":"number"},"message":{"type":"string"},"timestamp":{"type":"number"}},"required":["message","attempt","timestamp"],"type":"object"},"v1.WritingStartEvent":{"additionalProperties":false,"properties":{"attempt":{"type":"number"},"isRevision":{"description":"Whether this is a revision attempt (attempt > 1)","type":"boolean"},"maxAttempts":{"description":"Maximum attempts allowed (1 + maxRevisions)","type":"number"},"message":{"type":"string"},"previousScore":{"description":"Previous judgment score if this is a revision","type":"number"},"timestamp":{"type":"number"}},"required":["message","attempt","maxAttempts","isRevision","timestamp"],"type":"object"},"v1.AutomateEvent_AgentAction":{"type":"object","description":"Envelope for the \"agent:action\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"agent:action"},"data":{"$ref":"#/components/schemas/v1.ActionExecutionEventData"}}},"v1.AutomateEvent_AgentExtracted":{"type":"object","description":"Envelope for the \"agent:extracted\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"agent:extracted"},"data":{"$ref":"#/components/schemas/v1.ExtractedDataEventData"}}},"v1.AutomateEvent_AgentProcessing":{"type":"object","description":"Envelope for the \"agent:processing\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"agent:processing"},"data":{"$ref":"#/components/schemas/v1.ProcessingEventData"}}},"v1.AutomateEvent_AgentReasoned":{"type":"object","description":"Envelope for the \"agent:reasoned\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"agent:reasoned"},"data":{"$ref":"#/components/schemas/v1.ReasoningEventData"}}},"v1.AutomateEvent_AgentStatus":{"type":"object","description":"Envelope for the \"agent:status\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"agent:status"},"data":{"$ref":"#/components/schemas/v1.StatusMessageEventData"}}},"v1.AutomateEvent_AgentStep":{"type":"object","description":"Envelope for the \"agent:step\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"agent:step"},"data":{"$ref":"#/components/schemas/v1.AgentStepEventData"}}},"v1.AutomateEvent_AgentWaiting":{"type":"object","description":"Envelope for the \"agent:waiting\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"agent:waiting"},"data":{"$ref":"#/components/schemas/v1.WaitingEventData"}}},"v1.AutomateEvent_AiGeneration":{"type":"object","description":"Envelope for the \"ai:generation\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"ai:generation"},"data":{"$ref":"#/components/schemas/v1.AIGenerationEventData"}}},"v1.AutomateEvent_AiGenerationError":{"type":"object","description":"Envelope for the \"ai:generation:error\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"ai:generation:error"},"data":{"$ref":"#/components/schemas/v1.AIGenerationErrorEventData"}}},"v1.AutomateEvent_BrowserActionCompleted":{"type":"object","description":"Envelope for the \"browser:action_completed\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"browser:action_completed"},"data":{"$ref":"#/components/schemas/v1.ActionResultEventData"}}},"v1.AutomateEvent_BrowserActionStarted":{"type":"object","description":"Envelope for the \"browser:action_started\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"browser:action_started"},"data":{"$ref":"#/components/schemas/v1.ActionExecutionEventData"}}},"v1.AutomateEvent_BrowserNavigated":{"type":"object","description":"Envelope for the \"browser:navigated\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"browser:navigated"},"data":{"$ref":"#/components/schemas/v1.PageNavigationEventData"}}},"v1.AutomateEvent_BrowserReconnected":{"type":"object","description":"Envelope for the \"browser:reconnected\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"browser:reconnected"},"data":{"$ref":"#/components/schemas/v1.BrowserReconnectedEventData"}}},"v1.AutomateEvent_BrowserScreenshotCaptured":{"type":"object","description":"Envelope for the \"browser:screenshot_captured\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"browser:screenshot_captured"},"data":{"$ref":"#/components/schemas/v1.ScreenshotCapturedEventData"}}},"v1.AutomateEvent_BrowserScreenshotCapturedImage":{"type":"object","description":"Envelope for the \"browser:screenshot_captured_image\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"browser:screenshot_captured_image"},"data":{"$ref":"#/components/schemas/v1.ScreenshotCapturedImageEventData"}}},"v1.AutomateEvent_CdpEndpointConnected":{"type":"object","description":"Envelope for the \"cdp:endpoint_connected\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"cdp:endpoint_connected"},"data":{"$ref":"#/components/schemas/v1.CdpEndpointConnectedEventData"}}},"v1.AutomateEvent_CdpEndpointCycle":{"type":"object","description":"Envelope for the \"cdp:endpoint_cycle\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"cdp:endpoint_cycle"},"data":{"$ref":"#/components/schemas/v1.CdpEndpointCycleEventData"}}},"v1.AutomateEvent_Complete":{"type":"object","description":"Envelope for the \"complete\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"complete"},"data":{"$ref":"#/components/schemas/v1.StreamCompleteEventData"}}},"v1.AutomateEvent_Done":{"type":"object","description":"Envelope for the \"done\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"done"},"data":{"$ref":"#/components/schemas/v1.StreamDoneEventData"}}},"v1.AutomateEvent_Error":{"type":"object","description":"Envelope for the \"error\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"error"},"data":{"$ref":"#/components/schemas/v1.StreamErrorEventData"}}},"v1.AutomateEvent_InteractiveFormDataError":{"type":"object","description":"Envelope for the \"interactive:form_data:error\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"interactive:form_data:error"},"data":{"$ref":"#/components/schemas/v1.InteractiveFormDataErrorEventData"}}},"v1.AutomateEvent_InteractiveFormDataRequest":{"type":"object","description":"Envelope for the \"interactive:form_data:request\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"interactive:form_data:request"},"data":{"$ref":"#/components/schemas/v1.InteractiveFormDataRequestEventData"}}},"v1.AutomateEvent_SystemDebugCompression":{"type":"object","description":"Envelope for the \"system:debug_compression\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"system:debug_compression"},"data":{"$ref":"#/components/schemas/v1.CompressionDebugEventData"}}},"v1.AutomateEvent_SystemDebugMessage":{"type":"object","description":"Envelope for the \"system:debug_message\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"system:debug_message"},"data":{"$ref":"#/components/schemas/v1.MessagesDebugEventData"}}},"v1.AutomateEvent_TaskAborted":{"type":"object","description":"Envelope for the \"task:aborted\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"task:aborted"},"data":{"$ref":"#/components/schemas/v1.TaskAbortedEventData"}}},"v1.AutomateEvent_TaskCompleted":{"type":"object","description":"Envelope for the \"task:completed\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"task:completed"},"data":{"$ref":"#/components/schemas/v1.TaskCompleteEventData"}}},"v1.AutomateEvent_TaskMetrics":{"type":"object","description":"Envelope for the \"task:metrics\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"task:metrics"},"data":{"$ref":"#/components/schemas/v1.TaskMetricsEventData"}}},"v1.AutomateEvent_TaskMetricsIncremental":{"type":"object","description":"Envelope for the \"task:metrics_incremental\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"task:metrics_incremental"},"data":{"$ref":"#/components/schemas/v1.TaskMetricsEventData"}}},"v1.AutomateEvent_TaskSetup":{"type":"object","description":"Envelope for the \"task:setup\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"task:setup"},"data":{"$ref":"#/components/schemas/v1.TaskSetupEventData"}}},"v1.AutomateEvent_TaskStarted":{"type":"object","description":"Envelope for the \"task:started\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"task:started"},"data":{"$ref":"#/components/schemas/v1.TaskStartEventData"}}},"v1.AutomateEvent_TaskTraceContext":{"type":"object","description":"Envelope for the \"task:trace_context\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"task:trace_context"},"data":{"$ref":"#/components/schemas/v1.TraceContextEventData"}}},"v1.AutomateEvent_TaskValidated":{"type":"object","description":"Envelope for the \"task:validated\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"task:validated"},"data":{"$ref":"#/components/schemas/v1.TaskValidationEventData"}}},"v1.AutomateEvent_TaskValidationError":{"type":"object","description":"Envelope for the \"task:validation_error\" event from /v1/automate.","required":["event","data"],"properties":{"event":{"type":"string","const":"task:validation_error"},"data":{"$ref":"#/components/schemas/v1.ValidationErrorEventData"}}},"v1.AIGenerationErrorEventData":{"additionalProperties":false,"description":"Event data when AI generation error occurs","properties":{"error":{"type":"string"},"iterationId":{"type":"string"},"messages":{"items":{"x-stainless-any":true},"type":"array"},"prompt":{"type":"string"},"schema":{"x-stainless-any":true},"timestamp":{"type":"number"}},"required":["error","iterationId","prompt","schema","timestamp"],"type":"object"},"v1.AIGenerationEventData":{"additionalProperties":false,"description":"Event data when AI generation occurs","properties":{"finishReason":{"enum":["stop","length","content-filter","tool-calls","error","other"],"type":"string"},"iterationId":{"type":"string"},"messages":{"items":{"anyOf":[{"additionalProperties":false,"description":"A system message. It can contain system information.\n\nNote: 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.","properties":{"content":{"type":"string"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"role":{"const":"system","type":"string"}},"required":["role","content"],"type":"object","title":"System"},{"additionalProperties":false,"description":"A user message. It can contain text or a combination of text and images.","properties":{"content":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"additionalProperties":false,"description":"Text content part of a prompt. It contains a string of text.","properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"text":{"description":"The text content.","type":"string"},"type":{"const":"text","type":"string"}},"required":["type","text"],"type":"object","title":"Text"},{"additionalProperties":false,"description":"Image content part of a prompt. It contains an image.","properties":{"image":{"anyOf":[{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"number"},"properties":{"BYTES_PER_ELEMENT":{"type":"number"},"buffer":{"additionalProperties":false,"properties":{"byteLength":{"type":"number"}},"required":["byteLength"],"type":"object"},"byteLength":{"type":"number"},"byteOffset":{"type":"number"},"length":{"type":"number"}},"required":["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],"type":"object"},{"additionalProperties":false,"properties":{"byteLength":{"type":"number"}},"required":["byteLength"],"type":"object"},{"$ref":"#/components/schemas/v1.global.Buffer"}],"description":"Data content. Can either be a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer."},{"format":"uri","type":"string"}],"description":"Image data. Can either be:\n\n- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer\n- URL: a URL that points to the image"},"mediaType":{"description":"Optional IANA media type of the image.","type":"string"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"type":{"const":"image","type":"string"}},"required":["type","image"],"type":"object","title":"Image"},{"additionalProperties":false,"description":"File content part of a prompt. It contains a file.","properties":{"data":{"anyOf":[{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"number"},"properties":{"BYTES_PER_ELEMENT":{"type":"number"},"buffer":{"additionalProperties":false,"properties":{"byteLength":{"type":"number"}},"required":["byteLength"],"type":"object"},"byteLength":{"type":"number"},"byteOffset":{"type":"number"},"length":{"type":"number"}},"required":["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],"type":"object"},{"additionalProperties":false,"properties":{"byteLength":{"type":"number"}},"required":["byteLength"],"type":"object"},{"$ref":"#/components/schemas/v1.global.Buffer"}],"description":"Data content. Can either be a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer."},{"format":"uri","type":"string"}],"description":"File data. Can either be:\n\n- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer\n- URL: a URL that points to the image"},"filename":{"description":"Optional filename of the file.","type":"string"},"mediaType":{"description":"IANA media type of the file.","type":"string"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"type":{"const":"file","type":"string"}},"required":["type","data","mediaType"],"type":"object","title":"File"}]},"type":"array"}],"description":"Content of a user message. It can be a string or an array of text and image parts."},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"role":{"const":"user","type":"string"}},"required":["role","content"],"type":"object","title":"User"},{"additionalProperties":false,"description":"An assistant message. It can contain text, tool calls, or a combination of text and tool calls.","properties":{"content":{"anyOf":[{"type":"string"},{"items":{"anyOf":[{"additionalProperties":false,"description":"Text content part of a prompt. It contains a string of text.","properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"text":{"description":"The text content.","type":"string"},"type":{"const":"text","type":"string"}},"required":["type","text"],"type":"object","title":"Text"},{"additionalProperties":false,"description":"File content part of a prompt. It contains a file.","properties":{"data":{"anyOf":[{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"number"},"properties":{"BYTES_PER_ELEMENT":{"type":"number"},"buffer":{"additionalProperties":false,"properties":{"byteLength":{"type":"number"}},"required":["byteLength"],"type":"object"},"byteLength":{"type":"number"},"byteOffset":{"type":"number"},"length":{"type":"number"}},"required":["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],"type":"object"},{"additionalProperties":false,"properties":{"byteLength":{"type":"number"}},"required":["byteLength"],"type":"object"},{"$ref":"#/components/schemas/v1.global.Buffer"}],"description":"Data content. Can either be a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer."},{"format":"uri","type":"string"}],"description":"File data. Can either be:\n\n- data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer\n- URL: a URL that points to the image"},"filename":{"description":"Optional filename of the file.","type":"string"},"mediaType":{"description":"IANA media type of the file.","type":"string"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"type":{"const":"file","type":"string"}},"required":["type","data","mediaType"],"type":"object","title":"File"},{"additionalProperties":false,"description":"Reasoning content part of a prompt. It contains a reasoning.","properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"text":{"description":"The reasoning text.","type":"string"},"type":{"const":"reasoning","type":"string"}},"required":["type","text"],"type":"object","title":"Reasoning"},{"additionalProperties":false,"description":"Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).","properties":{"input":{"description":"Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.","x-stainless-any":true},"providerExecuted":{"description":"Whether the tool call was executed by the provider.","type":"boolean"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"toolCallId":{"description":"ID of the tool call. This ID is used to match the tool call with the tool result.","type":"string"},"toolName":{"description":"Name of the tool that is being called.","type":"string"},"type":{"const":"tool-call","type":"string"}},"required":["type","toolCallId","toolName","input"],"type":"object","title":"ToolCall"},{"additionalProperties":false,"description":"Tool result content part of a prompt. It contains the result of the tool call with the matching ID.","properties":{"output":{"anyOf":[{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"text","description":"Text tool output that should be directly sent to the API.","type":"string"},"value":{"type":"string"}},"required":["type","value"],"type":"object","title":"Text"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"json","type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}},"required":["type","value"],"type":"object","title":"Json"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"reason":{"description":"Optional reason for the execution denial.","type":"string"},"type":{"const":"execution-denied","description":"Type when the user has denied the execution of the tool call.","type":"string"}},"required":["type"],"type":"object","title":"ExecutionDenied"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"error-text","type":"string"},"value":{"type":"string"}},"required":["type","value"],"type":"object","title":"ErrorText"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"error-json","type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}},"required":["type","value"],"type":"object","title":"ErrorJson"},{"additionalProperties":false,"properties":{"type":{"const":"content","type":"string"},"value":{"items":{"anyOf":[{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"text":{"description":"Text content.","type":"string"},"type":{"const":"text","type":"string"}},"required":["type","text"],"type":"object","title":"Text"},{"additionalProperties":false,"properties":{"data":{"type":"string"},"mediaType":{"type":"string"},"type":{"const":"media","deprecated":true,"description":"Deprecated. Use image-data or file-data instead.","type":"string","x-stainless-deprecation-message":"Deprecated by the upstream schema."}},"required":["type","data","mediaType"],"type":"object","title":"Media"},{"additionalProperties":false,"properties":{"data":{"description":"Base-64 encoded media data.","type":"string"},"filename":{"description":"Optional filename of the file.","type":"string"},"mediaType":{"description":"IANA media type.","type":"string"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"file-data","type":"string"}},"required":["type","data","mediaType"],"type":"object","title":"FileData"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"file-url","type":"string"},"url":{"description":"URL of the file.","type":"string"}},"required":["type","url"],"type":"object","title":"FileUrl"},{"additionalProperties":false,"properties":{"fileId":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"description":"ID of the file.\n\nIf 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'."},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"file-id","type":"string"}},"required":["type","fileId"],"type":"object","title":"FileId"},{"additionalProperties":false,"properties":{"data":{"description":"Base-64 encoded image data.","type":"string"},"mediaType":{"description":"IANA media type.","type":"string"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"image-data","description":"Images that are referenced using base64 encoded data.","type":"string"}},"required":["type","data","mediaType"],"type":"object","title":"ImageData"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"image-url","description":"Images that are referenced using a URL.","type":"string"},"url":{"description":"URL of the image.","type":"string"}},"required":["type","url"],"type":"object","title":"ImageUrl"},{"additionalProperties":false,"properties":{"fileId":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"description":"Image that is referenced using a provider file id.\n\nIf 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'."},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"image-file-id","description":"Images that are referenced using a provider file id.","type":"string"}},"required":["type","fileId"],"type":"object","title":"ImageFileId"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"custom","description":"Custom content part. This can be used to implement provider-specific content parts.","type":"string"}},"required":["type"],"type":"object","title":"Custom"}]},"type":"array"}},"required":["type","value"],"type":"object","title":"Content"}],"description":"Result of the tool call. This is a JSON-serializable object."},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"toolCallId":{"description":"ID of the tool call that this result is associated with.","type":"string"},"toolName":{"description":"Name of the tool that generated this result.","type":"string"},"type":{"const":"tool-result","type":"string"}},"required":["type","toolCallId","toolName","output"],"type":"object","title":"ToolResult"},{"additionalProperties":false,"description":"Tool approval request prompt part.","properties":{"approvalId":{"description":"ID of the tool approval.","type":"string"},"toolCallId":{"description":"ID of the tool call that the approval request is for.","type":"string"},"type":{"const":"tool-approval-request","type":"string"}},"required":["type","approvalId","toolCallId"],"type":"object","title":"ToolApprovalRequest"}]},"type":"array"}],"description":"Content of an assistant message. It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts."},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"role":{"const":"assistant","type":"string"}},"required":["role","content"],"type":"object","title":"Assistant"},{"additionalProperties":false,"description":"A tool message. It contains the result of one or more tool calls.","properties":{"content":{"description":"Content of a tool message. It is an array of tool result parts.","items":{"anyOf":[{"additionalProperties":false,"description":"Tool result content part of a prompt. It contains the result of the tool call with the matching ID.","properties":{"output":{"anyOf":[{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"text","description":"Text tool output that should be directly sent to the API.","type":"string"},"value":{"type":"string"}},"required":["type","value"],"type":"object","title":"Text"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"json","type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}},"required":["type","value"],"type":"object","title":"Json"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"reason":{"description":"Optional reason for the execution denial.","type":"string"},"type":{"const":"execution-denied","description":"Type when the user has denied the execution of the tool call.","type":"string"}},"required":["type"],"type":"object","title":"ExecutionDenied"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"error-text","type":"string"},"value":{"type":"string"}},"required":["type","value"],"type":"object","title":"ErrorText"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"error-json","type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}},"required":["type","value"],"type":"object","title":"ErrorJson"},{"additionalProperties":false,"properties":{"type":{"const":"content","type":"string"},"value":{"items":{"anyOf":[{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"text":{"description":"Text content.","type":"string"},"type":{"const":"text","type":"string"}},"required":["type","text"],"type":"object","title":"Text"},{"additionalProperties":false,"properties":{"data":{"type":"string"},"mediaType":{"type":"string"},"type":{"const":"media","deprecated":true,"description":"Deprecated. Use image-data or file-data instead.","type":"string","x-stainless-deprecation-message":"Deprecated by the upstream schema."}},"required":["type","data","mediaType"],"type":"object","title":"Media"},{"additionalProperties":false,"properties":{"data":{"description":"Base-64 encoded media data.","type":"string"},"filename":{"description":"Optional filename of the file.","type":"string"},"mediaType":{"description":"IANA media type.","type":"string"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"file-data","type":"string"}},"required":["type","data","mediaType"],"type":"object","title":"FileData"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"file-url","type":"string"},"url":{"description":"URL of the file.","type":"string"}},"required":["type","url"],"type":"object","title":"FileUrl"},{"additionalProperties":false,"properties":{"fileId":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"description":"ID of the file.\n\nIf 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'."},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"file-id","type":"string"}},"required":["type","fileId"],"type":"object","title":"FileId"},{"additionalProperties":false,"properties":{"data":{"description":"Base-64 encoded image data.","type":"string"},"mediaType":{"description":"IANA media type.","type":"string"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"image-data","description":"Images that are referenced using base64 encoded data.","type":"string"}},"required":["type","data","mediaType"],"type":"object","title":"ImageData"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"image-url","description":"Images that are referenced using a URL.","type":"string"},"url":{"description":"URL of the image.","type":"string"}},"required":["type","url"],"type":"object","title":"ImageUrl"},{"additionalProperties":false,"properties":{"fileId":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"description":"Image that is referenced using a provider file id.\n\nIf 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'."},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"image-file-id","description":"Images that are referenced using a provider file id.","type":"string"}},"required":["type","fileId"],"type":"object","title":"ImageFileId"},{"additionalProperties":false,"properties":{"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Provider-specific options.","type":"object"},"type":{"const":"custom","description":"Custom content part. This can be used to implement provider-specific content parts.","type":"string"}},"required":["type"],"type":"object","title":"Custom"}]},"type":"array"}},"required":["type","value"],"type":"object","title":"Content"}],"description":"Result of the tool call. This is a JSON-serializable object."},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"toolCallId":{"description":"ID of the tool call that this result is associated with.","type":"string"},"toolName":{"description":"Name of the tool that generated this result.","type":"string"},"type":{"const":"tool-result","type":"string"}},"required":["type","toolCallId","toolName","output"],"type":"object","title":"ToolResult"},{"additionalProperties":false,"description":"Tool approval response prompt part.","properties":{"approvalId":{"description":"ID of the tool approval.","type":"string"},"approved":{"description":"Flag indicating whether the approval was granted or denied.","type":"boolean"},"providerExecuted":{"description":"Flag indicating whether the tool call is provider-executed. Only provider-executed tool approval responses should be sent to the model.","type":"boolean"},"reason":{"description":"Optional reason for the approval or denial.","type":"string"},"type":{"const":"tool-approval-response","type":"string"}},"required":["type","approvalId","approved"],"type":"object","title":"ToolApprovalResponse"}]},"type":"array"},"providerOptions":{"additionalProperties":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"description":"Additional provider-specific metadata. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.","type":"object"},"role":{"const":"tool","type":"string"}},"required":["role","content"],"type":"object","title":"Tool"}],"description":"A message that can be used in the `messages` field of a prompt. It can be a user message, an assistant message, or a tool message."},"type":"array"},"object":{"x-stainless-any":true},"prompt":{"type":"string"},"providerMetadata":{"additionalProperties":{"x-stainless-any":true},"type":"object"},"schema":{"x-stainless-any":true},"temperature":{"type":"number"},"timestamp":{"type":"number"},"usage":{"additionalProperties":false,"properties":{"inputTokens":{"type":"number"},"outputTokens":{"type":"number"},"totalTokens":{"type":"number"}},"type":"object"},"warnings":{"items":{"x-stainless-any":true},"type":"array"}},"required":["finishReason","iterationId","prompt","schema","timestamp","usage"],"type":"object"},"v1.ActionExecutionEventData":{"additionalProperties":false,"description":"Event data for action execution","properties":{"action":{"type":"string"},"iterationId":{"type":"string"},"ref":{"type":"string","nullable":true},"timestamp":{"type":"number"},"value":{"type":"string","nullable":true}},"required":["action","iterationId","timestamp"],"type":"object"},"v1.ActionResultEventData":{"additionalProperties":false,"description":"Event data for action results","properties":{"error":{"type":"string"},"iterationId":{"type":"string"},"success":{"type":"boolean"},"timestamp":{"type":"number"}},"required":["iterationId","success","timestamp"],"type":"object"},"v1.AgentStepEventData":{"additionalProperties":false,"description":"Event data for agent step tracking (each loop iteration)","properties":{"currentIteration":{"type":"number"},"iterationId":{"type":"string"},"timestamp":{"type":"number"}},"required":["currentIteration","iterationId","timestamp"],"type":"object"},"v1.BrowserReconnectedEventData":{"additionalProperties":false,"description":"Event data when the browser reconnects after a mid-task disconnect","properties":{"endpointIndex":{"description":"1-based index of the CDP endpoint now in use","type":"number"},"iterationId":{"type":"string"},"startingUrl":{"description":"The original starting URL the agent is restarting execution from","type":"string"},"timestamp":{"type":"number"},"total":{"description":"Total number of configured CDP endpoints","type":"number"}},"required":["endpointIndex","iterationId","startingUrl","timestamp","total"],"type":"object"},"v1.CdpEndpointConnectedEventData":{"additionalProperties":false,"description":"Event data when a CDP endpoint is successfully connected to","properties":{"endpointIndex":{"description":"1-based index of the endpoint that connected","type":"number"},"iterationId":{"type":"string"},"timestamp":{"type":"number"},"total":{"description":"Total number of configured CDP endpoints","type":"number"}},"required":["endpointIndex","iterationId","timestamp","total"],"type":"object"},"v1.CdpEndpointCycleEventData":{"additionalProperties":false,"description":"Event data when a CDP endpoint fails and the next one is being tried","properties":{"attempt":{"description":"1-based index of the endpoint attempt that failed","type":"number"},"error":{"description":"Sanitized error identifier from the failed connection attempt (error.name, not error.message — full messages may contain endpoint URLs)","type":"string"},"iterationId":{"type":"string"},"timestamp":{"type":"number"},"total":{"description":"Total number of configured CDP endpoints","type":"number"}},"required":["attempt","error","iterationId","timestamp","total"],"type":"object"},"v1.CompressionDebugEventData":{"additionalProperties":false,"description":"Event data for compression debug info","properties":{"compressedSize":{"type":"number"},"compressionPercent":{"type":"number"},"iterationId":{"type":"string"},"originalSize":{"type":"number"},"timestamp":{"type":"number"}},"required":["compressedSize","compressionPercent","iterationId","originalSize","timestamp"],"type":"object"},"v1.ExtractedDataEventData":{"additionalProperties":false,"description":"Event data for extracted data","properties":{"extractedData":{"type":"string"},"iterationId":{"type":"string"},"timestamp":{"type":"number"}},"required":["extractedData","iterationId","timestamp"],"type":"object"},"v1.FormFieldRequest":{"additionalProperties":false,"description":"A single form field the agent needs data for.","properties":{"currentValue":{"description":"Current value if already partially filled","type":"string"},"description":{"description":"Additional context (e.g., validation error message on re-request)","type":"string"},"fieldType":{"description":"Semantic field type","enum":["text","email","phone","date","number","select","checkbox","radio","textarea","password","other"],"type":"string"},"label":{"description":"The field's visible label","type":"string"},"options":{"description":"Available options for select/radio fields","items":{"type":"string"},"type":"array"},"ref":{"description":"Element ref from the accessibility tree (e.g., \"E42\")","type":"string"},"required":{"description":"Whether this field must be filled","type":"boolean"}},"required":["ref","label","fieldType","required"],"type":"object"},"v1.InteractiveFormDataErrorEventData":{"additionalProperties":false,"description":"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.","properties":{"fieldErrors":{"additionalProperties":{"type":"string"},"description":"Per-field error messages from validation (field ref -> error text)","type":"object"},"fields":{"items":{"$ref":"#/components/schemas/v1.FormFieldRequest"},"type":"array"},"formDescription":{"type":"string"},"iterationId":{"type":"string"},"pageTitle":{"type":"string"},"pageUrl":{"type":"string"},"requestId":{"type":"string"},"timestamp":{"type":"number"}},"required":["fieldErrors","fields","formDescription","iterationId","pageTitle","pageUrl","requestId","timestamp"],"type":"object"},"v1.InteractiveFormDataRequestEventData":{"additionalProperties":false,"description":"Event data when the agent requests user data for form fields","properties":{"fields":{"items":{"$ref":"#/components/schemas/v1.FormFieldRequest"},"type":"array"},"formDescription":{"type":"string"},"iterationId":{"type":"string"},"pageTitle":{"type":"string"},"pageUrl":{"type":"string"},"requestId":{"type":"string"},"timestamp":{"type":"number"}},"required":["fields","formDescription","iterationId","pageTitle","pageUrl","requestId","timestamp"],"type":"object"},"v1.MessagesDebugEventData":{"additionalProperties":false,"description":"Event data for message debug info","properties":{"iterationId":{"type":"string"},"messages":{"items":{"x-stainless-any":true},"type":"array"},"timestamp":{"type":"number"}},"required":["iterationId","messages","timestamp"],"type":"object"},"v1.PageNavigationEventData":{"additionalProperties":false,"description":"Event data when navigating to a page","properties":{"iterationId":{"type":"string"},"timestamp":{"type":"number"},"title":{"type":"string"},"url":{"type":"string"}},"required":["iterationId","timestamp","title","url"],"type":"object"},"v1.ProcessingEventData":{"additionalProperties":false,"description":"Event data for when the agent is waiting for model generation","properties":{"hasScreenshot":{"type":"boolean"},"iterationId":{"type":"string"},"operation":{"type":"string"},"timestamp":{"type":"number"}},"required":["hasScreenshot","iterationId","operation","timestamp"],"type":"object"},"v1.ReasoningEventData":{"additionalProperties":false,"description":"Event data for agent reasoning","properties":{"iterationId":{"type":"string"},"reasoning":{"type":"string"},"timestamp":{"type":"number"}},"required":["iterationId","reasoning","timestamp"],"type":"object"},"v1.ScreenshotCapturedEventData":{"additionalProperties":false,"description":"Event data for screenshot capture","properties":{"format":{"enum":["jpeg","png"],"type":"string"},"iterationId":{"type":"string"},"size":{"type":"number"},"timestamp":{"type":"number"}},"required":["format","iterationId","size","timestamp"],"type":"object"},"v1.ScreenshotCapturedImageEventData":{"additionalProperties":false,"description":"Event data for screenshot image capture with full image data This event contains the complete screenshot and can be very large","properties":{"image":{"type":"string"},"iterationId":{"type":"string"},"mediaType":{"enum":["image/jpeg","image/png"],"type":"string"},"timestamp":{"type":"number"}},"required":["image","iterationId","mediaType","timestamp"],"type":"object"},"v1.StatusMessageEventData":{"additionalProperties":false,"description":"Event data for status messages","properties":{"iterationId":{"type":"string"},"message":{"type":"string"},"timestamp":{"type":"number"}},"required":["iterationId","message","timestamp"],"type":"object"},"v1.StreamCompleteEventData":{"allOf":[{"$ref":"#/components/schemas/v1.TaskExecutionResult"}],"description":"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."},"v1.StreamDoneEventData":{"additionalProperties":{"not":{"x-stainless-any":true}},"description":"Payload for the `done` stream terminator event. Empty today; reserved for future metadata.","type":"object"},"v1.StreamErrorEventData":{"additionalProperties":false,"description":"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.","properties":{"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"message":{"type":"string"},"timestamp":{"description":"ISO-8601 timestamp","type":"string"}},"required":["message","code","timestamp"],"type":"object"},"success":{"const":false,"type":"boolean"}},"required":["success","error"],"type":"object"},"v1.TaskAbortedEventData":{"additionalProperties":false,"description":"Event data when a task is aborted","properties":{"finalAnswer":{"type":"string"},"iterationId":{"type":"string"},"reason":{"type":"string"},"timestamp":{"type":"number"}},"required":["finalAnswer","iterationId","reason","timestamp"],"type":"object"},"v1.TaskCompleteEventData":{"additionalProperties":false,"description":"Event data when a task is completed","properties":{"finalAnswer":{"type":"string","nullable":true},"iterationId":{"type":"string"},"success":{"type":"boolean"},"timestamp":{"type":"number"}},"required":["finalAnswer","iterationId","timestamp"],"type":"object"},"v1.TaskError":{"additionalProperties":false,"description":"Structured error information for failed tasks","properties":{"code":{"allOf":[{"$ref":"#/components/schemas/v1.TaskErrorCode"}],"description":"Error code for programmatic handling"},"message":{"description":"Human-readable error message","type":"string"}},"required":["code","message"],"type":"object"},"v1.TaskErrorCode":{"description":"Error codes for task failures","enum":["TASK_ABORTED","MAX_ITERATIONS","MAX_ERRORS","TASK_FAILED"],"type":"string"},"v1.TaskExecutionResult":{"additionalProperties":false,"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/v1.TaskError"}],"description":"Error details when success is false"},"finalAnswer":{"description":"Final answer or result from the agent","type":"string","nullable":true},"stats":{"additionalProperties":false,"description":"Execution statistics","properties":{"actions":{"type":"number"},"durationMs":{"type":"number"},"endTime":{"type":"number"},"iterations":{"type":"number"},"startTime":{"type":"number"}},"required":["iterations","actions","startTime","endTime","durationMs"],"type":"object"},"success":{"description":"Whether the task completed successfully","type":"boolean"}},"required":["success","finalAnswer","stats"],"type":"object"},"v1.TaskMetricsEventData":{"additionalProperties":false,"properties":{"aiGenerationCount":{"type":"number"},"aiGenerationErrorCount":{"type":"number"},"eventCounts":{"additionalProperties":{"type":"number"},"type":"object"},"iterationId":{"type":"string"},"stepCount":{"type":"number"},"timestamp":{"type":"number"},"totalInputTokens":{"type":"number"},"totalOutputTokens":{"type":"number"}},"required":["aiGenerationCount","aiGenerationErrorCount","eventCounts","iterationId","stepCount","timestamp","totalInputTokens","totalOutputTokens"],"type":"object"},"v1.TaskSetupEventData":{"additionalProperties":false,"description":"Event data when a task is setup","properties":{"browserName":{"type":"string"},"data":{"x-stainless-any":true},"guardrails":{"type":"string"},"hasApiKey":{"type":"boolean"},"iterationId":{"type":"string"},"keySource":{"enum":["global","env","not_set"],"type":"string"},"model":{"type":"string"},"provider":{"type":"string"},"proxy":{"type":"string"},"pwCdpEndpoint":{"type":"string"},"pwCdpEndpointCount":{"description":"Total number of CDP endpoints configured (index, not URLs)","type":"number"},"pwCdpEndpoints":{"items":{"type":"string"},"type":"array"},"pwEndpoint":{"type":"string"},"task":{"type":"string"},"timestamp":{"type":"number"},"url":{"type":"string"},"vision":{"type":"boolean"}},"required":["browserName","iterationId","task","timestamp"],"type":"object"},"v1.TaskStartEventData":{"additionalProperties":false,"description":"Event data when a task is started","properties":{"actionItems":{"items":{"type":"string"},"type":"array"},"iterationId":{"type":"string"},"plan":{"type":"string"},"successCriteria":{"type":"string"},"task":{"type":"string"},"timestamp":{"type":"number"},"url":{"type":"string"}},"required":["iterationId","plan","successCriteria","task","timestamp","url"],"type":"object"},"v1.TaskValidationEventData":{"additionalProperties":false,"description":"Event data for task validation","properties":{"completionQuality":{"enum":["failed","partial","complete","excellent"],"type":"string"},"feedback":{"type":"string"},"finalAnswer":{"type":"string"},"iterationId":{"type":"string"},"observation":{"type":"string"},"timestamp":{"type":"number"}},"required":["completionQuality","finalAnswer","iterationId","observation","timestamp"],"type":"object"},"v1.ValidationErrorEventData":{"additionalProperties":false,"description":"Event data for validation errors during action response processing","properties":{"errors":{"items":{"type":"string"},"type":"array"},"iterationId":{"type":"string"},"rawResponse":{"x-stainless-any":true},"retryCount":{"type":"number"},"timestamp":{"type":"number"}},"required":["errors","iterationId","rawResponse","retryCount","timestamp"],"type":"object"},"v1.WaitingEventData":{"additionalProperties":false,"description":"Event data for waiting notifications","properties":{"iterationId":{"type":"string"},"seconds":{"type":"number"},"timestamp":{"type":"number"}},"required":["iterationId","seconds","timestamp"],"type":"object"},"v1.alias-922155206-156-411-922155206-0-129727133205725":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true},"v1.alias-922155206-411-476-922155206-0-129727":{"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"$ref":"#/components/schemas/v1.alias-922155206-411-476-922155206-0-129727"},{"items":{"$ref":"#/components/schemas/v1.alias-922155206-156-411-922155206-0-129727133205725"},"type":"array"}],"description":"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.","nullable":true}]},"type":"object"},"v1.global.Buffer":{"additionalProperties":{"type":"number"},"properties":{"BYTES_PER_ELEMENT":{"type":"number"},"buffer":{"additionalProperties":false,"properties":{"byteLength":{"type":"number"}},"required":["byteLength"],"type":"object"},"byteLength":{"type":"number"},"byteOffset":{"type":"number"},"length":{"type":"number"}},"required":["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],"type":"object"},"v1.TraceContextEventData":{"type":"object","description":"Payload for the task:trace_context event. Carries the OpenTelemetry trace ID for this /v1/automate request so consumers can deep-link to distributed-tracing UIs (e.g. Cloud Trace, Cloud Logging) for the run.","required":["traceId"],"properties":{"traceId":{"type":"string","description":"W3C trace ID — 32-character lowercase hexadecimal string.","example":"0123456789abcdef0123456789abcdef"}}}},"securitySchemes":{"BearerAuth":{"description":"Bearer token for API authentication","scheme":"bearer","type":"http"}}}}