> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anchorbrowser.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Agent Task

> Runs a perform-web-task on the running session's in-session agent. Requires the session
to be running. See [AI task completion](/agentic-browser-control/ai-task-completion).




## OpenAPI

````yaml /openapi.yaml post /v1/sessions/{session_id}/agent/run
openapi: 3.1.0
info:
  title: AnchorBrowser API
  version: 1.0.0
  description: APIs to manage all browser-related actions and configuration.
servers:
  - url: https://api.anchorbrowser.io
    description: API server
security: []
paths:
  /v1/sessions/{session_id}/agent/run:
    post:
      tags:
        - Agentic capabilities
      summary: Run Agent Task
      description: >
        Runs a perform-web-task on the running session's in-session agent.
        Requires the session

        to be running. See [AI task
        completion](/agentic-browser-control/ai-task-completion).
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
              properties:
                prompt:
                  type: string
                  description: The task for the agent to perform.
                agent:
                  type: string
                  enum:
                    - openai-cua
                    - browser-use
                    - gemini-computer-use
                    - anthropic-cua
                    - yutori
                  default: browser-use
                output_schema:
                  type: object
                  additionalProperties: true
                highlight_elements:
                  type: boolean
                detect_elements:
                  type: boolean
                human_intervention:
                  type: boolean
                max_steps:
                  type: integer
                  default: 200
                provider:
                  type: string
                model:
                  type: string
                secret_values:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: Agent task completed.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                description: >-
                  Perform-web-task result (includes `result`, `status`, and
                  `data`).
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key_header: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: API key passed in the header

````