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

# Open a session without an API key

> Open a web session with no API key, so client-side code can mint its own token. Works only for assistants marked `public`, which makes the assistant id the entire credential: anyone who reads it out of your page source can start sessions billed to your organization. The assistant joins the room once the client connects.



## OpenAPI

````yaml /voice-agents/api-reference/openapi.yaml post /realtime-assistants/{realtimeAssistantId}/public-session
openapi: 3.1.0
info:
  title: UpliftAI Voice Agents API
  version: '1.0'
  description: >-
    Build voice assistants, start conversations on the web or the phone, run
    calling campaigns, and receive outcomes by webhook. All endpoints take a
    bearer API key unless noted otherwise.
servers:
  - url: https://api.upliftai.org/v1
security:
  - apiKey: []
tags:
  - name: Assistants
  - name: Authoring an assistant
  - name: Starting a conversation
  - name: Sessions & call records
  - name: Campaigns
  - name: Campaign outcomes
  - name: Contacts
  - name: Google Sheet sources
  - name: Integrations & delivery health
paths:
  /realtime-assistants/{realtimeAssistantId}/public-session:
    post:
      tags:
        - Starting a conversation
      summary: Open a session without an API key
      description: >-
        Open a web session with no API key, so client-side code can mint its own
        token. Works only for assistants marked `public`, which makes the
        assistant id the entire credential: anyone who reads it out of your page
        source can start sessions billed to your organization. The assistant
        joins the room once the client connects.
      operationId: createPublicSession
      parameters:
        - name: realtimeAssistantId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          example: fa13c857-xxxx-xxxx-xxxx-xxxxxxxxxxxx
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePublicSessionRequest'
            example:
              participantName: عائشہ صدیقی
              roomName: shifa-clinic-demo
      responses:
        '200':
          description: >-
            Credentials for the browser client. The agent joins once the client
            connects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionToken'
              example:
                token: >-
                  eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6InNoaWZhLWNsaW5pYy1kZS02Mjcw…
                wsUrl: wss://upliftai-prod-yd34to8b.livekit.cloud
                roomName: shifa-clinic-de-6270e96c-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        '400':
          description: Validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message:
                  - participantName should not be empty
                  - participantName must be a string
                error: Bad Request
                statusCode: 400
        '402':
          description: >-
            The assistant's organization is out of credits. No session is
            created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Insufficient credits to start a realtime session
                error: Payment Required
                statusCode: 402
        '403':
          description: >-
            The assistant is not `public`. Once it has been published, this
            reads the published version, so turning `public` on takes an update
            and then a publish.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: Assistant is not available publicly
                error: Forbidden
                statusCode: 403
        '404':
          description: No assistant with that id in any project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: >-
                  Realtime assistant not found:
                  00000000-0000-4000-8000-000000000000
                error: Not Found
                statusCode: 404
        '503':
          $ref: '#/components/responses/VersionNotReady'
      security: []
components:
  schemas:
    CreatePublicSessionRequest:
      type: object
      properties:
        participantName:
          type: string
          minLength: 1
          description: Display name of the person joining, as the assistant sees it.
        roomName:
          type: string
          description: >-
            Cosmetic prefix for the generated room — truncated to 15 characters,
            with the session id appended. Overrides the assistant's
            `config.session.roomPrefix`.
      required:
        - participantName
    SessionToken:
      type: object
      properties:
        token:
          type: string
          description: >-
            LiveKit access token. Hand it to a LiveKit client SDK along with
            `wsUrl`.
        wsUrl:
          type: string
          format: uri
          description: LiveKit WebSocket URL the client connects to.
        roomName:
          type: string
          description: The room this token opens. Server-generated — treat it as opaque.
    Error:
      type: object
      properties:
        message:
          description: >-
            One message per failed field for validation errors, a single string
            otherwise.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        error:
          type: string
        statusCode:
          type: integer
  responses:
    VersionNotReady:
      description: >-
        The published version hasn't reached this region yet, usually right
        after a publish. No session or call was started. Retry in a few seconds.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            message: >-
              Published version 14 of assistant
              0f4a91d3-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not readable yet
            statusCode: 503
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Project API key (`sk_api_…`).

````