> ## 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: Avatar Videos
  - name: Meetings
  - name: Personas
  - name: Avatars
  - name: Voices
  - name: Pronunciation Dictionaries
  - name: LLMs
  - name: Knowledge
  - name: Tools
  - name: Share Links
  - name: Engine
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, or for `expiresInSeconds`
          when set, and bound to this exact config.


          Server-side SDKs in a secure context can skip this exchange and start
          a session directly by calling `POST /v1/engine/session` with their API
          key and the same configuration in the request body.
        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
                maxSessions:
                  type: integer
                  minimum: 1
                  maximum: 100
                  description: >-
                    The most sessions the token can start. Omit it for no limit
                    (the default). Each call to `POST /v1/engine/session` with
                    the token counts, including one that fails, so set
                    `maxSessions: 1` only when your client starts the session
                    once and gets a new token to retry. The Anam JS SDK retries
                    a failed start up to 3 times by default: send `maxSessions:
                    3`, or set the SDK's `retry.maxAttempts` to 1. Reconnects
                    and ICE restarts within a session don't count. Once the
                    limit is reached, session start returns 401. If the API key
                    has its own limit, the lower of the two applies.
                  example: 1
                expiresInSeconds:
                  type: integer
                  minimum: 120
                  maximum: 3600
                  default: 3600
                  description: >-
                    How long the token can start sessions, in seconds, from 120
                    (2 minutes) to 3600 (1 hour). Omit it for one hour. The
                    token is checked only when a session starts: once it
                    expires, `POST /v1/engine/session` returns 401, but a
                    session it already started keeps running until it ends.
                    Start the session within this time, including any retries
                    your client makes.
                  example: 300
                personaConfig:
                  description: >-
                    Persona configuration. An avatar-only config (avatarId
                    without voiceId and without enableAudioPassthrough: true) is
                    only accepted together with a LiveKit, Agora or ElevenLabs
                    Agent integration `environment`; on the default Anam WebRTC
                    transport send an ephemeral config with voiceId and llmId
                    (llmId "CUSTOMER_CLIENT_V1" for a client-side LLM) or set
                    enableAudioPassthrough to true. Otherwise the request fails
                    with 400 `avatar_only_requires_integration`.
                  oneOf:
                    - type: object
                      title: Ephemeral persona
                      properties:
                        name:
                          type: string
                          example: Cara
                        avatarId:
                          type: string
                          example: 071b0286-4cce-4808-bee2-e642f1062de3
                        avatarModel:
                          type: string
                          example: cara-4
                          description: >-
                            Avatar model version. `cara-4` is pinned to a stable
                            checkpoint; `cara-4-latest` tracks the newest Cara 4
                            checkpoint and may change between sessions.
                            `cara-5-latest` is an early-access preview that
                            tracks the newest Cara 5 checkpoint; it is available
                            only to organizations that have been granted it, and
                            other organizations get 403.
                          enum:
                            - cara-3
                            - cara-4
                            - cara-4.1-express
                            - cara-4-latest
                            - cara-5-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: The user can't interrupt the greeting.
                          example: false
                        initialMessage:
                          type: string
                          nullable: true
                          description: >-
                            What the persona says first. Empty or left out, it
                            greets in its own words.
                          example: Hi there! I'm excited to chat with you today.
                        voiceDetectionOptions:
                          $ref: '#/components/schemas/VoiceDetectionOptions'
                        languageCode:
                          type: string
                          description: >-
                            Supported ISO 639 language code override (including
                            "yue" for Cantonese) for transcription, replaces
                            organisation level settings and multilingual
                            (default) mode.
                        voiceGenerationOptions:
                          description: >-
                            Configuration options for voice generation, plus an
                            optional pronunciation dictionary for this session.
                          allOf:
                            - oneOf:
                                - $ref: >-
                                    #/components/schemas/ElevenLabsV1VoiceGenerationOptions
                                - $ref: >-
                                    #/components/schemas/ElevenLabsV2VoiceGenerationOptions
                                - $ref: >-
                                    #/components/schemas/ElevenLabsV3VoiceGenerationOptions
                                - $ref: >-
                                    #/components/schemas/ElevenLabsV4VoiceGenerationOptions
                                - $ref: >-
                                    #/components/schemas/CartesiaSonic3VoiceGenerationOptions
                                - $ref: >-
                                    #/components/schemas/FishAudioVoiceGenerationOptions
                            - $ref: >-
                                #/components/schemas/SessionPronunciationDictionary
                        directorNotes:
                          type: object
                          description: >-
                            Per-session performance overrides for the avatar.
                            Only applied on Cara 4 and Cara 5 avatars
                            (avatarModel `cara-4`, `cara-4.1-express`,
                            `cara-4-latest` or `cara-5-latest`); if set on a
                            cara-3 avatar they are ignored (silently stripped)
                            and the session proceeds without them. `presetStyle`
                            is mutually exclusive with `customStylePrompt` and
                            `customIdlingStylePrompt`. These work best when the
                            selected voice matches the intended performance.
                          properties:
                            presetStyle:
                              type: string
                              enum:
                                - neutral
                                - happy
                                - warm
                                - playful
                                - supportive
                                - sad
                                - angry
                                - distressed
                              description: >-
                                Built-in performance style for the avatar to
                                follow. Mutually exclusive with
                                customStylePrompt. Works best with a voice that
                                matches the intended performance.
                              example: warm
                            customStylePrompt:
                              type: string
                              maxLength: 2000
                              description: >-
                                Free-form performance style prompt for the
                                avatar to follow while speaking. Mutually
                                exclusive with presetStyle. Works best with a
                                voice that matches the intended performance.
                              example: >-
                                Warm smile, composed, slightly amused, looking
                                directly at camera
                            expressivity:
                              type: number
                              minimum: 0
                              maximum: 1
                              description: >-
                                Controls how closely the avatar follows the
                                selected style or cue. 0 is subtle, 1 follows it
                                most strongly and can become unstable; omit the
                                field to use the default. Works best with a
                                voice that matches the intended performance.
                              example: 0.5
                            customIdlingStylePrompt:
                              type: string
                              nullable: true
                              maxLength: 2000
                              description: >-
                                Free-form performance style prompt for the
                                avatar to follow while it isn't speaking, such
                                as listening and pauses. Mutually exclusive with
                                presetStyle; omit it to use the model's default
                                idle behaviour.
                              example: >-
                                Listen attentively, nod slowly, soft relaxed
                                gaze
                        tools:
                          type: array
                          description: >-
                            Runtime tool definitions made available to the
                            persona for this session. Each item is one of a
                            client tool, a server knowledge tool, a server
                            webhook tool, or a system tool. For client and
                            webhook tools, `parameters` (and, for webhook tools,
                            `queryParameters`) is a JSON Schema object the LLM
                            fills at call time; each such object must serialize
                            to 10,000 bytes or less (UTF-8), otherwise the
                            request is rejected. Use `toolIds` instead to
                            reference tools you've pre-created via `/v1/tools`
                            (those are not subject to this inline size limit).
                          items:
                            type: object
                            required:
                              - type
                              - name
                            additionalProperties: true
                            properties:
                              type:
                                type: string
                                enum:
                                  - client
                                  - server
                                  - system
                                description: >-
                                  Tool kind. `server` tools additionally set
                                  `subtype` (`knowledge` or `webhook`).
                              subtype:
                                type: string
                                enum:
                                  - knowledge
                                  - rag
                                  - webhook
                                description: >-
                                  Required when `type` is `server`. `knowledge`
                                  searches documents in
                                  `config.documentFolderIds` (`rag` is a legacy
                                  alias for `knowledge`, kept for backwards
                                  compatibility); `webhook` calls an external
                                  URL.
                              name:
                                type: string
                                description: Unique tool name the LLM calls.
                              description:
                                type: string
                                maxLength: 1024
                              config:
                                type: object
                                description: >-
                                  Type-specific configuration for a `knowledge`
                                  server tool.
                                properties:
                                  documentFolderIds:
                                    type: array
                                    items:
                                      type: string
                                      format: uuid
                                    description: IDs of knowledge folders to search.
                                    example:
                                      - 67d27a9f-0ce1-4432-848b-8ab2b97f024b
                                  topK:
                                    type:
                                      - integer
                                      - 'null'
                                    minimum: 1
                                    maximum: 100
                                    description: >-
                                      Nested form of the flat `topK` field. The
                                      flat value is used when both are set.
                                  minScore:
                                    type:
                                      - number
                                      - 'null'
                                    minimum: 0
                                    maximum: 1
                                    description: >-
                                      Nested form of the flat `minScore` field.
                                      The flat value is used when both are set.
                                  maxContextTokens:
                                    type:
                                      - integer
                                      - 'null'
                                    minimum: 1
                                    maximum: 200000
                                    description: >-
                                      Nested form of the flat `maxContextTokens`
                                      field. The flat value is used when both
                                      are set.
                                  neighborChunks:
                                    type:
                                      - integer
                                      - 'null'
                                    minimum: 0
                                    maximum: 10
                                    description: >-
                                      Nested form of the flat `neighborChunks`
                                      field. The flat value is used when both
                                      are set.
                              documentFolderIds:
                                type: array
                                items:
                                  type: string
                                  format: uuid
                                description: >-
                                  Legacy flat form of
                                  `config.documentFolderIds`, kept for backwards
                                  compatibility. If both are set, this flat
                                  value is used.
                              topK:
                                type:
                                  - integer
                                  - 'null'
                                minimum: 1
                                maximum: 100
                                description: >-
                                  Knowledge tools only. Maximum matching chunks
                                  to retrieve. Overrides the engine default.
                                  Omit or set null to use the default. Fixed
                                  tool configuration, not an LLM argument.
                                example: 5
                              minScore:
                                type:
                                  - number
                                  - 'null'
                                minimum: 0
                                maximum: 1
                                description: >-
                                  Knowledge tools only. Minimum relevance score
                                  for retrieved chunks. Zero is valid. Omit or
                                  set null to use the default. Fixed tool
                                  configuration, not an LLM argument.
                                example: 0.5
                              maxContextTokens:
                                type:
                                  - integer
                                  - 'null'
                                minimum: 1
                                maximum: 200000
                                description: >-
                                  Knowledge tools only. Retrieved content token
                                  budget, excluding metadata and prompt
                                  formatting. Omit or set null to use the
                                  default. Fixed tool configuration, not an LLM
                                  argument.
                                example: 4000
                              neighborChunks:
                                type:
                                  - integer
                                  - 'null'
                                minimum: 0
                                maximum: 10
                                description: >-
                                  Knowledge tools only. Chunks to add after each
                                  match, plus the chunk before it, for
                                  surrounding context. 0 returns matches only.
                                  Defaults to 0 when omitted or null. Fixed tool
                                  configuration, not an LLM argument.
                                example: 0
                              parameters:
                                type: object
                                description: >-
                                  JSON Schema for the arguments the LLM provides
                                  (client and webhook tools). Must serialize to
                                  10,000 bytes or less.
                          example:
                            - type: client
                              name: open_calendar
                              description: Open the calendar UI in the client app.
                              parameters:
                                type: object
                                properties:
                                  date:
                                    type: string
                                    description: Date to jump to, in YYYY-MM-DD format.
                            - type: server
                              subtype: knowledge
                              name: search_docs
                              description: >-
                                Search the knowledge base for relevant
                                documents.
                              config:
                                documentFolderIds:
                                  - 67d27a9f-0ce1-4432-848b-8ab2b97f024b
                        toolIds:
                          type: array
                          description: >-
                            IDs of tools pre-created via `/v1/tools` to make
                            available to the persona for this session.
                          items:
                            type: string
                            format: uuid
                    - type: object
                      title: Avatar with audio passthrough
                      description: Avatar-only rendering with audio supplied by the client.
                      required:
                        - avatarId
                        - enableAudioPassthrough
                      properties:
                        avatarId:
                          type: string
                          format: uuid
                          example: 071b0286-4cce-4808-bee2-e642f1062de3
                        enableAudioPassthrough:
                          type: boolean
                          enum:
                            - true
                          description: >-
                            Must be true; the client supplies audio for the
                            avatar.
                        avatarModel:
                          type: string
                          description: >-
                            Public avatar model version. `cara-5-latest` is an
                            early-access preview that tracks the newest Cara 5
                            checkpoint; it is available only to organizations
                            that have been granted it, and other organizations
                            get 403.
                        maxSessionLengthSeconds:
                          type: number
                          description: >-
                            Ends the session after this many seconds. Plan
                            limits still apply.
                          example: 1800
                        directorNotes:
                          type: object
                          nullable: true
                          properties:
                            presetStyle:
                              type: string
                              enum:
                                - neutral
                                - happy
                                - warm
                                - playful
                                - supportive
                                - sad
                                - angry
                                - distressed
                            customStylePrompt:
                              type: string
                              maxLength: 2000
                            expressivity:
                              type: number
                              minimum: 0
                              maximum: 1
                            customIdlingStylePrompt:
                              type: string
                              nullable: true
                              maxLength: 2000
                        zeroDataRetention:
                          type: boolean
                          enum:
                            - false
                    - type: object
                      title: Saved persona
                      properties:
                        personaId:
                          type: string
                        voiceGenerationOptions:
                          description: >-
                            Only `pronunciationDictionaryId` applies to a saved
                            persona; voice settings come from the persona, and
                            any other keys are ignored.
                          allOf:
                            - $ref: >-
                                #/components/schemas/SessionPronunciationDictionary
                environment:
                  type: object
                  description: >-
                    Optional engine routing or transport integration
                    environment. The integration type may be supplied explicitly
                    or inferred from the LiveKit, Agora, or ElevenLabs Agent
                    settings.
                  properties:
                    type:
                      type: string
                      enum:
                        - normal
                        - livekit
                        - agora
                        - elevenlabs_agent
                    namespace:
                      type: string
                      minLength: 1
                      maxLength: 63
                      pattern: >-
                        ^(?:anam-engine-preview-\d+|devspace-[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)$
                    podName:
                      type: string
                    engineVersion:
                      type: string
                    livekitUrl:
                      type: string
                      description: >-
                        Must be reachable from the public internet; loopback,
                        private, link-local, reserved, documentation,
                        cluster-internal, and single-label targets are rejected
                        with HTTP 400. Use an absolute URL with an ASCII
                        hostname (punycode for international names), canonical
                        dotted-decimal IPv4, and a port from 1 to 65535 if
                        specified. Hostnames must resolve only to public
                        addresses; DNS is checked when the session starts.
                        Temporary DNS failures are service errors (5xx), not
                        invalid URL errors.
                    livekitToken:
                      type: string
                    agoraSettings:
                      type: object
                      required:
                        - appId
                        - token
                        - channel
                        - uid
                        - quality
                        - videoEncoding
                        - enableStringUids
                      properties:
                        appId:
                          type: string
                          minLength: 1
                        token:
                          type: string
                          minLength: 1
                        channel:
                          type: string
                          minLength: 1
                        uid:
                          type: string
                          minLength: 1
                        quality:
                          type: string
                        videoEncoding:
                          type: string
                        enableStringUids:
                          type: boolean
                        activityIdleTimeout:
                          type: number
                        audioSampleRate:
                          type: number
                        showAIAvatarDisclosure:
                          type: boolean
                        width:
                          type: integer
                          minimum: 1
                        height:
                          type: integer
                          minimum: 1
                      dependentRequired:
                        width:
                          - height
                        height:
                          - width
                    elevenLabsAgentSettings:
                      type: object
                      required:
                        - signedUrl
                        - agentId
                      properties:
                        signedUrl:
                          type: string
                        agentId:
                          type: string
                        conversationConfigOverride:
                          type: object
                          additionalProperties: true
                        dynamicVariables:
                          type: object
                          additionalProperties: true
                        userId:
                          type: string
                        customLlmExtraBody:
                          type: object
                          additionalProperties: true
                  oneOf:
                    - description: >-
                        Default Anam WebRTC transport with optional engine
                        routing.
                      properties:
                        type:
                          type: string
                          enum:
                            - normal
                      not:
                        anyOf:
                          - required:
                              - livekitUrl
                          - required:
                              - livekitToken
                          - required:
                              - agoraSettings
                          - required:
                              - elevenLabsAgentSettings
                    - description: LiveKit transport integration.
                      required:
                        - livekitUrl
                        - livekitToken
                      properties:
                        type:
                          type: string
                          enum:
                            - livekit
                    - description: Agora transport integration.
                      required:
                        - agoraSettings
                      properties:
                        type:
                          type: string
                          enum:
                            - agora
                    - description: ElevenLabs Agent integration.
                      required:
                        - elevenLabsAgentSettings
                      properties:
                        type:
                          type: string
                          enum:
                            - elevenlabs_agent
                sessionOptions:
                  type: object
                  properties:
                    sessionReplay:
                      type: object
                      deprecated: true
                      description: >-
                        Legacy control for both the recording and the
                        transcript. Use dataRetention instead. It can be sent
                        alongside dataRetention: enableSessionReplay false turns
                        both off, and so does an empty sessionReplay object;
                        enableSessionReplay true leaves each to dataRetention.
                      properties:
                        enableSessionReplay:
                          type: boolean
                          deprecated: true
                          description: >-
                            Record the session and store its transcript. false
                            turns off both, the same as dataRetention with
                            recording and transcripts set to false. Under Zero
                            Data Retention, sending true without dataRetention
                            returns HTTP 400; with dataRetention sent, omitted
                            settings are off and only a dataRetention setting of
                            true that this flag (false, or an empty
                            sessionReplay) does not turn off is rejected.
                          example: true
                          default: true
                    dataRetention:
                      type: object
                      additionalProperties: false
                      description: >-
                        Choose what Anam keeps after the session. Each setting
                        is independent, so you can turn off the recording and
                        keep the transcript, or the other way round. A
                        sessionReplay sent alongside it with enableSessionReplay
                        false, or with no value, turns both off. Zero Data
                        Retention sessions keep neither: an omitted setting is
                        off, and a setting of true returns HTTP 400 unless
                        sessionReplay turns both off. Not supported for LiveKit
                        or Agora sessions (HTTP 400).
                      properties:
                        recording:
                          type: boolean
                          description: >-
                            Record the session video. When false, GET
                            /v1/sessions/{id}/recording returns 404. With
                            sessionOptions.egress mode daily the recording must
                            resolve to off: set this to false, or set
                            enableSessionReplay to false or send an empty
                            sessionReplay.
                          default: true
                          example: false
                        transcripts:
                          type: boolean
                          description: >-
                            Store the conversation transcript. When false, GET
                            /v1/sessions/{id}/transcript returns
                            transcriptsEnabled false and each message reads
                            TRANSCRIPTS_DISABLED.
                          default: true
                          example: true
                    videoQuality:
                      type: string
                      enum:
                        - high
                        - auto
                      description: >-
                        'high' pins highest bitrate, 'auto' enables adaptive
                        bitrate.
                      example: high
                    showAIAvatarDisclosure:
                      type: boolean
                      description: >-
                        Show the AI avatar disclosure during the session.
                        Defaults to false; set true to opt in. Agora sessions
                        ignore this field.
                      example: true
                    region:
                      type: string
                      enum:
                        - eu
                        - us
                      description: >-
                        Requested engine region. This explicit choice is honored
                        independently of automatic geographic routing.
                    regionPolicy:
                      type: string
                      enum:
                        - preferred
                        - strict
                      default: preferred
                      description: >-
                        `preferred` allows cross-region capacity failover.
                        `strict` keeps the session in the requested region and
                        requires `region`.
                    videoWidth:
                      type: integer
                      description: >-
                        Output video frame width in pixels. Supply together with
                        `videoHeight` (both or neither). Omit to use the avatar
                        model's default. Supported pairs depend on the avatar
                        model — cara-3: `720x480`; cara-4: `1152x768`.
                        Unsupported pairs are rejected (the session is not
                        silently downgraded).
                      example: 1152
                    videoHeight:
                      type: integer
                      description: >-
                        Output video frame height in pixels. Supply together
                        with `videoWidth` (both or neither). See `videoWidth`.
                      example: 768
                    egress:
                      type: object
                      description: >
                        Set egress to an alternative egress transport mode. The
                        avatar's audio/video are published to

                        a 3rd party transport and not delivered over the native
                        webRTC channel.

                        The WebRTC peer connection still exists for signalling
                        and the data channel (interrupts, status).

                        Requires `personaConfig.enableAudioPassthrough=true`.
                        Discriminated on `mode`.
                      required:
                        - mode
                      properties:
                        mode:
                          type: string
                          enum:
                            - daily
                          description: Egress provider. Only `daily` is supported today.
                          example: daily
                        daily:
                          type: object
                          description: Required when `mode` is `daily`.
                          required:
                            - roomUrl
                          properties:
                            roomUrl:
                              type: string
                              format: uri
                              description: >-
                                Daily room URL the avatar should join as a
                                publisher.
                              example: https://your-domain.daily.co/avatar-room
                            token:
                              type: string
                              description: >-
                                Optional Daily meeting token. Omit for public
                                rooms.
                            userName:
                              type: string
                              description: >-
                                Optional display name for the avatar
                                participant. Defaults to "anam-avatar".
      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 or incompatible Zero Data Retention
            configuration. ZDR requests are rejected when the selected voice,
            LLM or STT provider does not support ZDR, compatibility cannot be
            verified, dataRetention.recording or dataRetention.transcripts is
            set to true without a sessionReplay that turns both off, or
            sessionReplay.enableSessionReplay is set to true without
            dataRetention. Omitted dataRetention settings are off for ZDR
            sessions. Region values must be `eu` or `us`, and `regionPolicy:
            strict` requires an explicit `region`. Avatar-only persona configs
            (avatarId without voiceId and without enableAudioPassthrough: true)
            are rejected with `avatar_only_requires_integration` unless a
            LiveKit, Agora or ElevenLabs Agent integration `environment` is
            supplied.
        '401':
          description: Unauthorized - Invalid or missing API key
        '403':
          description: >-
            Forbidden - API key lacks the required permission, the session
            config is not authorized for the organization, or the plan does not
            permit the requested option, including Zero Data Retention or
            session region selection.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                  message:
                    type: string
              examples:
                sessionRegionNotAvailable:
                  value:
                    error: session_region_not_available
                    message: >-
                      Session region selection is not available for this
                      organization
        '500':
          description: >-
            Server error. Note: most errors other than validation and the API
            key check below are returned as a 500, even though the error might
            be due to joining the room or related to token validation.
        '503':
          description: >-
            The API key could not be checked because of a temporary server
            problem (the key may be valid; retry after `Retry-After` seconds),
            or session storage for the strict region (`region` with
            `regionPolicy: strict`) is temporarily unavailable, so no token is
            issued (`error: session_store_unavailable`; retry later).
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying. Present when the API key could
                not be checked.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableError'
              examples:
                sessionStoreUnavailable:
                  value:
                    error: session_store_unavailable
                    message: >-
                      Session storage for this region is temporarily
                      unavailable. Try again later.
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: End-of-speech sensitivity, from 0 (least) to 1 (most sensitive).
          example: 0.5
          minimum: 0
          maximum: 1
        silenceBeforeSkipTurnSeconds:
          type: number
          description: Seconds of silence before the user’s turn is skipped.
          example: 5
          minimum: 0
          maximum: 900
        silenceBeforeSessionEndSeconds:
          type: number
          description: Seconds of silence before the session ends.
          example: 60
          minimum: 0
          maximum: 7200
        silenceBeforeAutoEndTurnSeconds:
          type: number
          description: Seconds of silence before the user’s turn ends.
          example: 5
          minimum: 0.5
          maximum: 10
        speechEnhancementLevel:
          type: number
          description: Speech enhancement, from 0 (none) to 1 (most).
          example: 0.8
          minimum: 0
          maximum: 1
        sttProvider:
          type: string
          enum:
            - anam
            - deepgram
            - cartesia_ink_2
            - inworld_stt_1
          description: >-
            Speech-to-text provider to use. Defaults to the platform default
            when unset. The deepgram provider supports only these languageCode
            values: en, es, fr, de, hi, ru, pt, ja, it, nl. The cartesia_ink_2
            provider supports only these languageCode values: en. The
            inworld_stt_1 provider supports only these languageCode values: ar,
            yue, zh, cs, da, nl, en, tl, fi, fr, de, el, hi, hu, id, it, ja, ko,
            mk, ms, fa, pl, pt, ro, ru, es, sv, th, tr, vi. The inworld_stt_1
            provider cannot be used when zeroDataRetention is true. The
            inworld_stt_1 provider processes audio only in us, so it cannot be
            used when sessionOptions.regionPolicy is "strict" with any other
            region.
          example: anam
    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:
          $ref: '#/components/schemas/ElevenLabsModelOverride'
    ElevenLabsV3VoiceGenerationOptions:
      title: ElevenLabs V3
      type: object
      additionalProperties: false
      description: >-
        Voice generation options for an eleven_v3 or eleven_v3_conversational
        voice, or for any voice whose model override is one of them. Only
        stability is supported.
      properties:
        stability:
          type: number
          description: >-
            Controls how stable the generated voice is, from 0 (more varied) to
            1 (more stable).
          example: 0.5
          minimum: 0
          maximum: 1
        model:
          $ref: '#/components/schemas/ElevenLabsModelOverride'
    ElevenLabsV4VoiceGenerationOptions:
      title: ElevenLabs V4
      type: object
      additionalProperties: false
      description: >-
        Voice generation options for an eleven_v4 or eleven_v4_turbo voice, or
        for any voice whose model override is one of them. Only stability and
        similarityBoost are supported.
      properties:
        stability:
          type: number
          description: >-
            Controls how stable the generated voice is, from 0 (more varied) to
            1 (more stable).
          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
        model:
          $ref: '#/components/schemas/ElevenLabsModelOverride'
    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
    SessionPronunciationDictionary:
      type: object
      description: Pronunciation dictionary for this session.
      properties:
        pronunciationDictionaryId:
          type: string
          format: uuid
          description: >-
            ID of a pronunciation dictionary in your organization (create and
            edit dictionaries in Lab or with the
            `/v1/pronunciation-dictionaries` endpoints). When the session
            starts, the dictionary's latest saved entries are applied: the
            persona speaks each entry's sounds-like replacement, or its IPA
            pronunciation on voices whose model reads IPA (Cartesia Sonic 3,
            ElevenLabs v3 and v4), falling back to the entry's optional
            sounds-like text on other models, while captions and transcripts
            keep the original words. For a saved persona this replaces the
            persona's dictionary for this session only; omit it to use the
            persona's dictionary, if any. An unknown, archived or
            other-organization ID fails the session when it starts with 404.
          example: 4f600129-13cf-4bfa-909a-2f4c31467f43
    SessionToken:
      type: object
      description: >-
        Short-lived credential used by a client to connect to a live persona.
        Valid for one hour, or for the `expiresInSeconds` it was created with,
        and only while that API key stays active.
      properties:
        sessionToken:
          type: string
          description: >-
            Signed JWT the client passes to the Anam SDK to open a WebRTC
            connection.
    ServiceUnavailableError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          example: Service temporarily unavailable
        message:
          type: string
          example: We could not check your API key. Please retry shortly.
    ElevenLabsModelOverride:
      type: string
      enum:
        - eleven_v4_turbo
        - eleven_v3_conversational
        - eleven_v4
        - eleven_v3
        - eleven_flash_v2_5
        - eleven_multilingual_v2
        - eleven_flash_v2
        - eleven_turbo_v2_5
      description: >-
        Replaces the voice's ElevenLabs model for generation. Must be an
        ElevenLabs model supported for voice imports. The other options must be
        valid for this model: for example, eleven_v4 accepts only stability and
        similarityBoost.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.