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

# Create Identity

> Creates a new identity for the given source. Credentials are optional.




## OpenAPI

````yaml /openapi.yaml post /v1/identities
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/identities:
    post:
      tags:
        - Identities
      summary: Create Identity
      description: |
        Creates a new identity for the given source. Credentials are optional.
      parameters:
        - name: validateAsync
          in: query
          required: false
          description: Whether to validate the identity asynchronously. Defaults to true.
          schema:
            type: boolean
            default: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIdentityRequest'
            examples:
              createEmptyIdentity:
                summary: Minimal create request (source only, no credentials)
                value:
                  name: My Work Account
                  source: https://example.com/login
              createIdentityWithPassword:
                summary: Create identity with username/password credential
                value:
                  name: My Work Account
                  source: https://example.com/login
                  credentials:
                    - type: username_password
                      username: user@example.com
                      password: securepassword123
                  metadata:
                    department: Engineering
              createIdentityWithAuthenticator:
                summary: Create identity with authenticator
                value:
                  name: Two-Factor Account
                  source: https://secure.example.com/login
                  credentials:
                    - type: username_password
                      username: user@example.com
                      password: securepassword123
                    - type: authenticator
                      secret: JBSWY3DPEHPK3PXP
      responses:
        '201':
          description: Identity created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateIdentityResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to create identity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key_header: []
components:
  schemas:
    CreateIdentityRequest:
      type: object
      required:
        - source
      properties:
        name:
          type: string
          description: >-
            Name of the identity. Defaults to "Unnamed Identity" if not
            provided.
        source:
          type: string
          format: uri
          description: The source URL for the identity (e.g., login page URL)
        credentials:
          type: array
          items:
            $ref: '#/components/schemas/CredentialData'
          description: >
            Optional credentials to associate with this identity (for example
            username/password

            or authenticator secrets). Omit this field or supply an empty array
            when you only

            need an identity for the given source URL and optional metadata.
        metadata:
          type: object
          additionalProperties: true
          description: Optional metadata for the identity
        applicationName:
          type: string
          description: Optional application name to associate with the identity
        applicationDescription:
          type: string
          description: Optional application description
    CreateIdentityResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the identity
        name:
          type: string
          description: Name of the identity
        status:
          type: string
          enum:
            - pending
            - validated
            - failed
          description: Status of the identity
        metadata:
          type: object
          additionalProperties: true
          description: Metadata associated with the identity
        created_at:
          type: string
          format: date-time
          description: Timestamp when the identity was created
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
    CredentialData:
      oneOf:
        - $ref: '#/components/schemas/UsernamePasswordCredential'
        - $ref: '#/components/schemas/AuthenticatorCredential'
        - $ref: '#/components/schemas/CustomCredential'
      discriminator:
        propertyName: type
    UsernamePasswordCredential:
      title: username_password
      type: object
      required:
        - type
        - username
        - password
      properties:
        type:
          type: string
          enum:
            - username_password
          description: Credential type
        username:
          type: string
          description: Username for authentication
        password:
          type: string
          description: Password for authentication
    AuthenticatorCredential:
      title: authenticator
      type: object
      required:
        - type
        - secret
      properties:
        type:
          type: string
          enum:
            - authenticator
          description: Credential type
        secret:
          type: string
          description: TOTP secret for authenticator
        otp:
          type: string
          description: Optional OTP code
    CustomCredential:
      title: custom
      type: object
      required:
        - type
        - fields
      properties:
        type:
          type: string
          enum:
            - custom
          description: Credential type
        fields:
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldItem'
          description: Array of custom fields
    CustomFieldItem:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          description: Field name
        value:
          type: string
          description: Field value
  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`).

````