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

# Kugel 1

> Stream high-quality speech synthesis from KugelAudio Kugel 1 over WebSocket with expressiveness controls and SLNG's unified TTS protocol.



## AsyncAPI

````yaml api-reference/asyncapi/tts-kugelaudio.asyncapi.yaml /v1/tts/kugelaudio/kugel:1
id: /v1/tts/kugelaudio/kugel:1
title: Kugel 1
description: >-
  Stream high-quality speech synthesis from KugelAudio Kugel 1 over WebSocket
  with expressiveness controls and SLNG's unified TTS protocol.
servers:
  - id: production
    protocol: wss
    host: api.slng.ai
    bindings: []
    variables: []
  - id: staging
    protocol: wss
    host: stageapi.slng.ai
    bindings: []
    variables: []
address: /v1/tts/kugelaudio/kugel:1
parameters: []
bindings:
  - protocol: ws
    version: latest
    value:
      method: GET
      headers:
        type: object
        properties:
          X-World-Part-Override:
            type: string
            description: >-
              Target world part override. Auto-selected if not provided.
              Available world parts: `eu`.
            enum:
              - eu
            x-parser-schema-id: <anonymous-schema-83>
        x-parser-schema-id: WebsocketHeadersKugelAudio
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
      - name: headers
        type: object
        required: false
        properties:
          - name: X-World-Part-Override
            type: string
            description: >-
              Target world part override. Auto-selected if not provided.
              Available world parts: `eu`.
            enumValues:
              - eu
            required: false
operations:
  - &ref_1
    id: ttsKugelAudioKugel1ReceiveRequest
    title: Tts kugel audio kugel1 receive request
    description: Send TTS request to Kugel 1
    type: receive
    messages:
      - &ref_13
        id: KugelTtsRequest
        contentType: application/json
        payload:
          - name: Request
            description: Send text with synthesis parameters to KugelAudio TTS.
            type: object
            properties:
              - name: type
                type: string
                description: request
                required: true
              - name: text
                type: string
                description: Text to convert to speech
                required: true
              - name: model_id
                type: string
                description: Model selection
                enumValues:
                  - kugel-2-turbo
                  - kugel-1-turbo
                  - kugel-1
                  - kugel-2
                required: false
              - name: voice_id
                type: integer
                description: Voice identifier
                required: false
              - name: cfg_scale
                type: number
                description: >-
                  Classifier-free guidance scale. Higher values = more
                  expressive
                required: false
              - name: normalize
                type: boolean
                description: Enable text normalization
                required: false
              - name: language
                type: string
                description: ISO 639-1 language code for text normalization
                enumValues:
                  - de
                  - en
                  - fr
                  - es
                  - it
                  - pt
                  - nl
                  - pl
                  - sv
                  - da
                  - 'no'
                  - fi
                  - cs
                  - hu
                  - ro
                  - el
                  - uk
                  - bg
                  - tr
                  - vi
                  - ar
                  - hi
                  - zh
                  - ja
                  - ko
                required: false
              - name: speed
                type: number
                description: Playback speed multiplier (pitch-preserving WSOLA)
                required: false
              - name: word_timestamps
                type: boolean
                description: Enable word-level timestamp alignment
                required: false
              - name: speaker_prefix
                type: boolean
                description: Prepend internal speaker prefix for better voice consistency
                required: false
              - name: max_new_tokens
                type: integer
                description: Maximum tokens to generate
                required: false
              - name: sample_rate
                type: integer
                description: Output sample rate in Hz
                enumValues:
                  - 8000
                  - 16000
                  - 22050
                  - 24000
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Send text to convert to speech with all synthesis parameters in a
            single request message. Matches KugelAudio's native WebSocket API.
          required:
            - type
            - text
          properties:
            type:
              type: string
              const: request
              default: request
              x-parser-schema-id: <anonymous-schema-2>
            text:
              type: string
              maxLength: 10000
              description: Text to convert to speech
              x-parser-schema-id: <anonymous-schema-3>
            model_id:
              type: string
              description: Model selection
              enum:
                - kugel-2-turbo
                - kugel-1-turbo
                - kugel-1
                - kugel-2
              default: kugel-1-turbo
              x-parser-schema-id: <anonymous-schema-4>
            voice_id:
              type: integer
              description: Voice identifier
              x-parser-schema-id: <anonymous-schema-5>
            cfg_scale:
              type: number
              minimum: 0
              maximum: 10
              default: 2
              description: Classifier-free guidance scale. Higher values = more expressive
              x-parser-schema-id: <anonymous-schema-6>
            normalize:
              type: boolean
              default: true
              description: Enable text normalization
              x-parser-schema-id: <anonymous-schema-7>
            language:
              type: string
              description: ISO 639-1 language code for text normalization
              enum:
                - de
                - en
                - fr
                - es
                - it
                - pt
                - nl
                - pl
                - sv
                - da
                - 'no'
                - fi
                - cs
                - hu
                - ro
                - el
                - uk
                - bg
                - tr
                - vi
                - ar
                - hi
                - zh
                - ja
                - ko
              x-parser-schema-id: <anonymous-schema-8>
            speed:
              type: number
              minimum: 0.8
              maximum: 1.2
              default: 1
              description: Playback speed multiplier (pitch-preserving WSOLA)
              x-parser-schema-id: <anonymous-schema-9>
            word_timestamps:
              type: boolean
              default: false
              description: Enable word-level timestamp alignment
              x-parser-schema-id: <anonymous-schema-10>
            speaker_prefix:
              type: boolean
              default: true
              description: Prepend internal speaker prefix for better voice consistency
              x-parser-schema-id: <anonymous-schema-11>
            max_new_tokens:
              type: integer
              default: 2048
              minimum: 1
              maximum: 8192
              description: Maximum tokens to generate
              x-parser-schema-id: <anonymous-schema-12>
            sample_rate:
              type: integer
              description: Output sample rate in Hz
              enum:
                - 8000
                - 16000
                - 22050
                - 24000
              default: 24000
              x-parser-schema-id: <anonymous-schema-13>
          x-parser-schema-id: <anonymous-schema-1>
        title: Request
        description: Send text with synthesis parameters to KugelAudio TTS.
        example: |-
          {
            "type": "request",
            "text": "Hello from sunny Barcelona",
            "model_id": "kugel-1-turbo",
            "voice_id": 268,
            "cfg_scale": 2,
            "sample_rate": 24000
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsRequest
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: /v1/tts/kugelaudio/kugel:1
  - &ref_2
    id: ttsKugelAudioKugel1ReceiveConfig
    title: Tts kugel audio kugel1 receive config
    description: Configure streaming session on Kugel 1
    type: receive
    messages:
      - &ref_14
        id: KugelTtsConfigMessage
        contentType: application/json
        payload:
          - name: Config
            description: >-
              Configure a KugelAudio streaming TTS session before sending text
              chunks.
            type: object
            properties:
              - name: type
                type: string
                description: config
                required: true
              - name: voice_id
                type: integer
                description: Voice identifier
                required: false
              - name: model_id
                type: string
                description: Model selection
                enumValues:
                  - kugel-2-turbo
                  - kugel-1-turbo
                  - kugel-1
                  - kugel-2
                required: false
              - name: cfg_scale
                type: number
                description: >-
                  Classifier-free guidance scale. Higher values = more
                  expressive
                required: false
              - name: sample_rate
                type: integer
                description: Output sample rate in Hz
                enumValues:
                  - 8000
                  - 16000
                  - 22050
                  - 24000
                required: false
              - name: normalize
                type: boolean
                description: Enable text normalization
                required: false
              - name: language
                type: string
                description: ISO 639-1 language code for text normalization
                enumValues:
                  - de
                  - en
                  - fr
                  - es
                  - it
                  - pt
                  - nl
                  - pl
                  - sv
                  - da
                  - 'no'
                  - fi
                  - cs
                  - hu
                  - ro
                  - el
                  - uk
                  - bg
                  - tr
                  - vi
                  - ar
                  - hi
                  - zh
                  - ja
                  - ko
                required: false
              - name: word_timestamps
                type: boolean
                description: Enable word-level timestamp alignment
                required: false
              - name: flush_timeout_ms
                type: integer
                description: Milliseconds before auto-flushing buffered text
                required: false
              - name: speed
                type: number
                description: Playback speed multiplier (pitch-preserving WSOLA)
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Initial configuration message for stream input mode. Sent once at
            the start of a session to set voice, model, and synthesis parameters
            before streaming text.
          required:
            - type
          properties:
            type:
              type: string
              const: config
              default: config
              x-parser-schema-id: <anonymous-schema-15>
            voice_id:
              type: integer
              description: Voice identifier
              x-parser-schema-id: <anonymous-schema-16>
            model_id:
              type: string
              description: Model selection
              enum:
                - kugel-2-turbo
                - kugel-1-turbo
                - kugel-1
                - kugel-2
              default: kugel-1-turbo
              x-parser-schema-id: <anonymous-schema-17>
            cfg_scale:
              type: number
              minimum: 0
              maximum: 10
              default: 2
              description: Classifier-free guidance scale. Higher values = more expressive
              x-parser-schema-id: <anonymous-schema-18>
            sample_rate:
              type: integer
              description: Output sample rate in Hz
              enum:
                - 8000
                - 16000
                - 22050
                - 24000
              default: 24000
              x-parser-schema-id: <anonymous-schema-19>
            normalize:
              type: boolean
              default: true
              description: Enable text normalization
              x-parser-schema-id: <anonymous-schema-20>
            language:
              type: string
              description: ISO 639-1 language code for text normalization
              enum:
                - de
                - en
                - fr
                - es
                - it
                - pt
                - nl
                - pl
                - sv
                - da
                - 'no'
                - fi
                - cs
                - hu
                - ro
                - el
                - uk
                - bg
                - tr
                - vi
                - ar
                - hi
                - zh
                - ja
                - ko
              x-parser-schema-id: <anonymous-schema-21>
            word_timestamps:
              type: boolean
              default: false
              description: Enable word-level timestamp alignment
              x-parser-schema-id: <anonymous-schema-22>
            flush_timeout_ms:
              type: integer
              default: 500
              description: Milliseconds before auto-flushing buffered text
              x-parser-schema-id: <anonymous-schema-23>
            speed:
              type: number
              minimum: 0.8
              maximum: 1.2
              default: 1
              description: Playback speed multiplier (pitch-preserving WSOLA)
              x-parser-schema-id: <anonymous-schema-24>
          x-parser-schema-id: <anonymous-schema-14>
        title: Config
        description: >-
          Configure a KugelAudio streaming TTS session before sending text
          chunks.
        example: |-
          {
            "type": "config",
            "voice_id": 268,
            "model_id": "kugel-1-turbo",
            "cfg_scale": 2,
            "sample_rate": 24000,
            "flush_timeout_ms": 500
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsConfigMessage
    bindings: []
    extensions: *ref_0
  - &ref_3
    id: ttsKugelAudioKugel1ReceiveText
    title: Tts kugel audio kugel1 receive text
    description: Send text chunk to Kugel 1
    type: receive
    messages:
      - &ref_15
        id: KugelTtsTextMessage
        contentType: application/json
        payload:
          - name: Text Chunk
            description: Send an incremental text chunk for streaming TTS generation.
            type: object
            properties:
              - name: type
                type: string
                description: text
                required: true
              - name: text
                type: string
                description: Text chunk to buffer for synthesis
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Incremental text chunk for stream input mode. Send as tokens arrive
            from an LLM or other source. Text is buffered until flushed or
            flush_timeout_ms expires.
          required:
            - type
            - text
          properties:
            type:
              type: string
              const: text
              default: text
              x-parser-schema-id: <anonymous-schema-26>
            text:
              type: string
              description: Text chunk to buffer for synthesis
              x-parser-schema-id: <anonymous-schema-27>
          x-parser-schema-id: <anonymous-schema-25>
        title: Text Chunk
        description: Send an incremental text chunk for streaming TTS generation.
        example: |-
          {
            "type": "text",
            "text": "Hello from sunny "
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsTextMessage
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: ttsKugelAudioKugel1ReceiveFlush
    title: Tts kugel audio kugel1 receive flush
    description: Flush buffered text on Kugel 1
    type: receive
    messages:
      - &ref_16
        id: KugelTtsFlushMessage
        contentType: application/json
        payload:
          - name: Flush
            description: Force immediate generation of all buffered text.
            type: object
            properties:
              - name: type
                type: string
                description: flush
                required: true
              - name: flush
                type: boolean
                description: Flush signal
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Forces immediate generation of all buffered text without waiting for
            flush_timeout_ms.
          required:
            - type
            - flush
          properties:
            type:
              type: string
              const: flush
              default: flush
              x-parser-schema-id: <anonymous-schema-29>
            flush:
              type: boolean
              const: true
              description: Flush signal
              x-parser-schema-id: <anonymous-schema-30>
          x-parser-schema-id: <anonymous-schema-28>
        title: Flush
        description: Force immediate generation of all buffered text.
        example: |-
          {
            "type": "flush",
            "flush": true
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsFlushMessage
    bindings: []
    extensions: *ref_0
  - &ref_5
    id: ttsKugelAudioKugel1ReceiveClose
    title: Tts kugel audio kugel1 receive close
    description: Close streaming session on Kugel 1
    type: receive
    messages:
      - &ref_17
        id: KugelTtsCloseMessage
        contentType: application/json
        payload:
          - name: Close
            description: End the streaming session and flush remaining buffered text.
            type: object
            properties:
              - name: type
                type: string
                description: close
                required: true
              - name: close
                type: boolean
                description: Close signal
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Terminates the streaming session after flushing any remaining
            buffered content.
          required:
            - type
            - close
          properties:
            type:
              type: string
              const: close
              default: close
              x-parser-schema-id: <anonymous-schema-32>
            close:
              type: boolean
              const: true
              description: Close signal
              x-parser-schema-id: <anonymous-schema-33>
          x-parser-schema-id: <anonymous-schema-31>
        title: Close
        description: End the streaming session and flush remaining buffered text.
        example: |-
          {
            "type": "close",
            "close": true
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsCloseMessage
    bindings: []
    extensions: *ref_0
  - &ref_6
    id: ttsKugelAudioKugel1SendAudioChunk
    title: Tts kugel audio kugel1 send audio chunk
    description: Receive audio chunk from Kugel 1
    type: send
    messages:
      - &ref_18
        id: KugelTtsAudioChunk
        contentType: application/json
        payload:
          - name: Audio Chunk
            description: >-
              Chunk of base64-encoded PCM audio from KugelAudio with encoding
              metadata.
            type: object
            properties:
              - name: type
                type: string
                description: audio_chunk
                required: true
              - name: audio
                type: string
                description: Base64-encoded PCM16 audio data
                required: true
              - name: enc
                type: string
                description: Audio encoding format
                required: true
              - name: idx
                type: integer
                description: Chunk index (0-based)
                required: true
              - name: sr
                type: integer
                description: Sample rate in Hz
                required: true
              - name: samples
                type: integer
                description: Number of samples in this chunk
                required: true
              - name: chunk_id
                type: integer
                description: >-
                  Text chunk identifier (stream input mode). Links audio to the
                  text chunk that generated it.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Chunk of base64-encoded PCM audio from KugelAudio with encoding
            metadata.
          required:
            - type
            - audio
            - enc
            - idx
            - sr
            - samples
          properties:
            type:
              type: string
              const: audio_chunk
              default: audio_chunk
              x-parser-schema-id: <anonymous-schema-35>
            audio:
              type: string
              format: byte
              description: Base64-encoded PCM16 audio data
              x-parser-schema-id: <anonymous-schema-36>
            enc:
              type: string
              const: pcm_s16le
              description: Audio encoding format
              x-parser-schema-id: <anonymous-schema-37>
            idx:
              type: integer
              description: Chunk index (0-based)
              x-parser-schema-id: <anonymous-schema-38>
            sr:
              type: integer
              description: Sample rate in Hz
              x-parser-schema-id: <anonymous-schema-39>
            samples:
              type: integer
              description: Number of samples in this chunk
              x-parser-schema-id: <anonymous-schema-40>
            chunk_id:
              type: integer
              description: >-
                Text chunk identifier (stream input mode). Links audio to the
                text chunk that generated it.
              x-parser-schema-id: <anonymous-schema-41>
          x-parser-schema-id: <anonymous-schema-34>
        title: Audio Chunk
        description: >-
          Chunk of base64-encoded PCM audio from KugelAudio with encoding
          metadata.
        example: |-
          {
            "type": "audio_chunk",
            "audio": "UklGRiQAAABXQVZFZm10IBAAAAABAAEA...",
            "enc": "pcm_s16le",
            "idx": 0,
            "sr": 24000,
            "samples": 4800,
            "chunk_id": 0
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsAudioChunk
    bindings: []
    extensions: *ref_0
  - &ref_7
    id: ttsKugelAudioKugel1SendWordTimestamps
    title: Tts kugel audio kugel1 send word timestamps
    description: Receive word timestamps from Kugel 1
    type: send
    messages:
      - &ref_19
        id: KugelTtsWordTimestamps
        contentType: application/json
        payload:
          - name: Word Timestamps
            description: Word-level timestamp alignment data from KugelAudio.
            type: object
            properties:
              - name: type
                type: string
                description: word_timestamps
                required: true
              - name: word_timestamps
                type: array
                description: Array of word-level alignment entries
                required: true
                properties:
                  - name: word
                    type: string
                    description: The spoken word
                    required: true
                  - name: start_ms
                    type: number
                    description: Word start time in milliseconds
                    required: true
                  - name: end_ms
                    type: number
                    description: Word end time in milliseconds
                    required: true
                  - name: char_start
                    type: integer
                    description: Start character position in input text
                    required: true
                  - name: char_end
                    type: integer
                    description: End character position in input text
                    required: true
                  - name: score
                    type: number
                    description: Alignment confidence score
                    required: true
              - name: chunk_id
                type: integer
                description: >-
                  Text chunk identifier (stream input mode). Links timestamps to
                  the text chunk that generated them.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Word-level timestamp alignment data sent when word_timestamps is
            enabled.
          required:
            - type
            - word_timestamps
          properties:
            type:
              type: string
              const: word_timestamps
              default: word_timestamps
              x-parser-schema-id: <anonymous-schema-43>
            word_timestamps:
              type: array
              description: Array of word-level alignment entries
              items:
                type: object
                required:
                  - word
                  - start_ms
                  - end_ms
                  - char_start
                  - char_end
                  - score
                properties:
                  word:
                    type: string
                    description: The spoken word
                    x-parser-schema-id: <anonymous-schema-46>
                  start_ms:
                    type: number
                    description: Word start time in milliseconds
                    x-parser-schema-id: <anonymous-schema-47>
                  end_ms:
                    type: number
                    description: Word end time in milliseconds
                    x-parser-schema-id: <anonymous-schema-48>
                  char_start:
                    type: integer
                    description: Start character position in input text
                    x-parser-schema-id: <anonymous-schema-49>
                  char_end:
                    type: integer
                    description: End character position in input text
                    x-parser-schema-id: <anonymous-schema-50>
                  score:
                    type: number
                    description: Alignment confidence score
                    x-parser-schema-id: <anonymous-schema-51>
                x-parser-schema-id: <anonymous-schema-45>
              x-parser-schema-id: <anonymous-schema-44>
            chunk_id:
              type: integer
              description: >-
                Text chunk identifier (stream input mode). Links timestamps to
                the text chunk that generated them.
              x-parser-schema-id: <anonymous-schema-52>
          x-parser-schema-id: <anonymous-schema-42>
        title: Word Timestamps
        description: Word-level timestamp alignment data from KugelAudio.
        example: |-
          {
            "type": "word_timestamps",
            "word_timestamps": [
              {
                "word": "Hello",
                "start_ms": 0,
                "end_ms": 320,
                "char_start": 0,
                "char_end": 5,
                "score": 0.98
              },
              {
                "word": "world",
                "start_ms": 340,
                "end_ms": 620,
                "char_start": 6,
                "char_end": 11,
                "score": 0.95
              }
            ],
            "chunk_id": 0
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsWordTimestamps
    bindings: []
    extensions: *ref_0
  - &ref_8
    id: ttsKugelAudioKugel1SendFinal
    title: Tts kugel audio kugel1 send final
    description: Receive final response from Kugel 1
    type: send
    messages:
      - &ref_20
        id: KugelTtsFinalResponse
        contentType: application/json
        payload:
          - name: Final Response
            description: >-
              Signals generation is complete with KugelAudio performance
              statistics.
            type: object
            properties:
              - name: type
                type: string
                description: final
                required: true
              - name: final
                type: boolean
                description: Indicates generation is complete
                required: true
              - name: chunks
                type: integer
                description: Number of audio chunks generated
                required: false
              - name: total_samples
                type: integer
                description: Total audio samples generated
                required: false
              - name: dur_ms
                type: number
                description: Total audio duration in milliseconds
                required: false
              - name: gen_ms
                type: number
                description: Total generation time in milliseconds
                required: false
              - name: rtf
                type: number
                description: Real-time factor (gen_ms / dur_ms)
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Signals generation is complete with performance statistics from
            KugelAudio.
          required:
            - type
            - final
          properties:
            type:
              type: string
              const: final
              default: final
              x-parser-schema-id: <anonymous-schema-54>
            final:
              type: boolean
              const: true
              description: Indicates generation is complete
              x-parser-schema-id: <anonymous-schema-55>
            chunks:
              type: integer
              description: Number of audio chunks generated
              x-parser-schema-id: <anonymous-schema-56>
            total_samples:
              type: integer
              description: Total audio samples generated
              x-parser-schema-id: <anonymous-schema-57>
            dur_ms:
              type: number
              description: Total audio duration in milliseconds
              x-parser-schema-id: <anonymous-schema-58>
            gen_ms:
              type: number
              description: Total generation time in milliseconds
              x-parser-schema-id: <anonymous-schema-59>
            rtf:
              type: number
              description: Real-time factor (gen_ms / dur_ms)
              x-parser-schema-id: <anonymous-schema-60>
          x-parser-schema-id: <anonymous-schema-53>
        title: Final Response
        description: Signals generation is complete with KugelAudio performance statistics.
        example: |-
          {
            "type": "final",
            "final": true,
            "chunks": 10,
            "total_samples": 48000,
            "dur_ms": 2000,
            "gen_ms": 150,
            "rtf": 0.075
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsFinalResponse
    bindings: []
    extensions: *ref_0
  - &ref_9
    id: ttsKugelAudioKugel1SendGenerationStarted
    title: Tts kugel audio kugel1 send generation started
    description: Receive generation started from Kugel 1
    type: send
    messages:
      - &ref_21
        id: KugelTtsGenerationStarted
        contentType: application/json
        payload:
          - name: Generation Started
            description: Indicates buffered text has reached the generation threshold.
            type: object
            properties:
              - name: type
                type: string
                description: generation_started
                required: true
              - name: generation_started
                type: boolean
                description: Generation started signal
                required: true
              - name: chunk_id
                type: integer
                description: Text chunk identifier (0-based)
                required: true
              - name: text
                type: string
                description: The text being generated
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Sent when buffered text reaches the generation threshold and audio
            synthesis begins for a text chunk.
          required:
            - type
            - generation_started
            - chunk_id
            - text
          properties:
            type:
              type: string
              const: generation_started
              default: generation_started
              x-parser-schema-id: <anonymous-schema-62>
            generation_started:
              type: boolean
              const: true
              description: Generation started signal
              x-parser-schema-id: <anonymous-schema-63>
            chunk_id:
              type: integer
              description: Text chunk identifier (0-based)
              x-parser-schema-id: <anonymous-schema-64>
            text:
              type: string
              description: The text being generated
              x-parser-schema-id: <anonymous-schema-65>
          x-parser-schema-id: <anonymous-schema-61>
        title: Generation Started
        description: Indicates buffered text has reached the generation threshold.
        example: |-
          {
            "type": "generation_started",
            "generation_started": true,
            "chunk_id": 0,
            "text": "Hello from sunny Barcelona"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsGenerationStarted
    bindings: []
    extensions: *ref_0
  - &ref_10
    id: ttsKugelAudioKugel1SendChunkComplete
    title: Tts kugel audio kugel1 send chunk complete
    description: Receive chunk complete from Kugel 1
    type: send
    messages:
      - &ref_22
        id: KugelTtsChunkComplete
        contentType: application/json
        payload:
          - name: Chunk Complete
            description: Signals that audio generation for a text chunk is complete.
            type: object
            properties:
              - name: type
                type: string
                description: chunk_complete
                required: true
              - name: chunk_complete
                type: boolean
                description: Chunk complete signal
                required: true
              - name: chunk_id
                type: integer
                description: Text chunk identifier
                required: true
              - name: audio_seconds
                type: number
                description: Duration of audio generated for this chunk
                required: false
              - name: gen_ms
                type: number
                description: Generation time in milliseconds for this chunk
                required: false
              - name: is_final
                type: boolean
                description: Whether this is the last chunk in the session
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Sent when audio generation for an individual text chunk finishes.
            Includes performance metrics for the chunk.
          required:
            - type
            - chunk_complete
            - chunk_id
          properties:
            type:
              type: string
              const: chunk_complete
              default: chunk_complete
              x-parser-schema-id: <anonymous-schema-67>
            chunk_complete:
              type: boolean
              const: true
              description: Chunk complete signal
              x-parser-schema-id: <anonymous-schema-68>
            chunk_id:
              type: integer
              description: Text chunk identifier
              x-parser-schema-id: <anonymous-schema-69>
            audio_seconds:
              type: number
              description: Duration of audio generated for this chunk
              x-parser-schema-id: <anonymous-schema-70>
            gen_ms:
              type: number
              description: Generation time in milliseconds for this chunk
              x-parser-schema-id: <anonymous-schema-71>
            is_final:
              type: boolean
              description: Whether this is the last chunk in the session
              x-parser-schema-id: <anonymous-schema-72>
          x-parser-schema-id: <anonymous-schema-66>
        title: Chunk Complete
        description: Signals that audio generation for a text chunk is complete.
        example: |-
          {
            "type": "chunk_complete",
            "chunk_complete": true,
            "chunk_id": 0,
            "audio_seconds": 1.2,
            "gen_ms": 150,
            "is_final": false
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsChunkComplete
    bindings: []
    extensions: *ref_0
  - &ref_11
    id: ttsKugelAudioKugel1SendSessionClosed
    title: Tts kugel audio kugel1 send session closed
    description: Receive session closed from Kugel 1
    type: send
    messages:
      - &ref_23
        id: KugelTtsSessionClosed
        contentType: application/json
        payload:
          - name: Session Closed
            description: Signals the streaming session has ended with aggregate statistics.
            type: object
            properties:
              - name: type
                type: string
                description: session_closed
                required: true
              - name: session_closed
                type: boolean
                description: Session closed signal
                required: true
              - name: total_audio_seconds
                type: number
                description: Cumulative audio duration across all chunks
                required: false
              - name: total_text_chunks
                type: integer
                description: Total number of text chunks processed
                required: false
              - name: total_audio_chunks
                type: integer
                description: Total number of audio chunks generated
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Sent after all text chunks have been processed and the session is
            terminated. Contains aggregate performance statistics.
          required:
            - type
            - session_closed
          properties:
            type:
              type: string
              const: session_closed
              default: session_closed
              x-parser-schema-id: <anonymous-schema-74>
            session_closed:
              type: boolean
              const: true
              description: Session closed signal
              x-parser-schema-id: <anonymous-schema-75>
            total_audio_seconds:
              type: number
              description: Cumulative audio duration across all chunks
              x-parser-schema-id: <anonymous-schema-76>
            total_text_chunks:
              type: integer
              description: Total number of text chunks processed
              x-parser-schema-id: <anonymous-schema-77>
            total_audio_chunks:
              type: integer
              description: Total number of audio chunks generated
              x-parser-schema-id: <anonymous-schema-78>
          x-parser-schema-id: <anonymous-schema-73>
        title: Session Closed
        description: Signals the streaming session has ended with aggregate statistics.
        example: |-
          {
            "type": "session_closed",
            "session_closed": true,
            "total_audio_seconds": 5.4,
            "total_text_chunks": 3,
            "total_audio_chunks": 15
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KugelTtsSessionClosed
    bindings: []
    extensions: *ref_0
  - &ref_12
    id: ttsKugelAudioKugel1SendError
    title: Tts kugel audio kugel1 send error
    description: Receive error from Kugel 1
    type: send
    messages:
      - &ref_24
        id: TtsErrorResponse
        contentType: application/json
        payload:
          - name: Error Response
            description: Indicates an error occurred during synthesis.
            type: object
            properties:
              - name: type
                type: string
                description: error
                required: true
              - name: code
                type: string
                description: Error code.
                enumValues:
                  - auth_error
                  - config_error
                  - rate_limit
                  - provider_error
                required: true
              - name: message
                type: string
                description: Human-readable error description
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Indicates an error occurred during synthesis.
          required:
            - type
            - code
            - message
          properties:
            type:
              type: string
              const: error
              x-parser-schema-id: <anonymous-schema-80>
            code:
              type: string
              description: Error code.
              enum:
                - auth_error
                - config_error
                - rate_limit
                - provider_error
              x-parser-schema-id: <anonymous-schema-81>
            message:
              type: string
              description: Human-readable error description
              x-parser-schema-id: <anonymous-schema-82>
          x-parser-schema-id: <anonymous-schema-79>
        title: Error Response
        description: Indicates an error occurred during synthesis.
        example: |-
          {
            "type": "error",
            "code": "provider_error",
            "message": "Provider returned an unexpected error"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: TtsErrorResponse
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
  - *ref_2
  - *ref_3
  - *ref_4
  - *ref_5
receiveOperations:
  - *ref_6
  - *ref_7
  - *ref_8
  - *ref_9
  - *ref_10
  - *ref_11
  - *ref_12
sendMessages:
  - *ref_13
  - *ref_14
  - *ref_15
  - *ref_16
  - *ref_17
receiveMessages:
  - *ref_18
  - *ref_19
  - *ref_20
  - *ref_21
  - *ref_22
  - *ref_23
  - *ref_24
extensions:
  - id: x-parser-unique-object-id
    value: /v1/tts/kugelaudio/kugel:1
securitySchemes:
  - id: bearer
    name: bearer
    type: http
    description: >
      API key issued by SLNG. Pass as `Authorization: Bearer <token>` in the
      WebSocket upgrade request headers.
    scheme: bearer
    extensions: []

````