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

# Create Session Token

> Create session token for an API-key-authenticated user.

Minting a session token is only doable via an API key (``APIUserDep``) — a
session JWT (``SessionUser``) cannot mint a token for another participant.



## OpenAPI

````yaml /openapi.json post /v1/sessions/token
openapi: 3.1.0
info:
  title: Live avatar API
  version: 0.1.0
servers:
  - url: https://api.liveavatar.com
security: []
paths:
  /v1/sessions/token:
    post:
      tags:
        - Sessions
      summary: Create Session Token
      description: >-
        Create session token for an API-key-authenticated user.


        Minting a session token is only doable via an API key (``APIUserDep``) —
        a

        session JWT (``SessionUser``) cannot mint a token for another
        participant.
      operationId: create_session_token_v1_sessions_token_post
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/FullSDKSessionTokenConfigDataSchema'
                - $ref: '#/components/schemas/LiteSDKSessionTokenConfigDataSchema'
              title: Payload
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response_SDKSessionTokenSchema_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    FullSDKSessionTokenConfigDataSchema:
      properties:
        mode:
          type: string
          const: FULL
          title: Mode
          default: FULL
        avatar_id:
          type: string
          format: uuid
          title: Avatar Id
        is_sandbox:
          type: boolean
          title: Is Sandbox
          default: false
        video_settings:
          anyOf:
            - $ref: '#/components/schemas/VideoSettings'
            - type: 'null'
          description: Video encoding settings
        max_session_duration:
          title: Max Session Duration
          description: >-
            Maximum session duration in seconds. Must be <= the configured limit
            for your subscription tier.
          type: integer
        avatar_persona:
          anyOf:
            - $ref: '#/components/schemas/AvatarPersonaSchema'
            - type: 'null'
          description: >-
            Inline voice / context / voice_settings. Mutually exclusive with
            voice_agent.
          deprecated: true
        voice_agent:
          anyOf:
            - $ref: '#/components/schemas/VoiceAgentRef'
            - type: 'null'
          description: >-
            Reference a stored voice_agent by id; the server resolves its
            agent_type and builds the session accordingly (which per-session
            overrides apply depends on the type — see VoiceAgentRef). An
            elevenlabs_agent produces a LITE session even on this FULL request.
            Mutually exclusive with avatar_persona.
        interactivity_type:
          $ref: '#/components/schemas/SessionInteractivityTypeEnum'
          default: CONVERSATIONAL
        llm_configuration_id:
          title: Llm Configuration Id
          description: Optional custom LLM configuration ID
          type: string
          format: uuid
        dynamic_variables:
          title: Dynamic Variables
          description: >-
            Values for ${var} placeholders in the context's opening_text and
            prompt. Required keys are derived from the context; extra keys are
            ignored. At most 50 entries; keys <= 64 chars; values <= 1000 chars.
          additionalProperties:
            type: string
          type: object
        memory:
          anyOf:
            - $ref: '#/components/schemas/MemoryRef'
            - type: 'null'
          description: >-
            Attach session memory. Provide `prev_session_id` to seed/reuse from
            a prior session, `session_memory_id` to attach an existing memory,
            or both (must resolve to the same memory_id).
      type: object
      required:
        - avatar_id
      title: Full Mode
    LiteSDKSessionTokenConfigDataSchema:
      properties:
        mode:
          type: string
          const: LITE
          title: Mode
          default: LITE
        avatar_id:
          type: string
          format: uuid
          title: Avatar Id
        is_sandbox:
          type: boolean
          title: Is Sandbox
          default: false
        video_settings:
          anyOf:
            - $ref: '#/components/schemas/VideoSettings'
            - type: 'null'
          description: Video encoding settings
        max_session_duration:
          title: Max Session Duration
          description: >-
            Maximum session duration in seconds. Must be <= the configured limit
            for your subscription tier.
          type: integer
        livekit_config:
          anyOf:
            - $ref: '#/components/schemas/LiveKitConfigSchema'
            - type: 'null'
          description: LiveKit config. Allow users to override the livekit config
        agora_config:
          anyOf:
            - $ref: '#/components/schemas/AgoraConfigSchema'
            - type: 'null'
          description: Agora config. Allow users to use Agora as the transport layer
        elevenlabs_agent_config:
          anyOf:
            - $ref: '#/components/schemas/ElevenLabsAgentConfigSchema'
            - type: 'null'
          description: >-
            ElevenLabs Agent config. When set, uses ElevenLabs Agent instead of
            default.
        openai_realtime_config:
          anyOf:
            - $ref: '#/components/schemas/OpenAIRealtimeConfigSchema'
            - type: 'null'
          description: >-
            OpenAI Realtime config. When set, uses OpenAI Realtime API instead
            of default.
        gemini_realtime_config:
          anyOf:
            - $ref: '#/components/schemas/GeminiRealtimeConfigSchema'
            - type: 'null'
          description: >-
            Gemini Realtime config. When set, uses Gemini Live API instead of
            default.
      type: object
      required:
        - avatar_id
      title: Lite Mode
    Response_SDKSessionTokenSchema_:
      properties:
        code:
          type: integer
          title: Code
          default: 100
        data:
          anyOf:
            - $ref: '#/components/schemas/SDKSessionTokenSchema'
            - type: 'null'
        message:
          title: Message
          type: string
      type: object
      title: Response[SDKSessionTokenSchema]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VideoSettings:
      properties:
        quality:
          $ref: '#/components/schemas/VideoQualityEnum'
          default: high
        encoding:
          $ref: '#/components/schemas/VideoEncodingEnum'
          default: H264
      type: object
      title: VideoSettings
      description: Video encoding settings for session configuration
    AvatarPersonaSchema:
      properties:
        voice_id:
          title: Voice Id
          description: Voice ID. If empty use default avatar voice
          type: string
          format: uuid
        context_id:
          title: Context Id
          description: Context ID
          type: string
          format: uuid
        language:
          type: string
          title: Language
          description: Language
          default: en
        voice_settings:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/ElevenLabsVoiceSettings'
                - $ref: '#/components/schemas/FishAudioVoiceSettings'
              discriminator:
                propertyName: provider
                mapping:
                  elevenLabs:
                    $ref: '#/components/schemas/ElevenLabsVoiceSettings'
                  fish:
                    $ref: '#/components/schemas/FishAudioVoiceSettings'
            - type: 'null'
          title: Voice Settings
          description: >-
            Additional voice settings (provider-specific, discriminated by
            'provider' field)
        stt_config:
          anyOf:
            - $ref: '#/components/schemas/STTConfigSchema'
            - type: 'null'
          description: ASR/STT configuration override
      type: object
      title: AvatarPersonaSchema
    VoiceAgentRef:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: >-
            Stored voice_agent id. Its server-resolved agent_type determines
            which of the override fields below are accepted.
        language:
          title: Language
          description: >-
            Per-session language override, layered over the agent's stored
            language. Accepted only for a liveavatar_agent; rejected with a 400
            for an elevenlabs_agent.
          type: string
        dynamic_variables:
          title: Dynamic Variables
          description: >-
            Per-session dynamic_variables override. Accepted only for a
            liveavatar_agent, where values must be strings (substituted as text
            into the context's ${var} placeholders; non-string values are
            rejected with a 400). Rejected with a 400 for an elevenlabs_agent.
            Mutually exclusive with the top-level dynamic_variables (400 if both
            set). At most 50 entries; keys <= 64 chars; string values <= 1000
            chars.
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
          type: object
      type: object
      required:
        - id
      title: VoiceAgentRef
      description: >-
        Reference to a stored voice_agent, plus optional per-session overrides.


        The caller passes only the agent ``id``; the server resolves the stored

        agent's ``agent_type`` and decides how the session is built. The
        override

        fields below are NOT universal — which ones are accepted depends on the

        resolved type, and an override that doesn't apply is rejected (400)
        rather

        than silently ignored:


        * ``liveavatar_agent`` (managed STT -> LLM -> TTS pipeline):
        ``language``
          and ``dynamic_variables`` are honored, layered over the stored agent's
          config for this session only.
        * ``elevenlabs_agent`` (ElevenLabs-hosted): the stored agent is used
        as-is;
          passing ``language`` or ``dynamic_variables`` is rejected with a 400.

        Overrides are per-session-at-creation choices, not properties of the
        stored

        agent — the same agent is reused across sessions with different values
        each

        time, and the resolved result is what gets frozen into the session
        snapshot.

        Shared across the SDK and app token requests.


        ``dynamic_variables`` is typed as the bounded union for
        forward-compatibility

        (a single wire type across agent types); the server narrows or rejects
        it per

        the resolved ``agent_type`` as described on the field.
    SessionInteractivityTypeEnum:
      type: string
      enum:
        - CONVERSATIONAL
        - PUSH_TO_TALK
      title: SessionInteractivityTypeEnum
    MemoryRef:
      properties:
        prev_session_id:
          title: Prev Session Id
          description: >-
            Seed memory from a prior FULL-mode session. Reused if a
            session-memory already exists for that session; otherwise
            sync-bootstrapped.
          type: string
          format: uuid
        session_memory_id:
          title: Session Memory Id
          description: >-
            Attach an existing session-typed memory by id (must belong to
            caller's space).
          type: string
          format: uuid
      type: object
      title: MemoryRef
      description: |-
        Session-memory attach request.

        Either field may be set. If both are set, they must resolve to the same
        memory_id; mismatch -> 400.
    LiveKitConfigSchema:
      properties:
        livekit_url:
          type: string
          title: Livekit Url
        livekit_room:
          type: string
          title: Livekit Room
        livekit_client_token:
          type: string
          title: Livekit Client Token
      type: object
      required:
        - livekit_url
        - livekit_room
        - livekit_client_token
      title: LiveKitConfigSchema
    AgoraConfigSchema:
      properties:
        agora_app_id:
          type: string
          title: Agora App Id
        agora_token:
          type: string
          title: Agora Token
        agora_channel:
          type: string
          title: Agora Channel
        agora_uid:
          type: string
          title: Agora Uid
      type: object
      required:
        - agora_app_id
        - agora_token
        - agora_channel
        - agora_uid
      title: AgoraConfigSchema
    ElevenLabsAgentConfigSchema:
      properties:
        secret_id:
          type: string
          format: uuid
          title: Secret Id
          description: Secret ID for ELEVENLABS_API_KEY
        agent_id:
          type: string
          title: Agent Id
          description: ElevenLabs Agent ID
        voice_id:
          title: Voice Id
          description: >-
            Optional ElevenLabs voice ID override. When set, sent to the
            ElevenLabs Agent WebSocket as
            `conversation_config_override.tts.voice_id`, overriding the agent's
            default voice for this session. When omitted, the agent's configured
            default voice is used. See
            https://elevenlabs.io/docs/eleven-agents/api-reference/eleven-agents/websocket
          type: string
        dynamic_variables:
          title: Dynamic Variables
          description: >-
            ElevenLabs Agent dynamic variables injected into prompts and tools.
            See
            https://elevenlabs.io/docs/eleven-agents/customization/personalization/dynamic-variables
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: number
              - type: boolean
          type: object
      type: object
      required:
        - secret_id
        - agent_id
      title: ElevenLabsAgentConfigSchema
      description: >-
        Config for ElevenLabs Agent mode in LITE sessions. All fields required
        when present.
    OpenAIRealtimeConfigSchema:
      properties:
        secret_id:
          type: string
          format: uuid
          title: Secret Id
          description: Secret ID referencing OPENAI_API_KEY secret
        context_id:
          title: Context Id
          description: Context ID.
          type: string
          format: uuid
        voice:
          $ref: '#/components/schemas/OpenAIRealtimeVoiceEnum'
          description: OpenAI Realtime voice
          default: alloy
        temperature:
          type: number
          maximum: 1.2
          minimum: 0.6
          title: Temperature
          description: Sampling temperature
          default: 0.8
        model:
          type: string
          title: Model
          description: OpenAI Realtime model
          default: gpt-realtime
      type: object
      required:
        - secret_id
      title: OpenAIRealtimeConfigSchema
      description: Config for OpenAI Realtime Agent mode in LITE sessions.
    GeminiRealtimeConfigSchema:
      properties:
        secret_id:
          type: string
          format: uuid
          title: Secret Id
          description: Secret ID referencing GEMINI_API_KEY secret
        context_id:
          title: Context Id
          description: Context ID.
          type: string
          format: uuid
        voice:
          $ref: '#/components/schemas/GeminiRealtimeVoiceEnum'
          description: Gemini Realtime voice
          default: Puck
        temperature:
          type: number
          maximum: 2
          minimum: 0
          title: Temperature
          description: Sampling temperature
          default: 0.8
        model:
          $ref: '#/components/schemas/GeminiRealtimeModelEnum'
          description: Gemini Realtime model
          default: gemini-3.1-flash-live-preview
      type: object
      required:
        - secret_id
      title: GeminiRealtimeConfigSchema
      description: Config for Gemini Realtime Agent mode in LITE sessions.
    SDKSessionTokenSchema:
      properties:
        session_id:
          type: string
          format: uuid
          title: Session Id
        session_token:
          type: string
          title: Session Token
      type: object
      required:
        - session_id
        - session_token
      title: SDKSessionTokenSchema
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          title: Message
          type: string
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    VideoQualityEnum:
      type: string
      enum:
        - very_high
        - high
        - medium
        - low
      title: VideoQualityEnum
    VideoEncodingEnum:
      type: string
      enum:
        - VP8
        - H264
      title: VideoEncodingEnum
    ElevenLabsVoiceSettings:
      properties:
        provider:
          type: string
          const: elevenLabs
          title: Provider
          default: elevenLabs
        speed:
          type: number
          maximum: 1.2
          minimum: 0.8
          title: Speed
          default: 1
        stability:
          type: number
          maximum: 1
          minimum: 0
          title: Stability
          default: 0.75
        similarity_boost:
          type: number
          maximum: 1
          minimum: 0
          title: Similarity Boost
          default: 0.75
        style:
          type: number
          maximum: 1
          minimum: 0
          title: Style
          default: 0
        use_speaker_boost:
          type: boolean
          title: Use Speaker Boost
          default: true
        model:
          $ref: '#/components/schemas/ElevenLabsModelEnum'
          description: >-
            ElevenLabs TTS model. Options: 'eleven_flash_v2_5' (default, faster)
            or 'eleven_multilingual_v2' (better quality).
          default: eleven_flash_v2_5
        apply_language_text_normalization:
          type: boolean
          title: Apply Language Text Normalization
          description: >-
            Apply ElevenLabs language-specific text normalization. Improves
            pronunciation for languages with complex orthography — currently
            only Japanese ('ja') is supported. Enabling this adds latency, so it
            is opt-in and only valid when the session language is set to 'ja'.
          default: false
      type: object
      title: ElevenLabsVoiceSettings
      description: ElevenLabs-specific voice settings for TTS configuration.
    FishAudioVoiceSettings:
      properties:
        provider:
          type: string
          const: fish
          title: Provider
          default: fish
        speed:
          type: number
          maximum: 1.2
          minimum: 0.8
          title: Speed
          default: 1
        model:
          $ref: '#/components/schemas/FishAudioModelEnum'
          description: Fish Audio TTS model.
          default: s2
        latency_mode:
          type: string
          enum:
            - normal
            - balanced
          title: Latency Mode
          description: 'Latency mode: ''normal'' (~500ms) or ''balanced'' (~300ms).'
          default: balanced
      type: object
      title: FishAudioVoiceSettings
      description: Fish Audio-specific voice settings for TTS configuration.
    STTConfigSchema:
      properties:
        provider:
          $ref: '#/components/schemas/STTProviderEnum'
          description: STT provider. Auto-selected if not specified.
      type: object
      required:
        - provider
      title: STTConfigSchema
      description: User-provided STT configuration for sessions.
    OpenAIRealtimeVoiceEnum:
      type: string
      enum:
        - alloy
        - ash
        - ballad
        - coral
        - echo
        - fable
        - onyx
        - nova
        - shimmer
        - sage
        - verse
        - marin
        - cedar
      title: OpenAIRealtimeVoiceEnum
    GeminiRealtimeVoiceEnum:
      type: string
      enum:
        - Achernar
        - Achird
        - Algenib
        - Algieba
        - Alnilam
        - Aoede
        - Autonoe
        - Callirrhoe
        - Charon
        - Despina
        - Enceladus
        - Erinome
        - Fenrir
        - Gacrux
        - Iapetus
        - Kore
        - Laomedeia
        - Leda
        - Orus
        - Pulcherrima
        - Puck
        - Rasalgethi
        - Sadachbia
        - Sadaltager
        - Schedar
        - Sulafat
        - Umbriel
        - Vindemiatrix
        - Zephyr
        - Zubenelgenubi
      title: GeminiRealtimeVoiceEnum
    GeminiRealtimeModelEnum:
      type: string
      enum:
        - gemini-2.5-flash-native-audio-preview-12-2025
        - gemini-3.1-flash-live-preview
      title: GeminiRealtimeModelEnum
    ElevenLabsModelEnum:
      type: string
      enum:
        - eleven_flash_v2_5
        - eleven_multilingual_v2
      title: ElevenLabsModelEnum
    FishAudioModelEnum:
      type: string
      enum:
        - s1
        - s2
      title: FishAudioModelEnum
    STTProviderEnum:
      type: string
      enum:
        - deepgram
        - assembly_ai
        - gladia
        - elevenlabs
      title: STTProviderEnum
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY

````