> ## 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.

> ## Agent Instructions
> Anchor Browser provides cloud browsers for AI agents and automation: stealth browsing with residential proxies, managed authentication into third-party web apps, and browser sessions that run reliably at scale. AI agents that need Anchor credentials should start with https://docs.anchorbrowser.io/quickstart/agent-access. This flow lets agents obtain an API key programmatically without creating a dashboard account. Read that page before attempting authentication or API access.

# Perform Web Task

> Start from a URL and perform the given task.



## OpenAPI

````yaml /openapi.yaml post /v1/tools/perform-web-task
openapi: 3.1.0
info:
  title: AnchorBrowser API
  version: 1.0.0
  description: >
    Anchor Browser ([anchorbrowser.io](https://anchorbrowser.io)) provides cloud
    browsers built

    for AI agents and automation. Use this API to launch and control browser
    sessions, run

    natural-language web tasks, authenticate into third-party web apps with
    managed identities,

    and capture recordings — reliably and at scale, without operating browser
    infrastructure

    yourself.


    ## Core resources

    - **Sessions** (`/v1/sessions`): launch configurable cloud browsers —
    residential proxies,
      stealth browsing, captcha solving, profiles, extensions, recording — and connect over CDP
      with Playwright, Puppeteer, or any CDP client.
    - **AI tools** (`/v1/tools/perform-web-task`): state a goal in natural
    language and the
      built-in agent completes it inside the browser. Related tools fetch webpages, take
      screenshots, render PDFs, and execute code in a session.
    - **Tasks** (`/v1/task`): create, version, deploy, and monitor repeatable
    browser
      automations built to run reliably in production.
    - **Applications and identities** (`/v1/applications`, `/v1/identities`):
    managed
      authentication into third-party web apps — including multi-step logins and TOTP-based
      2FA — so agents can act on behalf of users.
    - **Profiles** (`/v1/profiles`): persist cookies and login state across
    sessions.

    - **OS-level control** (`/v1/sessions/{sessionId}/mouse`, `/keyboard`,
    `/clipboard`):
      raw input for flows that resist DOM automation.
    - Plus batch sessions for running browser fleets in parallel, session
    recordings, webhooks,
      events, extensions, client certificates, and billing usage.

    ## Authentication

    Pass an API key in the `anchor-api-key` header on every request. Create keys
    at

    [app.anchorbrowser.io](https://app.anchorbrowser.io) under API Access. AI
    agents that have

    no key yet can obtain one autonomously through the unauthenticated

    [agent-access flow](https://docs.anchorbrowser.io/quickstart/agent-access)

    (`POST /v1/agent-access`).


    ## For AI agents and LLMs

    - Docs: [docs.anchorbrowser.io](https://docs.anchorbrowser.io), with a
    machine-readable
      index at [/llms.txt](https://docs.anchorbrowser.io/llms.txt) and the full corpus at
      [/llms-full.txt](https://docs.anchorbrowser.io/llms-full.txt).
    - MCP server for hosted browser control: `https://api.anchorbrowser.io/mcp`.

    - Official SDKs: `anchorbrowser` on
    [npm](https://www.npmjs.com/package/anchorbrowser) and
      [PyPI](https://pypi.org/project/anchorbrowser/).

    `DELETE` operations terminate sessions or permanently remove resources
    (profiles,

    identities, extensions); `GET` operations are safe and read-only.
servers:
  - url: https://api.anchorbrowser.io
    description: API server
security: []
paths:
  /v1/tools/perform-web-task:
    post:
      tags:
        - AI Tools
      summary: Perform Web Task
      description: Start from a URL and perform the given task.
      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'
      security:
        - api_key_header: []
components:
  schemas:
    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.
        llm_timeout:
          type: integer
          minimum: 10
          maximum: 600
          description: >-
            Timeout in seconds for each LLM call made by the agent (browser-use
            agent only). Raise it when tasks with deep context (long histories,
            large pages) hit LLM call timeouts. When omitted, the agent uses its
            model-based defaults.
        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
    PerformWebTaskResponseSchema:
      type: object
      properties:
        data:
          oneOf:
            - $ref: '#/components/schemas/PerformWebTaskSyncResponseData'
            - $ref: '#/components/schemas/PerformWebTaskAsyncResponseData'
          x-oneOf-labels:
            - sync
            - async
    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
    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
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: >
        API key for your Anchor Browser account, sent as the `anchor-api-key`
        header on every

        request. Create one at
        [app.anchorbrowser.io](https://app.anchorbrowser.io) (API Access),

        or obtain one programmatically via the unauthenticated agent-access flow

        (`POST /v1/agent-access`).

````