asyncapi: 3.0.0
info:
  title: SLNG Gateway API - ElevenLabs TTS
  version: 0.1.0
  description: SLNG Gateway API
  contact:
    name: SLNG Support
    url: https://slng.ai
    email: support@slng.ai
  license:
    name: Proprietary
  tags:
    - name: STT
      description: Speech-to-Text services
    - name: Unmute STT Bridge
      description: SLNG native WebSocket STT protocol bridge.
    - name: Unmute TTS Bridge
      description: SLNG native WebSocket TTS protocol bridge.
servers:
  production:
    host: api.slng.ai
    protocol: wss
    description: Production
    security:
      - $ref: "#/components/securitySchemes/bearer"
  staging:
    host: stageapi.slng.ai
    protocol: wss
    description: Staging
    security:
      - $ref: "#/components/securitySchemes/bearer"
channels:
  /v1/tts/elevenlabs/eleven:3:
    address: /v1/tts/elevenlabs/eleven:3
    title: ElevenLabs v3
    summary: ElevenLabs v3
    description: Stream premium-quality speech synthesis from ElevenLabs Eleven v3 over WebSocket using SLNG's unified TTS protocol for low-latency real-time output.
    tags:
      - name: Eleven v3
    servers:
      - $ref: "#/servers/production"
    messages:
      TtsInitRequest:
        $ref: "#/components/messages/TtsInitRequest"
      TtsTextMessage:
        $ref: "#/components/messages/TtsTextMessage"
      TtsFlushMessage:
        $ref: "#/components/messages/TtsFlushMessage"
      TtsClearMessage:
        $ref: "#/components/messages/TtsClearMessage"
      TtsCloseMessage:
        $ref: "#/components/messages/TtsCloseMessage"
      TtsReadyResponse:
        $ref: "#/components/messages/TtsReadyResponse"
      TtsAudioChunk:
        $ref: "#/components/messages/TtsAudioChunk"
      TtsFlushed:
        $ref: "#/components/messages/TtsFlushed"
      TtsCleared:
        $ref: "#/components/messages/TtsCleared"
      TtsAudioEnd:
        $ref: "#/components/messages/TtsAudioEnd"
      TtsErrorResponse:
        $ref: "#/components/messages/TtsErrorResponse"
    bindings:
      ws:
        method: GET
        headers:
          $ref: "#/components/schemas/WebsocketHeadersElevenLabsEleven3"
  /v1/tts/elevenlabs/eleven-flash:2:
    address: /v1/tts/elevenlabs/eleven-flash:2
    title: ElevenLabs Flash v2
    summary: ElevenLabs Flash v2
    description: Stream ultra-low-latency speech synthesis from ElevenLabs Flash v2 over WebSocket with industry-leading speed for real-time conversational agents.
    tags:
      - name: Eleven Flash v2
    servers:
      - $ref: "#/servers/production"
    messages:
      TtsInitRequest:
        $ref: "#/components/messages/TtsInitRequest"
      TtsTextMessage:
        $ref: "#/components/messages/TtsTextMessage"
      TtsFlushMessage:
        $ref: "#/components/messages/TtsFlushMessage"
      TtsClearMessage:
        $ref: "#/components/messages/TtsClearMessage"
      TtsCloseMessage:
        $ref: "#/components/messages/TtsCloseMessage"
      TtsReadyResponse:
        $ref: "#/components/messages/TtsReadyResponse"
      TtsAudioChunk:
        $ref: "#/components/messages/TtsAudioChunk"
      TtsFlushed:
        $ref: "#/components/messages/TtsFlushed"
      TtsCleared:
        $ref: "#/components/messages/TtsCleared"
      TtsAudioEnd:
        $ref: "#/components/messages/TtsAudioEnd"
      TtsErrorResponse:
        $ref: "#/components/messages/TtsErrorResponse"
    bindings:
      ws:
        method: GET
        headers:
          $ref: "#/components/schemas/WebsocketHeadersElevenLabsElevenFlash2"
  /v1/tts/elevenlabs/eleven-flash:2.5:
    address: /v1/tts/elevenlabs/eleven-flash:2.5
    title: ElevenLabs Flash v2.5
    summary: ElevenLabs Flash v2.5
    description: Stream ultra-low-latency multilingual speech synthesis from ElevenLabs Flash v2.5 over WebSocket for real-time conversational voice applications.
    tags:
      - name: Eleven Flash v2.5
    servers:
      - $ref: "#/servers/production"
    messages:
      TtsInitRequest:
        $ref: "#/components/messages/TtsInitRequest"
      TtsTextMessage:
        $ref: "#/components/messages/TtsTextMessage"
      TtsFlushMessage:
        $ref: "#/components/messages/TtsFlushMessage"
      TtsClearMessage:
        $ref: "#/components/messages/TtsClearMessage"
      TtsCloseMessage:
        $ref: "#/components/messages/TtsCloseMessage"
      TtsReadyResponse:
        $ref: "#/components/messages/TtsReadyResponse"
      TtsAudioChunk:
        $ref: "#/components/messages/TtsAudioChunk"
      TtsFlushed:
        $ref: "#/components/messages/TtsFlushed"
      TtsCleared:
        $ref: "#/components/messages/TtsCleared"
      TtsAudioEnd:
        $ref: "#/components/messages/TtsAudioEnd"
      TtsErrorResponse:
        $ref: "#/components/messages/TtsErrorResponse"
    bindings:
      ws:
        method: GET
        headers:
          $ref: "#/components/schemas/WebsocketHeadersElevenLabsFlash25"
  /v1/tts/elevenlabs/eleven-multilingual:2:
    address: /v1/tts/elevenlabs/eleven-multilingual:2
    title: ElevenLabs Multilingual v2
    summary: ElevenLabs Multilingual v2
    description: Stream multilingual speech synthesis from ElevenLabs Multilingual v2 over WebSocket with broad language coverage and ultra-low-latency real-time output.
    tags:
      - name: Multilingual v2
    servers:
      - $ref: "#/servers/production"
    messages:
      TtsInitRequest:
        $ref: "#/components/messages/TtsInitRequest"
      TtsTextMessage:
        $ref: "#/components/messages/TtsTextMessage"
      TtsFlushMessage:
        $ref: "#/components/messages/TtsFlushMessage"
      TtsClearMessage:
        $ref: "#/components/messages/TtsClearMessage"
      TtsCloseMessage:
        $ref: "#/components/messages/TtsCloseMessage"
      TtsReadyResponse:
        $ref: "#/components/messages/TtsReadyResponse"
      TtsAudioChunk:
        $ref: "#/components/messages/TtsAudioChunk"
      TtsFlushed:
        $ref: "#/components/messages/TtsFlushed"
      TtsCleared:
        $ref: "#/components/messages/TtsCleared"
      TtsAudioEnd:
        $ref: "#/components/messages/TtsAudioEnd"
      TtsErrorResponse:
        $ref: "#/components/messages/TtsErrorResponse"
    bindings:
      ws:
        method: GET
        headers:
          $ref: "#/components/schemas/WebsocketHeadersElevenLabsElevenMultilingual2"
operations:
  ttsEleven3ReceiveInit:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Initialize session on ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsInitRequest"
    description: Initialize session on ElevenLabs v3
    tags: []
  ttsEleven3ReceiveText:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Send text to ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsTextMessage"
    description: Send text to ElevenLabs v3
    tags: []
  ttsEleven3ReceiveFlush:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Flush buffered output on ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsFlushMessage"
    description: Flush buffered output on ElevenLabs v3
    tags: []
  ttsEleven3ReceiveClear:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Clear queued output on ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsClearMessage"
    description: Clear queued output on ElevenLabs v3
    tags: []
  ttsEleven3ReceiveClose:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Close session on ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsCloseMessage"
    description: Close session on ElevenLabs v3
    tags: []
  ttsEleven3SendReady:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Receive ready signal from ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsReadyResponse"
    description: Receive ready signal from ElevenLabs v3
    tags: []
  ttsEleven3SendAudioChunk:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Receive audio chunk from ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsAudioChunk"
    description: Receive audio chunk from ElevenLabs v3
    tags: []
  ttsEleven3SendFlushed:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Receive flushed confirmation from ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsFlushed"
    description: Receive flushed confirmation from ElevenLabs v3
    tags: []
  ttsEleven3SendCleared:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Receive cleared confirmation from ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsCleared"
    description: Receive cleared confirmation from ElevenLabs v3
    tags: []
  ttsEleven3SendAudioEnd:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Receive audio end from ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsAudioEnd"
    description: Receive audio end from ElevenLabs v3
    tags: []
  ttsEleven3SendError:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3"
    summary: Receive error from ElevenLabs v3
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven:3/messages/TtsErrorResponse"
    description: Receive error from ElevenLabs v3
    tags: []
  ttsElevenFlash2ReceiveInit:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Initialize session on ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsInitRequest"
    description: Initialize session on ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2ReceiveText:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Send text to ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsTextMessage"
    description: Send text to ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2ReceiveFlush:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Flush buffered output on ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsFlushMessage"
    description: Flush buffered output on ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2ReceiveClear:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Clear queued output on ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsClearMessage"
    description: Clear queued output on ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2ReceiveClose:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Close session on ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsCloseMessage"
    description: Close session on ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2SendReady:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Receive ready signal from ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsReadyResponse"
    description: Receive ready signal from ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2SendAudioChunk:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Receive audio chunk from ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsAudioChunk"
    description: Receive audio chunk from ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2SendFlushed:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Receive flushed confirmation from ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsFlushed"
    description: Receive flushed confirmation from ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2SendCleared:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Receive cleared confirmation from ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsCleared"
    description: Receive cleared confirmation from ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2SendAudioEnd:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Receive audio end from ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsAudioEnd"
    description: Receive audio end from ElevenLabs Flash v2
    tags: []
  ttsElevenFlash2SendError:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2"
    summary: Receive error from ElevenLabs Flash v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2/messages/TtsErrorResponse"
    description: Receive error from ElevenLabs Flash v2
    tags: []
  ttsElevenFlash25ReceiveInit:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Initialize session on ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsInitRequest"
    description: Initialize session on ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25ReceiveText:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Send text to ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsTextMessage"
    description: Send text to ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25ReceiveFlush:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Flush buffered output on ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsFlushMessage"
    description: Flush buffered output on ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25ReceiveClear:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Clear queued output on ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsClearMessage"
    description: Clear queued output on ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25ReceiveClose:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Close session on ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsCloseMessage"
    description: Close session on ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25SendReady:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Receive ready signal from ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsReadyResponse"
    description: Receive ready signal from ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25SendAudioChunk:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Receive audio chunk from ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsAudioChunk"
    description: Receive audio chunk from ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25SendFlushed:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Receive flushed confirmation from ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsFlushed"
    description: Receive flushed confirmation from ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25SendCleared:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Receive cleared confirmation from ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsCleared"
    description: Receive cleared confirmation from ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25SendAudioEnd:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Receive audio end from ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsAudioEnd"
    description: Receive audio end from ElevenLabs Flash v2.5
    tags: []
  ttsElevenFlash25SendError:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5"
    summary: Receive error from ElevenLabs Flash v2.5
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-flash:2.5/messages/TtsErrorResponse"
    description: Receive error from ElevenLabs Flash v2.5
    tags: []
  ttsElevenMultilingual2ReceiveInit:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Initialize session on ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsInitRequest"
    description: Initialize session on ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2ReceiveText:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Send text to ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsTextMessage"
    description: Send text to ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2ReceiveFlush:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Flush buffered output on ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsFlushMessage"
    description: Flush buffered output on ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2ReceiveClear:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Clear queued output on ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsClearMessage"
    description: Clear queued output on ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2ReceiveClose:
    action: receive
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Close session on ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsCloseMessage"
    description: Close session on ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2SendReady:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Receive ready signal from ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsReadyResponse"
    description: Receive ready signal from ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2SendAudioChunk:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Receive audio chunk from ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsAudioChunk"
    description: Receive audio chunk from ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2SendFlushed:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Receive flushed confirmation from ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsFlushed"
    description: Receive flushed confirmation from ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2SendCleared:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Receive cleared confirmation from ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsCleared"
    description: Receive cleared confirmation from ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2SendAudioEnd:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Receive audio end from ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsAudioEnd"
    description: Receive audio end from ElevenLabs Multilingual v2
    tags: []
  ttsElevenMultilingual2SendError:
    action: send
    channel:
      $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2"
    summary: Receive error from ElevenLabs Multilingual v2
    messages:
      - $ref: "#/channels/~1v1~1tts~1elevenlabs~1eleven-multilingual:2/messages/TtsErrorResponse"
    description: Receive error from ElevenLabs Multilingual v2
    tags: []
components:
  schemas:
    WebsocketHeadersElevenLabsEleven3:
      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
    WebsocketHeadersElevenLabsElevenFlash2:
      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
    WebsocketHeadersElevenLabsElevenMultilingual2:
      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
    WebsocketHeadersElevenLabsFlash25:
      type: object
      properties:
        X-World-Part-Override:
          type: string
          description: "Target world part override. Auto-selected if not provided. Available world parts: `eu`, `ap`."
          enum:
            - eu
            - ap
    ElevenLabsLanguage:
      type: string
      description: ISO 639-1 language code. Supported by multilingual models.
      enum:
        - ar
        - cs
        - de
        - en
        - es
        - fil
        - fr
        - hi
        - it
        - ja
        - nl
        - pl
        - pt
        - ro
        - sk
        - sv
        - tr
        - zh
      default: en
    SampleRate:
      type: integer
      description: Audio sample rate in Hz.
      enum:
        - 8000
        - 16000
        - 22050
        - 24000
        - 32000
        - 44100
        - 48000
  messages:
    TtsErrorResponse:
      name: TtsErrorResponse
      title: Error Response
      summary: Indicates an error occurred during synthesis.
      contentType: application/json
      payload:
        type: object
        description: Indicates an error occurred during synthesis.
        required:
          - type
          - code
          - message
        properties:
          type:
            type: string
            const: error
          code:
            type: string
            description: Error code.
            enum:
              - auth_error
              - config_error
              - rate_limit
              - provider_error
          message:
            type: string
            description: Human-readable error description
      examples:
        - name: ttsError
          summary: TTS error response
          payload:
            type: error
            code: provider_error
            message: Provider returned an unexpected error
    TtsAudioEnd:
      name: TtsAudioEnd
      title: Audio End
      summary: Signals the end of audio generation.
      contentType: application/json
      payload:
        type: object
        description: Signals the end of audio generation. Emitted after flush or close when the upstream provider marks the stream as final.
        required:
          - type
        properties:
          type:
            type: string
            const: audio_end
          data:
            type: string
            description: Always null on audio_end. Present for shape parity with audio_chunk.
      examples:
        - name: audioEnd
          summary: Audio generation complete
          payload:
            type: audio_end
            data: null
    TtsCleared:
      name: TtsCleared
      title: Cleared
      summary: Acknowledges that queued output was cleared.
      contentType: application/json
      payload:
        type: object
        description: Acknowledges that queued output was cleared.
        required:
          - type
        properties:
          type:
            type: string
            const: cleared
      examples:
        - name: cleared
          summary: Clear acknowledged
          payload:
            type: cleared
    TtsFlushed:
      name: TtsFlushed
      title: Flushed
      summary: Acknowledges that buffered output was flushed.
      contentType: application/json
      payload:
        type: object
        description: Acknowledges that buffered output was flushed.
        required:
          - type
        properties:
          type:
            type: string
            const: flushed
      examples:
        - name: flushed
          summary: Flush acknowledged
          payload:
            type: flushed
    TtsAudioChunk:
      name: TtsAudioChunk
      title: Audio Chunk
      summary: Chunk of base64-encoded audio data.
      contentType: application/json
      payload:
        type: object
        description: Chunk of base64-encoded audio data.
        required:
          - type
          - data
        properties:
          type:
            type: string
            const: audio_chunk
          data:
            type: string
            format: byte
            description: Base64-encoded audio data
          sequence:
            type: integer
            description: Sequence number for ordering chunks
      examples:
        - name: audioChunk
          summary: Receive audio chunk
          payload:
            type: audio_chunk
            data: UklGRiQAAABXQVZFZm10IBAAAAABAAEA...
            sequence: 1
    TtsReadyResponse:
      name: TtsReadyResponse
      title: Ready Response
      summary: Indicates the session is ready to receive messages.
      contentType: application/json
      payload:
        type: object
        description: Indicates the session is ready to receive messages.
        required:
          - type
          - session_id
        properties:
          type:
            type: string
            const: ready
          session_id:
            type: string
            description: Unique session identifier
      examples:
        - name: ready
          summary: TTS session ready
          payload:
            type: ready
            session_id: sess_tts_abc123
    TtsCloseMessage:
      name: TtsCloseMessage
      title: Close Message
      summary: Close the session and stop any further audio.
      contentType: application/json
      payload:
        type: object
        description: Close the session and stop any further audio.
        required:
          - type
        properties:
          type:
            type: string
            const: close
      examples:
        - name: close
          summary: Close the session
          payload:
            type: close
    TtsClearMessage:
      name: TtsClearMessage
      title: Clear Message
      summary: Clear any queued text/audio from the current session.
      contentType: application/json
      payload:
        type: object
        description: Clear any queued text/audio from the current session.
        required:
          - type
        properties:
          type:
            type: string
            const: clear
      examples:
        - name: clear
          summary: Clear queued text/audio
          payload:
            type: clear
    TtsFlushMessage:
      name: TtsFlushMessage
      title: Flush Message
      summary: Force any buffered text/audio to be finalized and delivered.
      contentType: application/json
      payload:
        type: object
        description: Force any buffered text/audio to be finalized and delivered.
        required:
          - type
        properties:
          type:
            type: string
            const: flush
      examples:
        - name: flush
          summary: Flush buffered audio
          payload:
            type: flush
    TtsTextMessage:
      name: TtsTextMessage
      title: Text Message
      summary: Send text to synthesize into audio output.
      contentType: application/json
      payload:
        type: object
        description: Send text to synthesize into audio output.
        required:
          - type
          - text
        properties:
          type:
            type: string
            const: text
          text:
            type: string
            description: Text to synthesize
          flush:
            type: boolean
            description: Whether to flush remaining audio immediately after this text
      examples:
        - name: textMessage
          summary: Send text to synthesize
          payload:
            type: text
            text: Hello, this is a test of text-to-speech synthesis.
    TtsInitRequest:
      name: TtsInitRequest
      title: Init Request
      summary: Initialize a TTS session with voice and synthesis configuration.
      contentType: application/json
      payload:
        type: object
        description: Initialize a session with voice and synthesis configuration before sending text. The model is determined by the channel URL.
        required:
          - type
        properties:
          type:
            type: string
            const: init
            default: init
          voice:
            type: string
            description: Voice identifier
          config:
            type: object
            description: Synthesis configuration options
            properties:
              sample_rate:
                $ref: "#/components/schemas/SampleRate"
              encoding:
                type: string
                description: Audio encoding format
                enum:
                  - linear16
                  - mp3
                  - opus
              language:
                $ref: "#/components/schemas/ElevenLabsLanguage"
              speed:
                type: number
                description: Speech speed multiplier (e.g., 1.0 for normal)
              enable_logging:
                type: boolean
                description: Enable request logging. Set false for zero retention mode (enterprise only).
                default: true
              enable_ssml_parsing:
                type: boolean
                description: Enable SSML parsing for websocket synthesis.
                default: false
              inactivity_timeout:
                type: integer
                minimum: 1
                maximum: 180
                description: Websocket inactivity timeout in seconds.
                default: 20
              sync_alignment:
                type: boolean
                description: Include alignment data with each websocket audio chunk.
                default: false
              auto_mode:
                type: boolean
                description: Reduce latency by disabling chunk schedule and buffers.
                default: false
              chunk_length_schedule:
                type: array
                description: Websocket shorthand for generation_config.chunk_length_schedule.
                items:
                  type: integer
                  minimum: 1
      examples:
        - name: ttsInit
          summary: Initialize TTS session
          payload:
            type: init
            voice: pNInz6obpgDQGcFmaJgB
            config:
              sample_rate: 24000
              encoding: mp3
              auto_mode: false
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: |
        API key issued by SLNG. Pass as `Authorization: Bearer <token>` in the WebSocket upgrade request headers.
