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

# create session token

> Create a new session token used to initialise Anam client side SDKs



## OpenAPI

````yaml https://api.anam.ai/swagger.json post /v1/auth/session-token
openapi: 3.1.0
info:
  title: Anam AI API
  version: '1.0'
servers:
  - url: https://api.anam.ai
    description: Anam API
security:
  - BearerAuth: []
tags:
  - name: Sessions
  - name: Personas
  - name: Avatars
  - name: Voices
  - name: LLMs
  - name: Knowledge
  - name: Tools
  - name: Share Links
paths:
  /v1/auth/session-token:
    post:
      tags:
        - Sessions
      summary: create session token
      description: Create a new session token used to initialise Anam client side SDKs
      operationId: createSessionToken
      requestBody:
        description: >
          Configuration for the session to be created. Supply
          `personaConfig.personaId` to use a persona you've already created
          (stateful), or the set `avatarId`/`voiceId`/`llmId`/`systemPrompt` to
          configure the persona at run time (ephemeral).


          The returned token is valid for one hour and bound to this exact
          config.
        required: true
        content:
          application/json:
            examples:
              default:
                $ref: '#/components/examples/SessionTokenCreate'
            schema:
              type: object
              properties:
                clientLabel:
                  type: string
                  description: The client label for the session
                personaConfig:
                  oneOf:
                    - type: object
                      properties:
                        name:
                          type: string
                          example: Cara
                        avatarId:
                          type: string
                          example: 071b0286-4cce-4808-bee2-e642f1062de3
                        avatarModel:
                          type: string
                          example: cara-3
                          description: >-
                            Avatar model version. Models with the '-latest'
                            suffix are invite only.
                          enum:
                            - cara-2
                            - cara-3
                            - cara-4-latest
                        voiceId:
                          type: string
                          example: de23e340-1416-4dd8-977d-065a7ca11697
                        llmId:
                          type: string
                          example: a7cf662c-2ace-4de1-a21e-ef0fbf144bb7
                        systemPrompt:
                          type: string
                          example: You are a helpful assistant
                        maxSessionLengthSeconds:
                          type: number
                          example: 600
                        skipGreeting:
                          type: boolean
                          example: false
                        uninterruptibleGreeting:
                          type: boolean
                          description: >-
                            When true, the greeting message cannot be
                            interrupted by the user.
                          example: false
                        initialMessage:
                          type: string
                          nullable: true
                          description: >-
                            Custom first message the persona speaks to open the
                            conversation. If empty or not provided, the persona
                            generates its own greeting.
                          example: Hi there! I'm excited to chat with you today.
                        voiceDetectionOptions:
                          $ref: '#/components/schemas/VoiceDetectionOptions'
                        languageCode:
                          type: string
                          description: >-
                            ISO 639-1 formatted language code override for
                            transcription, replaces organisation level settings
                            and multilingual (default) mode.
                        voiceGenerationOptions:
                          description: Configuration options for voice generation.
                          oneOf:
                            - $ref: >-
                                #/components/schemas/ElevenLabsV1VoiceGenerationOptions
                            - $ref: >-
                                #/components/schemas/ElevenLabsV2VoiceGenerationOptions
                            - $ref: >-
                                #/components/schemas/CartesiaSonic3VoiceGenerationOptions
                            - $ref: >-
                                #/components/schemas/FishAudioVoiceGenerationOptions
                    - type: object
                      properties:
                        personaId:
                          type: string
                sessionOptions:
                  type: object
                  properties:
                    sessionReplay:
                      type: object
                      properties:
                        enableSessionReplay:
                          type: boolean
                          example: true
                          default: true
                    videoQuality:
                      type: string
                      enum:
                        - high
                        - auto
                      description: >-
                        'high' pins highest bitrate, 'auto' enables adaptive
                        bitrate.
                      example: high
      responses:
        '200':
          description: Successfully started session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionToken'
              examples:
                default:
                  $ref: '#/components/examples/SessionTokenResponse'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized - Invalid or missing API key
        '500':
          description: Server error
components:
  examples:
    SessionTokenCreate:
      summary: Mint a token for an ephemeral persona
      value:
        personaConfig:
          name: Cara
          avatarId: 071b0286-4cce-4808-bee2-e642f1062de3
          voiceId: de23e340-1416-4dd8-977d-065a7ca11697
          llmId: a7cf662c-2ace-4de1-a21e-ef0fbf144bb7
          systemPrompt: You are a helpful assistant.
    SessionTokenResponse:
      summary: A freshly minted session token
      value:
        sessionToken: >-
          eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uSWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAifQ.signature
  schemas:
    VoiceDetectionOptions:
      type: object
      description: Options for voice activity detection during user speech input.
      properties:
        endOfSpeechSensitivity:
          type: number
          description: >-
            Sensitivity for detecting end of speech, between 0 (least sensitive)
            and 1 (most sensitive).
          example: 0.5
          minimum: 0
          maximum: 1
        silenceBeforeSkipTurnSeconds:
          type: number
          description: >-
            Duration of silence (in seconds) before the current user turn is
            skipped.
          example: 5
          minimum: 0
          maximum: 900
        silenceBeforeSessionEndSeconds:
          type: number
          description: >-
            Duration of silence (in seconds) before the session is automatically
            ended.
          example: 60
          minimum: 0
          maximum: 7200
        silenceBeforeAutoEndTurnSeconds:
          type: number
          description: >-
            Duration of silence (in seconds) before the user turn is
            automatically ended.
          example: 5
          minimum: 0.5
          maximum: 10
        speechEnhancementLevel:
          type: number
          description: >-
            Level of speech enhancement to apply, 0 (no speech enhancement) 1
            (max speech enhancement)
          example: 0.8
          minimum: 0
          maximum: 1
    ElevenLabsV1VoiceGenerationOptions:
      title: ElevenLabs V1
      type: object
      description: Voice generation options for ElevenLabs V1 models.
      properties:
        stability:
          type: number
          description: >-
            Controls how stable the generated voice is between each generation,
            between 0 (more varied/higher emotional range) and 1 (more
            stable/less emotional range).
          example: 0.5
          minimum: 0
          maximum: 1
        similarityBoost:
          type: number
          description: >-
            Controls how close the generated voice is to the original speaker,
            between 0 (more varied) and 1 (more similar).
          example: 0
          minimum: 0
          maximum: 1
        speed:
          type: number
          description: >-
            Controls the speed of the spoken voice as a multiplier, between 0.7
            (slower) and 1.2 (faster).
          example: 1
          minimum: 0.7
          maximum: 1.2
    ElevenLabsV2VoiceGenerationOptions:
      title: ElevenLabs V2
      type: object
      description: Voice generation options for ElevenLabs V2 models.
      properties:
        stability:
          type: number
          description: >-
            Controls how stable the generated voice is between each generation,
            between 0 (more varied/higher emotional range) and 1 (more
            stable/less emotional range).
          example: 0.5
          minimum: 0
          maximum: 1
        similarityBoost:
          type: number
          description: >-
            Controls how close the generated voice is to the original speaker,
            between 0 (more varied) and 1 (more similar).
          example: 0.75
          minimum: 0
          maximum: 1
        style:
          type: number
          description: >-
            Amplifies the style of the original speaker, between 0 and 1, it is
            recommended to keep this value low (0) to reduce latency.
          example: 0
          minimum: 0
          maximum: 1
        useSpeakerBoost:
          type: boolean
          description: >-
            Whether to use speaker boost for the generated voice, enhancing the
            similarity to the original speaker.
          example: true
        speed:
          type: number
          description: >-
            Controls the speed of the spoken voice as a multiplier, between 0.7
            (slower) and 1.2 (faster).
          example: 1
          minimum: 0.7
          maximum: 1.2
        model:
          type: string
          description: The ElevenLabs model ID to use for voice generation.
    CartesiaSonic3VoiceGenerationOptions:
      title: Cartesia Sonic-3
      type: object
      description: Voice generation options for Cartesia Sonic-3 models.
      properties:
        volume:
          type: number
          description: >-
            Controls the volume level of the generated voice as a multiplier,
            between 0.5 (quieter) and 2.0 (louder).
          example: 1
          minimum: 0.5
          maximum: 2
        speed:
          type: number
          description: >-
            Controls the speed of the spoken voice as a multiplier, between 0.6
            (slower) and 1.5 (faster).
          example: 1
          minimum: 0.6
          maximum: 1.5
        emotion:
          type: string
          description: >-
            Sets the emotional tone of the generated voice. Supported emotions
            are: neutral, calm, angry, content, sad, scared.
          example: neutral
          oneOf:
            - type: string
              enum:
                - neutral
                - calm
                - angry
                - content
                - sad
                - scared
    FishAudioVoiceGenerationOptions:
      title: Fish Audio
      type: object
      description: Voice generation options for Fish Audio models.
      properties:
        volume:
          type: number
          description: >-
            Controls the volume level of the generated voice as a multiplier,
            between 0.5 (quieter) and 2.0 (louder).
          example: 1
          minimum: 0.5
          maximum: 2
        speed:
          type: number
          description: >-
            Controls the speed of the spoken voice as a multiplier, between 0.5
            (slower) and 2.0 (faster).
          example: 1
          minimum: 0.5
          maximum: 2
    SessionToken:
      type: object
      description: >-
        Short-lived credential used by a client to connect to a live persona.
        Valid for one hour.
      properties:
        sessionToken:
          type: string
          description: >-
            Signed JWT the client passes to the Anam SDK to open a WebRTC
            connection.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````