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

# Soniox TTS v1

> Stream real-time speech synthesis from Soniox TTS v1 over WebSocket with low-latency incremental audio output and SLNG's unified TTS protocol.



## AsyncAPI

````yaml api-reference/asyncapi/tts-soniox.asyncapi.yaml /v1/tts/soniox/tts-rt:v1
id: /v1/tts/soniox/tts-rt:v1
title: Soniox TTS v1
description: >-
  Stream real-time speech synthesis from Soniox TTS v1 over WebSocket with
  low-latency incremental audio output 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/soniox/tts-rt:v1
parameters: []
bindings:
  - protocol: ws
    version: latest
    value:
      method: GET
      headers:
        type: object
        properties:
          X-World-Part-Override:
            type: string
            description: Override target world part. Auto-selected if not provided.
            enum:
              - na
            x-parser-schema-id: <anonymous-schema-34>
        x-parser-schema-id: WebsocketHeadersSoniox
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
      - name: headers
        type: object
        required: false
        properties:
          - name: X-World-Part-Override
            type: string
            description: Override target world part. Auto-selected if not provided.
            enumValues:
              - na
            required: false
operations:
  - &ref_1
    id: ttsSonioxTtsRtV1ReceiveConfig
    title: Tts soniox tts rt v1 receive config
    description: Initialize a TTS stream
    type: receive
    messages:
      - &ref_7
        id: SonioxTtsRtV1Config
        contentType: application/json
        payload:
          - name: Connection Config Message
            description: >-
              Initialize a TTS stream. Sent once per stream_id before any text
              frames.
            type: object
            properties:
              - name: type
                type: string
                description: >-
                  Message type discriminator. Always `init` for the connection
                  config message.
                required: true
              - name: api_key
                type: string
                description: >-
                  Soniox API key or temporary API key. Created in Soniox
                  Console. Optional on gateway routes — when provided it is
                  ignored; upstream auth is injected by the gateway.
                required: false
              - name: stream_id
                type: string
                description: >-
                  Client-generated unique stream identifier. Must be unique
                  among active streams on the same connection. Can be reused
                  only after the previous stream is terminated.
                required: true
              - name: model
                type: string
                description: TTS model to use. Example, `tts-rt-v1`.
                required: true
              - name: language
                type: string
                description: ISO 639-1 language code. Example, `en`.
                enumValues:
                  - af
                  - sq
                  - ar
                  - az
                  - eu
                  - be
                  - bn
                  - bs
                  - bg
                  - ca
                  - zh
                  - hr
                  - cs
                  - da
                  - nl
                  - en
                  - et
                  - fi
                  - fr
                  - gl
                  - de
                  - el
                  - gu
                  - he
                  - hi
                  - hu
                  - id
                  - it
                  - ja
                  - kn
                  - kk
                  - ko
                  - lv
                  - lt
                  - mk
                  - ms
                  - ml
                  - mr
                  - 'no'
                  - fa
                  - pl
                  - pt
                  - pa
                  - ro
                  - ru
                  - sr
                  - sk
                  - sl
                  - es
                  - sw
                  - sv
                  - tl
                  - ta
                  - te
                  - th
                  - tr
                  - uk
                  - ur
                  - vi
                  - cy
                required: true
              - name: voice
                type: string
                description: Voice name. Example, `Adrian`.
                required: true
              - name: audio_format
                type: string
                description: Output audio format. Example, `wav`.
                enumValues:
                  - wav
                  - mp3
                  - pcm_s16le
                  - pcm_s16be
                required: true
              - name: sample_rate
                type: integer
                description: Output sample rate in Hz. Example, `24000`.
                required: false
              - name: bitrate
                type: integer
                description: >-
                  Codec bitrate in bps. Only applicable to lossy compressed
                  formats. Example, `128000`.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Initialize a TTS stream. Sent once per stream_id before any text
            frames.
          required:
            - type
            - stream_id
            - model
            - language
            - voice
            - audio_format
          properties:
            type:
              type: string
              const: init
              description: >-
                Message type discriminator. Always `init` for the connection
                config message.
              x-parser-schema-id: <anonymous-schema-2>
            api_key:
              type: string
              description: >-
                Soniox API key or temporary API key. Created in Soniox Console.
                Optional on gateway routes — when provided it is ignored;
                upstream auth is injected by the gateway.
              x-parser-schema-id: <anonymous-schema-3>
            stream_id:
              type: string
              description: >-
                Client-generated unique stream identifier. Must be unique among
                active streams on the same connection. Can be reused only after
                the previous stream is terminated.
              x-parser-schema-id: <anonymous-schema-4>
            model:
              type: string
              default: tts-rt-v1
              description: TTS model to use. Example, `tts-rt-v1`.
              x-parser-schema-id: <anonymous-schema-5>
            language:
              type: string
              default: en
              description: ISO 639-1 language code. Example, `en`.
              enum:
                - af
                - sq
                - ar
                - az
                - eu
                - be
                - bn
                - bs
                - bg
                - ca
                - zh
                - hr
                - cs
                - da
                - nl
                - en
                - et
                - fi
                - fr
                - gl
                - de
                - el
                - gu
                - he
                - hi
                - hu
                - id
                - it
                - ja
                - kn
                - kk
                - ko
                - lv
                - lt
                - mk
                - ms
                - ml
                - mr
                - 'no'
                - fa
                - pl
                - pt
                - pa
                - ro
                - ru
                - sr
                - sk
                - sl
                - es
                - sw
                - sv
                - tl
                - ta
                - te
                - th
                - tr
                - uk
                - ur
                - vi
                - cy
              x-parser-schema-id: <anonymous-schema-6>
            voice:
              type: string
              description: Voice name. Example, `Adrian`.
              x-parser-schema-id: <anonymous-schema-7>
            audio_format:
              type: string
              enum:
                - wav
                - mp3
                - pcm_s16le
                - pcm_s16be
              description: Output audio format. Example, `wav`.
              x-parser-schema-id: <anonymous-schema-8>
            sample_rate:
              type: integer
              description: Output sample rate in Hz. Example, `24000`.
              x-parser-schema-id: <anonymous-schema-9>
            bitrate:
              type: integer
              description: >-
                Codec bitrate in bps. Only applicable to lossy compressed
                formats. Example, `128000`.
              x-parser-schema-id: <anonymous-schema-10>
          x-parser-schema-id: <anonymous-schema-1>
        title: Connection Config Message
        description: >-
          Initialize a TTS stream. Sent once per stream_id before any text
          frames.
        example: |-
          {
            "type": "init",
            "stream_id": "stream-1",
            "model": "tts-rt-v1",
            "language": "en",
            "voice": "Adrian",
            "audio_format": "wav",
            "sample_rate": 24000
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: SonioxTtsRtV1Config
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: /v1/tts/soniox/tts-rt:v1
  - &ref_2
    id: ttsSonioxTtsRtV1ReceiveTextStreaming
    title: Tts soniox tts rt v1 receive text streaming
    description: Stream text to synthesize
    type: receive
    messages:
      - &ref_8
        id: SonioxTtsRtV1TextStreaming
        contentType: application/json
        payload:
          - name: Text Streaming Message
            description: >-
              Stream text incrementally to the active stream. Set text_end true
              on the final chunk.
            type: object
            properties:
              - name: type
                type: string
                description: >-
                  Message type discriminator. Always `text` for streaming text
                  chunks.
                required: true
              - name: stream_id
                type: string
                description: >-
                  Must match the stream_id used in the connection config
                  message.
                required: true
              - name: text
                type: string
                description: >-
                  Text chunk to synthesize. Send incrementally as text is
                  generated.
                required: true
              - name: text_end
                type: boolean
                description: >-
                  Set to true on the final text chunk to signal end of input.
                  False for intermediate chunks.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Stream text incrementally to the active stream. Set text_end true on
            the final chunk.
          required:
            - type
            - stream_id
            - text
            - text_end
          properties:
            type:
              type: string
              const: text
              description: >-
                Message type discriminator. Always `text` for streaming text
                chunks.
              x-parser-schema-id: <anonymous-schema-12>
            stream_id:
              type: string
              description: Must match the stream_id used in the connection config message.
              x-parser-schema-id: <anonymous-schema-13>
            text:
              type: string
              description: >-
                Text chunk to synthesize. Send incrementally as text is
                generated.
              x-parser-schema-id: <anonymous-schema-14>
            text_end:
              type: boolean
              description: >-
                Set to true on the final text chunk to signal end of input.
                False for intermediate chunks.
              x-parser-schema-id: <anonymous-schema-15>
          x-parser-schema-id: <anonymous-schema-11>
        title: Text Streaming Message
        description: >-
          Stream text incrementally to the active stream. Set text_end true on
          the final chunk.
        example: |-
          {
            "type": "text",
            "stream_id": "stream-1",
            "text": "Hello from Soniox text-to-speech.",
            "text_end": false
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: SonioxTtsRtV1TextStreaming
    bindings: []
    extensions: *ref_0
  - &ref_3
    id: ttsSonioxTtsRtV1ReceiveCancel
    title: Tts soniox tts rt v1 receive cancel
    description: Cancel an in-flight stream
    type: receive
    messages:
      - &ref_9
        id: SonioxTtsRtV1Cancel
        contentType: application/json
        payload:
          - name: Cancel Message
            description: >-
              Cancel an in-flight stream. Server stops audio and terminates the
              stream.
            type: object
            properties:
              - name: type
                type: string
                description: >-
                  Message type discriminator. Always `clear` for the cancel
                  message.
                required: true
              - name: stream_id
                type: string
                description: Stream to cancel.
                required: true
              - name: const
                type: boolean
                required: false
              - name: description
                type: string
                description: >-
                  Must be `true` to trigger cancellation. Server will not send
                  further audio and will terminate the stream.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Cancel an in-flight stream. Server stops audio and terminates the
            stream.
          required:
            - type
            - stream_id
            - cancel
          properties:
            type:
              type: string
              const: clear
              description: >-
                Message type discriminator. Always `clear` for the cancel
                message.
              x-parser-schema-id: <anonymous-schema-17>
            stream_id:
              type: string
              description: Stream to cancel.
              x-parser-schema-id: <anonymous-schema-18>
            cancel:
              const: true
              description: >-
                Must be `true` to trigger cancellation. Server will not send
                further audio and will terminate the stream.
              x-parser-schema-id: <anonymous-schema-19>
          x-parser-schema-id: <anonymous-schema-16>
        title: Cancel Message
        description: >-
          Cancel an in-flight stream. Server stops audio and terminates the
          stream.
        example: |-
          {
            "type": "clear",
            "stream_id": "stream-1",
            "cancel": true
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: SonioxTtsRtV1Cancel
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: ttsSonioxTtsRtV1SendAudioChunk
    title: Tts soniox tts rt v1 send audio chunk
    description: Receive synthesized audio chunks
    type: send
    messages:
      - &ref_10
        id: SonioxTtsRtV1AudioChunk
        contentType: application/json
        payload:
          - name: Audio Response
            description: >-
              Audio bytes for the stream chunk. audio_end true marks the final
              audio payload (stream not yet terminated).
            type: object
            properties:
              - name: type
                type: string
                description: >-
                  Message type discriminator. Always `audio_chunk` for audio
                  response messages.
                required: true
              - name: audio
                type: string
                description: Base64-encoded audio bytes for the stream chunk.
                required: true
              - name: audio_end
                type: boolean
                description: >-
                  True on the final audio chunk. No further audio payloads will
                  follow, but the stream is not fully closed until a Terminal
                  Stream Event arrives with terminated&#58; true.
                required: true
              - name: stream_id
                type: string
                description: Identifies which stream this audio belongs to.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Audio bytes for the stream chunk. audio_end true marks the final
            audio payload (stream not yet terminated).
          required:
            - type
            - audio
            - audio_end
            - stream_id
          properties:
            type:
              type: string
              const: audio_chunk
              description: >-
                Message type discriminator. Always `audio_chunk` for audio
                response messages.
              x-parser-schema-id: <anonymous-schema-21>
            audio:
              type: string
              format: base64
              description: Base64-encoded audio bytes for the stream chunk.
              x-parser-schema-id: <anonymous-schema-22>
            audio_end:
              type: boolean
              description: >-
                True on the final audio chunk. No further audio payloads will
                follow, but the stream is not fully closed until a Terminal
                Stream Event arrives with terminated&#58; true.
              x-parser-schema-id: <anonymous-schema-23>
            stream_id:
              type: string
              description: Identifies which stream this audio belongs to.
              x-parser-schema-id: <anonymous-schema-24>
          x-parser-schema-id: <anonymous-schema-20>
        title: Audio Response
        description: >-
          Audio bytes for the stream chunk. audio_end true marks the final audio
          payload (stream not yet terminated).
        example: |-
          {
            "type": "audio_chunk",
            "audio": "UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAAAAA=",
            "audio_end": false,
            "stream_id": "stream-1"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: SonioxTtsRtV1AudioChunk
    bindings: []
    extensions: *ref_0
  - &ref_5
    id: ttsSonioxTtsRtV1SendTerminated
    title: Tts soniox tts rt v1 send terminated
    description: Receive stream termination event
    type: send
    messages:
      - &ref_11
        id: SonioxTtsRtV1Terminated
        contentType: application/json
        payload:
          - name: Terminal Stream Event
            description: >-
              Server has fully closed the stream and released resources.
              stream_id may now be reused.
            type: object
            properties:
              - name: type
                type: string
                description: >-
                  Message type discriminator. Always `terminated` for the
                  terminal stream event.
                required: true
              - name: const
                type: boolean
                required: false
              - name: description
                type: string
                description: >-
                  True signals the server has fully closed the stream and
                  released resources. Safe to reuse stream_id only after this
                  event.
                required: false
              - name: stream_id
                type: string
                description: Stream this termination event applies to.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            Server has fully closed the stream and released resources. stream_id
            may now be reused.
          required:
            - type
            - terminated
            - stream_id
          properties:
            type:
              type: string
              const: terminated
              description: >-
                Message type discriminator. Always `terminated` for the terminal
                stream event.
              x-parser-schema-id: <anonymous-schema-26>
            terminated:
              const: true
              description: >-
                True signals the server has fully closed the stream and released
                resources. Safe to reuse stream_id only after this event.
              x-parser-schema-id: <anonymous-schema-27>
            stream_id:
              type: string
              description: Stream this termination event applies to.
              x-parser-schema-id: <anonymous-schema-28>
          x-parser-schema-id: <anonymous-schema-25>
        title: Terminal Stream Event
        description: >-
          Server has fully closed the stream and released resources. stream_id
          may now be reused.
        example: |-
          {
            "type": "terminated",
            "terminated": true,
            "stream_id": "stream-1"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: SonioxTtsRtV1Terminated
    bindings: []
    extensions: *ref_0
  - &ref_6
    id: ttsSonioxTtsRtV1SendError
    title: Tts soniox tts rt v1 send error
    description: Receive stream error
    type: send
    messages:
      - &ref_12
        id: SonioxTtsRtV1Error
        contentType: application/json
        payload:
          - name: Error Response
            description: >-
              An error encountered on the stream. After an error the stream is
              typically terminated.
            type: object
            properties:
              - name: type
                type: string
                description: >-
                  Message type discriminator. Always `error` for error
                  responses.
                required: true
              - name: error_code
                type: integer
                description: >-
                  HTTP-style error code. Common values: 400, 401, 402, 408, 429,
                  500, 503.
                required: true
              - name: error_message
                type: string
                description: >-
                  Human-readable error description. Example: "Missing required
                  field: model".
                required: true
              - name: stream_id
                type: string
                description: Stream that encountered the error.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            An error encountered on the stream. After an error the stream is
            typically terminated.
          required:
            - type
            - error_code
            - error_message
            - stream_id
          properties:
            type:
              type: string
              const: error
              description: Message type discriminator. Always `error` for error responses.
              x-parser-schema-id: <anonymous-schema-30>
            error_code:
              type: integer
              description: >-
                HTTP-style error code. Common values: 400, 401, 402, 408, 429,
                500, 503.
              x-parser-schema-id: <anonymous-schema-31>
            error_message:
              type: string
              description: >-
                Human-readable error description. Example: "Missing required
                field: model".
              x-parser-schema-id: <anonymous-schema-32>
            stream_id:
              type: string
              description: Stream that encountered the error.
              x-parser-schema-id: <anonymous-schema-33>
          x-parser-schema-id: <anonymous-schema-29>
        title: Error Response
        description: >-
          An error encountered on the stream. After an error the stream is
          typically terminated.
        example: |-
          {
            "type": "error",
            "error_code": 400,
            "error_message": "Missing required field: model",
            "stream_id": "stream-1"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: SonioxTtsRtV1Error
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
  - *ref_2
  - *ref_3
receiveOperations:
  - *ref_4
  - *ref_5
  - *ref_6
sendMessages:
  - *ref_7
  - *ref_8
  - *ref_9
receiveMessages:
  - *ref_10
  - *ref_11
  - *ref_12
extensions:
  - id: x-parser-unique-object-id
    value: /v1/tts/soniox/tts-rt:v1
securitySchemes:
  - id: bearer
    name: bearer
    type: http
    scheme: bearer
    extensions: []

````