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

# Authorize user

> Checks whether a user is currently connected (i.e., has authorized charging).

If not connected, a `url` field will be returned to redirect the user to the connection flow (e.g., a consent or wallet approval page).




## OpenAPI

````yaml GET /user/connect
openapi: 3.1.0
info:
  title: Paywalls.ai API
  description: >
    The Paywalls.ai API enables developers to integrate monetization and access
    control for OpenAI-compatible LLMs.


    This proxy service supports multiple pricing strategies—including
    per-request, token-based, and subscription models—while maintaining full
    compatibility with the OpenAI API format.


    Requests are automatically checked for user authorization and balance. If
    the user is not connected to the paywall, or lacks sufficient balance, the
    API will return actionable links for onboarding or top-up.


    Use this API to monetize your AI-powered apps and services with minimal
    effort.


    Visit [paywalls.ai](https://docs.paywalls.ai) for full documentation and
    setup guides.
  version: 1.0.0
servers:
  - url: https://api.paywalls.ai/v1
    description: Primary production server
security:
  - ApiKeyAuth: []
tags:
  - name: Chat
    description: >
      OpenAI-compatible chat completion endpoint that enforces paywall logic
      before proxying the request to a model provider.


      Automatically checks user connection, balance, and performs charging.
      Supports streaming and non-streaming completions.
  - name: Models
    description: >
      Retrieve metadata and pricing information about the LLM models supported
      by the proxy.


      Includes prompt and completion pricing, per-request costs, and display
      details for UI integration.
  - name: User
    description: >
      Endpoints for managing user sessions, balance, and charging status.


      Includes functionality for connecting to or disconnecting from the
      paywall, checking balance, initiating top-ups, and issuing manual charges.
  - name: Webhooks
    description: >
      Manage webhook subscriptions and inspect delivery activity for your
      paywall integrations.
paths:
  /user/connect:
    get:
      tags:
        - User
      summary: Check user connection status to the paywall
      description: >
        Checks whether a user is currently connected (i.e., has authorized
        charging).


        If not connected, a `url` field will be returned to redirect the user to
        the connection flow (e.g., a consent or wallet approval page).
      parameters:
        - $ref: '#/components/parameters/XPaywallUser'
        - in: query
          name: user
          required: false
          description: The unique identifier of the user to check connection status for.
          schema:
            type: string
      responses:
        '200':
          description: User is connected to the paywall.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/UserConnectedResponse'
                  - $ref: '#/components/schemas/UserNotConnectedResponse'
components:
  parameters:
    XPaywallUser:
      name: X-Paywall-User
      in: header
      required: false
      schema:
        type: string
      description: >
        Optional user identifier provided by the developer.

        Can be used instead of the `user` property in the request body to
        associate the API call with a specific end user.
  schemas:
    UserConnectedResponse:
      type: object
      description: >
        Response structure when a user is connected and authorized to be charged
        via the paywall.
      properties:
        connected:
          type: boolean
          description: Boolean indicating that the user is connected and authorized.
        connectedUser:
          $ref: '#/components/schemas/ConnectedUser'
        message:
          type: string
          description: Human-readable message confirming the connection status.
      example:
        connected: true
        connectedUser:
          paywallKeyId: paywall_123
          userId: user_456
          externalUserId: ext_user_789
          createdAt: '2023-10-01T12:00:00Z'
        message: User is connected to the paywall.
    UserNotConnectedResponse:
      type: object
      description: |
        Response structure when the user is not connected to the paywall.
        A connection link is provided so the user can authorize charges.
      properties:
        connected:
          type: boolean
          description: Always false in this response type.
        message:
          type: string
          description: Human-readable message explaining the user is not connected.
        url:
          type: string
          description: URL the user can visit to connect and authorize future charges.
      example:
        connected: false
        message: User is not connected to the paywall.
        url: https://paywalls.ai/connect?...
    ConnectedUser:
      type: object
      description: >
        Information about a user who has successfully connected to a paywall.

        Includes internal and external user identifiers and the associated
        paywall key.
      properties:
        paywallKeyId:
          type: string
          description: >-
            Unique identifier of the paywall configuration the user is connected
            to.
        userId:
          type: string
          description: Internal identifier used by Paywalls.ai to represent the user.
        externalUserId:
          type: string
          description: Identifier supplied by the developer to track their own users.
        createdAt:
          type: string
          format: date-time
          description: >-
            ISO 8601 timestamp indicating when the user was connected to the
            paywall.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````