> ## 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.

# Cognigy TTS

> Stream synthesized speech from SLNG over the Cognigy Voice Gateway WebSocket protocol using any supported text-to-speech model and voice.



## AsyncAPI

````yaml api-reference/asyncapi/bridges-cognigy.asyncapi.yaml /v1/bridges/cognigy/tts/{model_variant}
id: /v1/bridges/cognigy/tts/{model_variant}
title: Cognigy TTS Bridge
description: >-
  Stream synthesized speech from SLNG over the Cognigy Voice Gateway WebSocket
  protocol using any supported text-to-speech model and voice.
servers:
  - id: production
    protocol: wss
    host: api.slng.ai
    bindings: []
    variables: []
  - id: staging
    protocol: wss
    host: stageapi.slng.ai
    bindings: []
    variables: []
address: /v1/bridges/cognigy/tts/{model_variant}
parameters: []
bindings:
  - protocol: ws
    version: latest
    value:
      method: GET
      headers:
        type: object
        properties:
          X-Region-Override:
            type: string
            description: Target region override. Auto-selected if not provided.
            x-parser-schema-id: <anonymous-schema-39>
          X-World-Part-Override:
            type: string
            description: Target world part override. Auto-selected if not provided.
            x-parser-schema-id: <anonymous-schema-40>
        x-parser-schema-id: WebsocketHeaders
      query:
        type: object
        properties:
          region:
            type: string
            description: >-
              Target region override as a query parameter. Auto-selected if not
              provided. Equivalent to the `X-Region-Override` header; the header
              takes precedence when both are set.
            enum:
              - ap-southeast-2
              - eu-north-1
              - us-east-1
            x-parser-schema-id: <anonymous-schema-41>
          world-part:
            type: string
            description: >-
              Target world part override as a query parameter. Auto-selected if
              not provided. Equivalent to the `X-World-Part-Override` header;
              the header takes precedence when both are set.
            enum:
              - ap
              - eu
              - na
            x-parser-schema-id: <anonymous-schema-42>
        x-parser-schema-id: WebsocketQueryParams
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
      - name: headers
        type: object
        required: false
        properties:
          - name: X-Region-Override
            type: string
            description: Target region override. Auto-selected if not provided.
            required: false
          - name: X-World-Part-Override
            type: string
            description: Target world part override. Auto-selected if not provided.
            required: false
      - name: query
        type: object
        required: false
        properties:
          - name: region
            type: string
            description: >-
              Target region override as a query parameter. Auto-selected if not
              provided. Equivalent to the `X-Region-Override` header; the header
              takes precedence when both are set.
            enumValues:
              - ap-southeast-2
              - eu-north-1
              - us-east-1
            required: false
          - name: world-part
            type: string
            description: >-
              Target world part override as a query parameter. Auto-selected if
              not provided. Equivalent to the `X-World-Part-Override` header;
              the header takes precedence when both are set.
            enumValues:
              - ap
              - eu
              - na
            required: false
operations:
  - &ref_1
    id: cognigyTtsBridgeReceiveStream
    title: Cognigy tts bridge receive stream
    description: Stream data to Cognigy TTS Bridge
    type: receive
    messages:
      - &ref_7
        id: CognigyStreamMessage
        contentType: application/json
        payload:
          - name: Stream Message
            description: Send text to synthesize into audio for Cognigy TTS.
            type: object
            properties:
              - name: type
                type: string
                description: stream
                required: true
              - name: text
                type: string
                description: Text to synthesize
                required: true
              - name: pronunciation
                type: object
                description: >-
                  Optional pronunciation hint applied to this text chunk.
                  Forwarded to providers that support pronunciation dictionaries
                  (e.g. IPA or SSML overrides).
                required: false
                properties:
                  - name: mode
                    type: string
                    description: Pronunciation override mode (e.g. `ipa`, `ssml`).
                    required: false
                  - name: name
                    type: string
                    description: >-
                      Identifier of the term whose pronunciation is being
                      overridden.
                    required: false
                  - name: dictionary_id
                    type: string
                    description: Pronunciation dictionary identifier.
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: Send text to synthesize into audio.
          required:
            - type
            - text
          properties:
            type:
              type: string
              const: stream
              x-parser-schema-id: <anonymous-schema-21>
            text:
              type: string
              description: Text to synthesize
              x-parser-schema-id: <anonymous-schema-22>
            pronunciation:
              type: object
              description: >-
                Optional pronunciation hint applied to this text chunk.
                Forwarded to providers that support pronunciation dictionaries
                (e.g. IPA or SSML overrides).
              properties:
                mode:
                  type: string
                  description: Pronunciation override mode (e.g. `ipa`, `ssml`).
                  x-parser-schema-id: <anonymous-schema-24>
                name:
                  type: string
                  description: >-
                    Identifier of the term whose pronunciation is being
                    overridden.
                  x-parser-schema-id: <anonymous-schema-25>
                dictionary_id:
                  type: string
                  description: Pronunciation dictionary identifier.
                  x-parser-schema-id: <anonymous-schema-26>
              x-parser-schema-id: <anonymous-schema-23>
          x-parser-schema-id: <anonymous-schema-20>
        title: Stream Message
        description: Send text to synthesize into audio for Cognigy TTS.
        example: |-
          {
            "type": "stream",
            "text": "Hello from Cognigy TTS bridge."
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: CognigyStreamMessage
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: /v1/bridges/cognigy/tts/{model_variant}
  - &ref_2
    id: cognigyTtsBridgeReceiveFlush
    title: Cognigy tts bridge receive flush
    description: Flush buffered output on Cognigy TTS Bridge
    type: receive
    messages:
      - &ref_8
        id: CognigyFlushMessage
        contentType: application/json
        payload:
          - name: Flush Message (Cognigy)
            description: Flush any buffered audio to the Cognigy client.
            type: object
            properties:
              - name: type
                type: string
                description: flush
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Flush any buffered audio to the client.
          required:
            - type
          properties:
            type:
              type: string
              const: flush
              x-parser-schema-id: <anonymous-schema-28>
          x-parser-schema-id: <anonymous-schema-27>
        title: Flush Message (Cognigy)
        description: Flush any buffered audio to the Cognigy client.
        example: |-
          {
            "type": "flush"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: CognigyFlushMessage
    bindings: []
    extensions: *ref_0
  - &ref_3
    id: cognigyTtsBridgeReceiveStop
    title: Cognigy tts bridge receive stop
    description: Stop session on Cognigy TTS Bridge
    type: receive
    messages:
      - &ref_9
        id: CognigyTtsStopMessage
        contentType: application/json
        payload:
          - name: Stop Message (Cognigy TTS)
            description: Stop synthesis and close the Cognigy TTS session.
            type: object
            properties:
              - name: type
                type: string
                description: stop
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Stop synthesis and close the session.
          required:
            - type
          properties:
            type:
              type: string
              const: stop
              x-parser-schema-id: <anonymous-schema-30>
          x-parser-schema-id: <anonymous-schema-29>
        title: Stop Message (Cognigy TTS)
        description: Stop synthesis and close the Cognigy TTS session.
        example: |-
          {
            "type": "stop"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: CognigyTtsStopMessage
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: cognigyTtsBridgeReceiveKeepalive
    title: Cognigy tts bridge receive keepalive
    description: Send keepalive on Cognigy TTS Bridge
    type: receive
    messages:
      - &ref_10
        id: KeepaliveMessage
        contentType: application/json
        payload:
          - name: Keepalive Message
            description: Keep the WebSocket connection alive during silence.
            type: object
            properties:
              - name: type
                type: string
                description: keepalive
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Prevents the connection from being closed due to inactivity. Send
            periodically during silence to maintain the session.
          required:
            - type
          properties:
            type:
              type: string
              const: keepalive
              x-parser-schema-id: <anonymous-schema-19>
          x-parser-schema-id: <anonymous-schema-18>
        title: Keepalive Message
        description: Keep the WebSocket connection alive during silence.
        example: |-
          {
            "type": "keepalive"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: KeepaliveMessage
    bindings: []
    extensions: *ref_0
  - &ref_5
    id: cognigyTtsBridgeSendConnect
    title: Cognigy tts bridge send connect
    description: Receive connect signal from Cognigy TTS Bridge
    type: send
    messages:
      - &ref_11
        id: CognigyConnectMessage
        contentType: application/json
        payload:
          - name: Connect Message
            description: Connection established with audio format information.
            type: object
            properties:
              - name: type
                type: string
                description: connect
                required: true
              - name: data
                type: object
                description: Audio format configuration
                required: true
                properties:
                  - name: sample_rate
                    type: integer
                    description: Audio sample rate in Hz.
                    enumValues:
                      - 8000
                      - 16000
                      - 22050
                      - 24000
                      - 32000
                      - 44100
                      - 48000
                    required: false
                  - name: base64_encoding
                    type: boolean
                    description: Whether audio chunks are base64 encoded
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: Connection established with audio format information.
          required:
            - type
            - data
          properties:
            type:
              type: string
              const: connect
              x-parser-schema-id: <anonymous-schema-32>
            data:
              type: object
              description: Audio format configuration
              properties:
                sample_rate:
                  type: integer
                  description: Audio sample rate in Hz.
                  enum:
                    - 8000
                    - 16000
                    - 22050
                    - 24000
                    - 32000
                    - 44100
                    - 48000
                  x-parser-schema-id: SampleRate
                base64_encoding:
                  type: boolean
                  description: Whether audio chunks are base64 encoded
                  x-parser-schema-id: <anonymous-schema-34>
              x-parser-schema-id: <anonymous-schema-33>
          x-parser-schema-id: <anonymous-schema-31>
        title: Connect Message
        description: Connection established with audio format information.
        example: |-
          {
            "type": "connect",
            "data": {
              "sample_rate": 16000,
              "base64_encoding": true
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: CognigyConnectMessage
    bindings: []
    extensions: *ref_0
  - &ref_6
    id: cognigyTtsBridgeSendError
    title: Cognigy tts bridge send error
    description: Receive error from Cognigy TTS Bridge
    type: send
    messages:
      - &ref_12
        id: CognigyTTSErrorResponse
        contentType: application/json
        payload:
          - name: Error Response (Cognigy TTS)
            description: Error occurred during Cognigy TTS synthesis.
            type: object
            properties:
              - name: type
                type: string
                description: error
                required: true
              - name: error
                type: string
                description: >-
                  Error code. May be omitted when the upstream provider does not
                  surface a discrete error code.
                required: false
              - name: message
                type: string
                description: Human-readable error description
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Error occurred during synthesis.
          required:
            - type
            - message
          properties:
            type:
              type: string
              const: error
              x-parser-schema-id: <anonymous-schema-36>
            error:
              type: string
              description: >-
                Error code. May be omitted when the upstream provider does not
                surface a discrete error code.
              x-parser-schema-id: <anonymous-schema-37>
            message:
              type: string
              description: Human-readable error description
              x-parser-schema-id: <anonymous-schema-38>
          x-parser-schema-id: <anonymous-schema-35>
        title: Error Response (Cognigy TTS)
        description: Error occurred during Cognigy TTS synthesis.
        example: |-
          {
            "type": "error",
            "error": "provider_error",
            "message": "TTS provider returned an error"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: CognigyTTSErrorResponse
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
  - *ref_2
  - *ref_3
  - *ref_4
receiveOperations:
  - *ref_5
  - *ref_6
sendMessages:
  - *ref_7
  - *ref_8
  - *ref_9
  - *ref_10
receiveMessages:
  - *ref_11
  - *ref_12
extensions:
  - id: x-parser-unique-object-id
    value: /v1/bridges/cognigy/tts/{model_variant}
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: []

````