Anchor Browser AI Tools API

The AI Tools API from Anchor Browser — 2 operation(s) for ai tools.

OpenAPI Specification

anchorbrowser-ai-tools-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: AnchorBrowser Agentic capabilities AI Tools API
  version: 1.0.0
  description: APIs to manage all browser-related actions and configuration.
servers:
- url: https://api.anchorbrowser.io
  description: API server
tags:
- name: AI Tools
paths:
  /v1/tools/perform-web-task:
    post:
      summary: Perform Web Task
      description: Start from a URL and perform the given task.
      tags:
      - AI Tools
      security:
      - api_key_header: []
      parameters:
      - in: query
        name: sessionId
        schema:
          type: string
          title: Browser Session
        description: An optional browser session identifier to reference an existing running browser sessions. When passed, the tool will be executed on the provided browser session.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PerformWebTaskRequestSchema'
      responses:
        '200':
          description: The result of the autonomous task.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerformWebTaskResponseSchema'
              examples:
                sync:
                  summary: Synchronous response
                  value:
                    data:
                      result:
                        result:
                          nodes_cpu_usage:
                          - node: pool-e1ro5g0nq-559g5
                            cluster: do-nyc1-demo-infra
                            cpu_avg_percentage: 8.29
                          - node: pool-e1ro5g0nq-559gk
                            cluster: do-nyc1-demo-infra
                            cpu_avg_percentage: 24.8
                async:
                  summary: Asynchronous response
                  value:
                    data:
                      status: running
                      workflow_id: perform-web-task-execution-123e4567-e89b-12d3-a456-426614174000-550e8400-e29b-41d4-a716-446655440000
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /v1/tools/perform-web-task/{workflowId}/status:
    get:
      summary: Get Perform Web Task Status
      description: Get the status of an asynchronous perform-web-task execution by workflow ID.
      tags:
      - AI Tools
      security:
      - api_key_header: []
      parameters:
      - in: path
        name: workflowId
        required: true
        schema:
          type: string
        description: The workflow ID returned when starting an asynchronous perform-web-task execution.
      responses:
        '200':
          description: The current status of the task execution.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerformWebTaskStatusResponseSchema'
              examples:
                completed:
                  summary: Completed workflow
                  value:
                    data:
                      status: COMPLETED
                      result:
                        nodes_cpu_usage:
                        - node: pool-e1ro5g0nq-559g5
                          cluster: do-nyc1-demo-infra
                          cpu_avg_percentage: 8.29
                        - node: pool-e1ro5g0nq-559gk
                          cluster: do-nyc1-demo-infra
                          cpu_avg_percentage: 24.8
                running:
                  summary: Running workflow
                  value:
                    data:
                      status: RUNNING
                failed:
                  summary: Failed workflow
                  value:
                    data:
                      status: FAILED
                      error: Maximum number of steps exceeded
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PerformWebTaskAsyncResponseData:
      type: object
      title: async
      properties:
        status:
          type: string
          enum:
          - running
          description: The status of the asynchronous task execution.
        workflow_id:
          type: string
          description: The workflow ID for tracking the asynchronous task execution.
      required:
      - status
      - workflow_id
    PerformWebTaskResponseSchema:
      type: object
      properties:
        data:
          oneOf:
          - $ref: '#/components/schemas/PerformWebTaskSyncResponseData'
          - $ref: '#/components/schemas/PerformWebTaskAsyncResponseData'
          x-oneOf-labels:
          - sync
          - async
    PerformWebTaskStatusResponseSchema:
      type: object
      properties:
        data:
          type: object
          oneOf:
          - $ref: '#/components/schemas/PerformWebTaskStatusSuccessResponseData'
          - $ref: '#/components/schemas/PerformWebTaskStatusRunningResponseData'
          - $ref: '#/components/schemas/PerformWebTaskStatusFailedResponseData'
      required:
      - data
    PerformWebTaskStatusRunningResponseData:
      type: object
      title: running
      properties:
        status:
          type: string
          enum:
          - RUNNING
          description: The workflow is currently running.
      required:
      - status
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
    PerformWebTaskSyncResponseData:
      type: object
      title: sync
      properties:
        result:
          type: object
          description: The outcome or answer produced by the autonomous task.
      required:
      - result
    PerformWebTaskRequestSchema:
      type: object
      required:
      - prompt
      properties:
        url:
          type: string
          description: The URL of the webpage. If not provided, the tool will use the current page in the session.
        prompt:
          type: string
          description: The task to be autonomously completed.
        agent:
          type: string
          description: The AI agent to use for task completion. Defaults to browser-use.
          enum:
          - browser-use
          - openai-cua
          - gemini-computer-use
          - anthropic-cua
          - yutori
        provider:
          type: string
          description: The AI provider to use for task completion.
          enum:
          - openai
          - gemini
          - groq
          - azure
          - xai
        model:
          type: string
          description: The specific model to use for task completion. see our [models](/agentic-browser-control/ai-task-completion#available-models) page for more information.
        detect_elements:
          type: boolean
          description: Enable element detection for better interaction accuracy. Improves the agent's ability to identify and interact with UI elements.
        human_intervention:
          type: boolean
          description: Allow human intervention during task execution. When enabled, the agent can request human input for ambiguous situations.
        max_steps:
          type: integer
          description: Maximum number of steps the agent can take to complete the task. Defaults to 200.
        secret_values:
          type: object
          additionalProperties:
            type: string
          description: Secret values to pass to the agent for secure credential handling. Keys and values are passed as environment variables to the agent.
        highlight_elements:
          type: boolean
          description: Whether to highlight elements during task execution for better visibility.
        output_schema:
          type: object
          description: JSON Schema defining the expected structure of the output data.
        async:
          type: boolean
          description: Whether to run the task asynchronously. If true, the task will be run asynchronously and the response will include a workflow ID.
          default: false
    PerformWebTaskStatusSuccessResponseData:
      type: object
      title: success
      properties:
        status:
          type: string
          enum:
          - COMPLETED
          description: The workflow has completed successfully.
        result:
          type: object
          description: The outcome or answer produced by the autonomous task.
      required:
      - status
      - result
    PerformWebTaskStatusFailedResponseData:
      type: object
      title: failed
      properties:
        status:
          type: string
          enum:
          - FAILED
          description: The workflow has failed.
        error:
          type: string
          description: Error message describing why the workflow failed.
      required:
      - status
      - error
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: API key passed in the header