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

# Create an embeddable connect session

> Start a hosted connect session the creator completes in a popup or iframe (no API key on the front end). Returns an `embed_url` and `phone_url`. Requires `accounts:write`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/connect/client-sessions
openapi: 3.1.0
info:
  title: onlyfanskit REST API
  description: >-
    Connect OnlyFans accounts and act on them over HTTP. Authenticate with a
    bearer API key, connect a creator account once, then call any method or
    stream realtime events. Not affiliated with OnlyFans or Fenix International
    Limited.
  version: 1.0.0
servers:
  - url: https://api.onlyfanskit.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Identity, keys, and usage for the calling org.
  - name: Connect
    description: Link OnlyFans accounts via cookie, cURL, email/password, or mobile.
  - name: Accounts
    description: Manage connected accounts.
  - name: SDK
    description: Call any SDK method against a connected account.
  - name: Realtime
    description: Server-Sent Events stream of account activity.
  - name: Webhooks
    description: HTTP callbacks for account events.
paths:
  /v1/connect/client-sessions:
    post:
      tags:
        - Connect
      summary: Create an embeddable connect session
      description: >-
        Start a hosted connect session the creator completes in a popup or
        iframe (no API key on the front end). Returns an `embed_url` and
        `phone_url`. Requires `accounts:write`.
      operationId: connectClientSession
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                display_name:
                  type: string
                  maxLength: 120
                client_reference_id:
                  type: string
                  maxLength: 120
                proxy_country:
                  $ref: '#/components/schemas/ProxyCountry'
                remember_credentials:
                  type: boolean
      responses:
        '201':
          description: Client session created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Attempt'
                  - type: object
                    properties:
                      client_session_id:
                        type: string
                      client_reference_id:
                        type: string
                        nullable: true
components:
  schemas:
    ProxyCountry:
      type: string
      enum:
        - us
        - uk
      description: Egress proxy region for the account's traffic.
    Attempt:
      type: object
      properties:
        attempt_id:
          type: string
        state:
          type: string
          description: Lifecycle state of the attempt.
          enum:
            - pending
            - awaiting_mobile_session
            - needs_otp
            - needs_app_otp
            - needs_email
            - needs_face_otp
            - wrong_2fa_code_retry
            - completed_success
            - completed_failed
        account_id:
          type: string
          nullable: true
          description: Present once `state` is `completed_success`.
        polling_url:
          type: string
          nullable: true
        verification_page_url:
          type: string
          nullable: true
        phone_url:
          type: string
          nullable: true
        embed_url:
          type: string
          nullable: true
        otp_channel:
          type: string
          nullable: true
        email_mask:
          type: string
          nullable: true
        next_actions:
          type: array
          items:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as `Authorization: Bearer <key>`.'

````