> ## 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 is cloud browser infrastructure for AI agents and automation: browser sessions you control over CDP or REST, natural-language web tasks, versioned automation tasks, managed authentication into third-party web apps (identities with MFA), persistent volumes and profiles, recordings, live view, batch sessions, webhooks, and network options including residential proxies, extra stealth, and captcha solving for sites that block standard browsers. AI agents should start at https://docs.anchorbrowser.io/for-agents, then create an API key at https://app.anchorbrowser.io/api-keys. Read the for-agents page before authentication or API calls.

# Create Batch Sessions

> Creates multiple browser sessions in a single batch operation. This endpoint allows you to
create up to 5,000 browser sessions simultaneously with the same configuration.

The batch will be processed asynchronously, and you can monitor progress using the batch status endpoint.




## OpenAPI

````yaml /openapi.yaml post /v1/batch-sessions
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.


    ## 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/batch-sessions:
    post:
      tags:
        - Batch Sessions
      summary: Create Batch Sessions
      description: >
        Creates multiple browser sessions in a single batch operation. This
        endpoint allows you to

        create up to 5,000 browser sessions simultaneously with the same
        configuration.


        The batch will be processed asynchronously, and you can monitor progress
        using the batch status endpoint.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchSessionRequestSchema'
            examples:
              small_batch:
                summary: Small batch example
                value:
                  count: 10
                  configuration:
                    browser:
                      headless:
                        active: true
                      viewport:
                        width: 1440
                        height: 900
                    session:
                      timeout:
                        idle_timeout: 10
                        max_duration: 300
                  metadata:
                    project: web-scraping
                    environment: production
              large_batch:
                summary: Large batch example (from test snippet)
                value:
                  count: 2500
                  configuration:
                    browser:
                      headless:
                        active: true
                      viewport:
                        width: 1440
                        height: 900
                      recording:
                        active: true
                    session:
                      timeout:
                        idle_timeout: 10
                        max_duration: 300
                      tags:
                        - batch-test-comprehensive
                  metadata:
                    test: true
                    description: Comprehensive batch test with 3 sessions
      responses:
        '200':
          description: Batch created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BatchSessionResponseSchema'
        '400':
          description: Invalid request parameters or configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_count:
                  summary: Invalid session count
                  value:
                    error:
                      code: 400
                      message: Session count must be between 1 and 1000
                invalid_config:
                  summary: Invalid configuration
                  value:
                    error:
                      code: 400
                      message: CAPTCHA solver requires proxy to be active
        '402':
          description: Payment Required - Insufficient credits for batch creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests - Rate limit exceeded
          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:
    BatchSessionRequestSchema:
      type: object
      required:
        - count
      properties:
        count:
          type: integer
          minimum: 1
          maximum: 1000
          description: Number of sessions to create in the batch (1-1000)
        configuration:
          $ref: '#/components/schemas/SessionCreateRequestSchema'
          description: Configuration that applies to all sessions in the batch
        metadata:
          type: object
          additionalProperties: true
          description: Optional batch-level metadata for identification and organization
    BatchSessionResponseSchema:
      type: object
      properties:
        batch_id:
          type: string
          format: uuid
          description: Unique identifier for the batch
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
            - cancelled
          description: Current status of the batch
        total_requests:
          type: integer
          description: Total number of sessions requested in the batch
        created_at:
          type: string
          format: date-time
          description: Timestamp when the batch was created
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
    SessionCreateRequestSchema:
      type: object
      properties:
        session:
          $ref: '#/components/schemas/SessionConfig'
        browser:
          $ref: '#/components/schemas/BrowserConfig'
        integrations:
          type: array
          description: >-
            Array of integrations to load in the browser session. Integrations
            must be previously created using the Integrations API.
          items:
            $ref: '#/components/schemas/Integration'
          example:
            - id: 550e8400-e29b-41d4-a716-446655440000
              type: 1PASSWORD
              configuration:
                load_mode: all
        identities:
          description: |
            Activates an authenticated session.
          type: array
          items:
            type: object
            description: >-
              Previously configured identity to be used for the authenticated
              session.
            properties:
              id:
                type: string
                description: The identity ID to use for the browser session.
          example:
            - id: 123e4567-e89b-12d3-a456-426614174000
        identity_skip_validation:
          type: boolean
          default: true
          description: >
            When `true` (default), skip profile validation for active identities
            and reuse the saved

            browser profile. Set to `false` to validate the profile and
            re-authenticate if it is no

            longer signed in. Pending identities still authenticate on first
            use.
        identity_async_auth:
          type: boolean
          default: false
          description: >-
            Run identity authentication in the background and return the session
            immediately.
    SessionConfig:
      type: object
      description: Session-related configurations.
      properties:
        initial_url:
          type: string
          format: uri
          description: >-
            The URL to navigate to when the browser session starts. If not
            provided, the browser will load an empty page.
        tags:
          type: array
          items:
            type: string
          description: >-
            Custom labels to categorize and identify browser sessions. Useful
            for filtering, organizing, and tracking sessions across your
            workflows.
          example:
            - production
            - scraping
            - customer-123
        recording:
          type: object
          description: Configuration for session recording.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable video recording of the browser session.
                Defaults to `true`.
        proxy:
          $ref: '#/components/schemas/ProxyConfig'
        timeout:
          type: object
          description: Timeout configurations for the browser session.
          properties:
            max_duration:
              type: integer
              description: >-
                Maximum time (in minutes) the session can run before
                automatically terminating. Defaults to `20`. Set to `-1` to
                disable this limit.
            idle_timeout:
              type: integer
              description: >-
                Time (in minutes) the session waits for new connections after
                all others are closed before stopping. Defaults to `5`. Set to
                `-1` to disable this limit.
        live_view:
          type: object
          description: Configuration for live viewing the browser session.
          properties:
            read_only:
              type: boolean
              description: >-
                Enable or disable read-only mode for live viewing. Defaults to
                `false`.
            one_time_url:
              type: boolean
              description: >-
                Generate a single-use live view URL. After the first viewer
                connects, the link becomes invalid. Requires a headful browser.
                Defaults to `false`.
        scoped_access:
          type: object
          description: >-
            Return `live_view_read_only_url`, `live_view_url` and `cdp_url`
            carrying tokens instead of the session id, so they can be handed to
            end users. A `live_view_read_only_url` token can only watch, a
            `live_view_url` token can watch and interact, and a `cdp_url` token
            has full CDP control. The session id alone then no longer opens CDP
            or the live view: connect with a token, or with the session id and a
            token. Mint more with `POST /v1/sessions/{session_id}/tokens`.
            Requires a headful cloud browser and cannot be combined with
            `live_view.one_time_url`. With `live_view.read_only`, no live view
            can interact, so `live_view_url` is the read-only URL. Not accepted
            by batch or async session creation; mint tokens for those sessions
            once they are running.
          properties:
            active:
              type: boolean
              description: Enable scoped token URLs. Defaults to `false`.
        x402:
          type: boolean
          default: false
          description: >-
            Allow this browser session to automatically pay x402-protected
            resources using Amazon Bedrock AgentCore Payments.
        domain_allowlist:
          type: array
          maxItems: 100
          items:
            type: string
          description: >
            Domains this session may navigate to. `example.com` allows that
            domain and its subdomains. Document navigations to every other http
            or https site, including redirects, are blocked. Omit the field to
            allow the public web. The same field may be set on an API key,
            application, or task default, or in the project's enforced session
            configuration. Not available when session.hardware is mac.
          example:
            - example.com
            - example.org
    BrowserConfig:
      type: object
      description: Browser-specific configurations.
      properties:
        profile:
          type: object
          description: Options for managing and persisting browser session profiles.
          properties:
            name:
              type: string
              description: The name of the profile to be used during the browser session.
            persist:
              type: boolean
              description: >-
                Indicates whether the browser session profile data should be
                saved when the browser session ends. Defaults to `false`.
        adblock:
          type: object
          description: Configuration for ad-blocking.
          properties:
            active:
              type: boolean
              description: Enable or disable ad-blocking. Defaults to `true`.
        popup_blocker:
          type: object
          description: Configuration for popup blocking.
          properties:
            active:
              type: boolean
              description: >-
                Blocks popups, including ads and CAPTCHA consent banners.
                Requires adblock to be active. Defaults to `true`.
        captcha_solver:
          type: object
          description: Configuration for captcha-solving.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable captcha-solving. Requires proxy to be active.
                Defaults to `false`.
        headless:
          type: object
          description: Configuration for headless mode.
          properties:
            active:
              type: boolean
              description: >-
                Whether browser should be headless or headful. Defaults to
                `false`.
        viewport:
          type: object
          description: Configuration for the browser's viewport size.
          properties:
            width:
              type: integer
              description: Width of the viewport in pixels. Defaults to `1440`.
            height:
              type: integer
              description: Height of the viewport in pixels. Defaults to `900`.
        fullscreen:
          type: object
          description: Configuration for fullscreen mode.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable fullscreen mode. When enabled, the browser
                will start in fullscreen mode. Defaults to `false`.
        pdf_viewer:
          type: object
          description: Configuration for PDF viewer mode.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable PDF viewer mode. When disabled, the browser
                will download PDFs instead of viewing them. Defaults to `true`.
        p2p_download:
          type: object
          description: Configuration for peer-to-peer download capture functionality.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable P2P downloads. When enabled, the browser will
                capture downloads for direct data extraction, instead of
                uploading them on Anchor's storage. Defaults to `false`.
        extensions:
          type: array
          description: >-
            Array of extension IDs to load in the browser session. Extensions
            must be previously uploaded using the Extensions API.
          items:
            type: string
            format: uuid
        volume:
          type: object
          description: >-
            Mount a persistent volume into the session. Files the browser
            downloads are written to the volume's `downloads/` folder and remain
            available after the session ends. Create volumes with the Volumes
            API.
          required:
            - id
          properties:
            id:
              type: string
              format: uuid
              description: >-
                ID of a volume owned by your team (see `POST /v1/volumes`). The
                volume must be in the `ready` state.
            read_only:
              type: boolean
              description: >-
                Mount the volume read-only. Downloads then stay local to the
                session instead of being written to the volume. Defaults to
                `false`.
        disable_web_security:
          type: object
          description: Configuration for disabling web security features.
          properties:
            active:
              type: boolean
              description: >-
                Whether to disable web security features (CORS, same-origin
                policy, etc.). Allows accessing iframes and resources from
                different origins. Defaults to `false`.
        extra_stealth:
          type: object
          description: >-
            Enables our dedicated patched Chromium build, designed to avoid bot
            detection and blocking. Works with Anchor Proxy enabled only.
          properties:
            active:
              type: boolean
              description: Enable or disable extra stealth mode.
        force_popups_as_tabs:
          type: object
          description: >-
            Configuration for forcing popups to open as tabs instead of popup
            windows.
          properties:
            active:
              type: boolean
              description: Enable or disable forcing popups as tabs. Defaults to `false`.
        web_bot_auth:
          type: object
          description: >-
            Configuration for Cloudflare Web Bot Auth HTTP message signing.
            Enables authentication with websites that require Cloudflare's web
            bot authentication.
          properties:
            active:
              type: boolean
              description: Enable or disable web bot auth. Defaults to `false`.
        disable_dialogs:
          type: object
          description: >-
            Suppresses native browser dialogs (window.alert, window.confirm,
            window.prompt). Useful for automated workflows where dialogs would
            block execution.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable suppression of native browser dialogs.
                Defaults to `false`.
        tracing:
          type: object
          description: >-
            Console and network tracing. Network logs keep query parameter names
            but omit values, cookies, and credential headers.
          properties:
            active:
              type: boolean
              description: Enable or disable tracing. Defaults to `true`.
            snapshots:
              type: boolean
              description: >-
                Store document HTML for the DOM tab. HTML is saved as-is and may
                include tokens or PII. Defaults to `false`.
            sources:
              type: boolean
              description: Accepted for backward compatibility and ignored.
        sensitive_data_mask:
          type: object
          description: >-
            Automatically detects and masks sensitive data (passwords, emails,
            phone numbers, credit card fields, tokens) in web pages. Supports
            custom CSS selectors globally or per site, and custom regex
            patterns.
          properties:
            active:
              type: boolean
              description: Enable or disable sensitive data masking. Defaults to `false`.
            custom_selectors:
              type: array
              items:
                type: string
              description: >-
                Additional CSS selectors to mask globally across all sites.
                Matched elements will be blurred.
            site_selectors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
              description: >-
                Per-site CSS selectors. Keys are hostnames (supports wildcard
                prefix like `*.bank.com`), values are arrays of CSS selectors.
                Matched elements will be blurred.
            custom_patterns:
              type: array
              items:
                type: object
                properties:
                  regex:
                    type: string
                    description: Regular expression pattern to match sensitive data.
                  mask:
                    type: string
                    description: Replacement string for matched text. Defaults to `****`.
              description: >-
                Custom regex patterns to detect and mask additional sensitive
                data types.
    Integration:
      oneOf:
        - $ref: '#/components/schemas/OnePasswordIntegration'
      discriminator:
        propertyName: type
    ProxyConfig:
      description: |
        Proxy Documentation available at [Proxy Documentation](/advanced/proxy)
      type: object
      oneOf:
        - $ref: '#/components/schemas/AnchorProxy'
        - $ref: '#/components/schemas/CustomProxy'
    OnePasswordIntegration:
      type: object
      required:
        - id
        - type
        - configuration
      properties:
        id:
          type: string
          format: uuid
          description: Unique integration ID
          example: 550e8400-e29b-41d4-a716-446655440000
        type:
          type: string
          enum:
            - 1PASSWORD
          description: Integration type
        configuration:
          $ref: '#/components/schemas/OnePasswordConfig'
    AnchorProxy:
      title: Anchor Proxy
      type: object
      properties:
        active:
          type: boolean
        type:
          type: string
          enum:
            - anchor_proxy
          description: >-
            Create a session with a proxy to access websites as if you're
            browsing from a computer in that country.
          title: anchor_proxy
        country_code:
          $ref: '#/components/schemas/AnchorProxyCountryCode'
          description: |
            Supported country codes ISO 2 lowercase
        region:
          type: string
          description: |
            Region code for more specific geographic targeting.
            The city parameter can only be used when region is also provided.
        city:
          type: string
          description: >
            City name for precise geographic targeting. Supported for
            anchor_proxy only.

            Can only be used when region is also provided.
      required:
        - active
    CustomProxy:
      title: Custom Proxy
      type: object
      properties:
        type:
          type: string
          enum:
            - custom
        server:
          type: string
          description: >-
            Proxy address in **PROTOCOL://HOST:PORT** format (e.g.,
            https://proxy.example.com:443). See [Bring Your Own
            Proxy](/advanced/bring-your-own-proxy).
        username:
          type: string
          description: Proxy username
        password:
          type: string
          description: Proxy password
        active:
          type: boolean
      required:
        - type
        - server
        - username
        - password
        - active
    OnePasswordConfig:
      oneOf:
        - $ref: '#/components/schemas/OnePasswordAllSecretsConfig'
        - $ref: '#/components/schemas/OnePasswordSpecificSecretsConfig'
    AnchorProxyCountryCode:
      type: string
      title: anchor_proxy
      enum:
        - af
        - al
        - dz
        - ad
        - ao
        - as
        - ag
        - ar
        - am
        - aw
        - au
        - at
        - az
        - bs
        - bh
        - bb
        - by
        - be
        - bz
        - bj
        - bm
        - bo
        - ba
        - br
        - bg
        - bf
        - cm
        - ca
        - cv
        - td
        - cl
        - co
        - cg
        - cr
        - ci
        - hr
        - cu
        - cy
        - cz
        - dk
        - dm
        - do
        - ec
        - eg
        - sv
        - ee
        - et
        - fo
        - fi
        - fr
        - gf
        - pf
        - ga
        - gm
        - ge
        - de
        - gh
        - gi
        - gr
        - gd
        - gp
        - gt
        - gg
        - gn
        - gw
        - gy
        - ht
        - hn
        - hu
        - is
        - in
        - ir
        - iq
        - ie
        - il
        - it
        - jm
        - jp
        - jo
        - kz
        - kw
        - kg
        - lv
        - lb
        - ly
        - li
        - lt
        - lu
        - mk
        - ml
        - mt
        - mq
        - mr
        - mx
        - md
        - mc
        - me
        - ma
        - nl
        - nz
        - ni
        - ng
        - 'no'
        - pk
        - pa
        - py
        - pe
        - ph
        - pl
        - pt
        - pr
        - qa
        - ro
        - lc
        - sm
        - sa
        - sn
        - rs
        - sc
        - sl
        - sk
        - si
        - so
        - za
        - kr
        - es
        - sr
        - se
        - ch
        - sy
        - st
        - tw
        - tj
        - tg
        - tt
        - tn
        - tr
        - tc
        - ua
        - ae
        - us
        - uy
        - uz
        - ve
        - ye
      default: us
    OnePasswordAllSecretsConfig:
      type: object
      required:
        - load_mode
      properties:
        load_mode:
          type: string
          enum:
            - all
          description: Load all secrets from 1Password
    OnePasswordSpecificSecretsConfig:
      type: object
      required:
        - load_mode
        - secrets
      properties:
        load_mode:
          type: string
          enum:
            - specific
          description: Load specific secrets from 1Password
        secrets:
          type: array
          items:
            type: string
          minItems: 1
          description: Array of secret references to load
          example:
            - op://vault/item/field
  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).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.