SLNG. WebSocket API

TTS Open Source

Endpoint:https://api.slng.ai

Orpheus WS Stream

GET
https://api.slng.ai
/v1/tts/slng/orpheus-websocket-stream

Real-time text-to-speech synthesis using Orpheus model via WebSocket connection. Uses SLNG unified protocol with graceful degradation - same client code works across all TTS providers. Supports both unified parameters and legacy SLNG-specific parameters for backward compatibility.

Orpheus WS Streamquery Parameters

  • voice_idstring

    🔄 UNIFIED: Voice identifier. Standard parameter that works across all TTS providers. For Orpheus: maps to SLNG-hosted model voice parameter.

    Default: tara
  • regionstring · enum

    🔄 UNIFIED: Compute region for processing

    Enum values:
    us-west
    us-east
    eu-west
    Default: us-west
  • sample_rate_hzinteger · enum

    🔄 UNIFIED: Audio sample rate in Hz

    Enum values:
    8000
    16000
    24000
    48000
    Default: 24000
  • codecstring · enum

    🔄 UNIFIED: Audio codec format

    Enum values:
    pcm16
    opus
    Default: pcm16
  • voicestring

    ⚠️ LEGACY: SLNG-hosted model specific voice parameter. Use 'voice_id' for unified protocol compatibility.

  • buffer_sizeinteger

    ⚠️ LEGACY: SLNG-hosted model buffer size (words before auto-flush). Use unified 'configure' commands in protocol instead.

    Default: 10
  • temperaturenumber · min: 0 · max: 1

    ⚠️ LEGACY: SLNG-hosted model temperature (synthesis variability). Use unified TTS extension 'style' parameters in init command.

    Default: 0.6

Orpheus WS StreamHeaders

  • Authorizationstring · required

    The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

  • Upgradestring · enum · required

    Must be 'websocket' for WebSocket upgrade

    Enum values:
    websocket
  • Connectionstring · enum · required

    Must be 'Upgrade' for WebSocket upgrade

    Enum values:
    Upgrade

Orpheus WS StreamResponses

Switching Protocols - WebSocket connection established

No data returned

Kokoro WS Stream

GET
https://api.slng.ai
/v1/tts/slng/kokoro-websocket-stream

Real-time text-to-speech synthesis using Kokoro model via WebSocket connection. High-quality Japanese and English voice synthesis with emotion control.

Kokoro WS StreamHeaders

  • Authorizationstring · required

    The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

  • Upgradestring · enum · required

    Must be 'websocket' for WebSocket upgrade

    Enum values:
    websocket
  • Connectionstring · enum · required

    Must be 'Upgrade' for WebSocket upgrade

    Enum values:
    Upgrade

Kokoro WS StreamResponses

Switching Protocols - WebSocket connection established

No data returned

CosyVoice WS Stream

GET
https://api.slng.ai
/v1/tts/slng/cosyvoice-websocket-stream

Real-time text-to-speech synthesis using CosyVoice model via WebSocket connection. Advanced voice cloning and multi-speaker capabilities.

CosyVoice WS StreamHeaders

  • Authorizationstring · required

    The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

  • Upgradestring · enum · required

    Must be 'websocket' for WebSocket upgrade

    Enum values:
    websocket
  • Connectionstring · enum · required

    Must be 'Upgrade' for WebSocket upgrade

    Enum values:
    Upgrade

CosyVoice WS StreamResponses

Switching Protocols - WebSocket connection established

No data returned

Chatterbox WS Stream

GET
https://api.slng.ai
/v1/tts/slng/chatterbox-websocket-stream

Real-time text-to-speech synthesis using Chatterbox model via WebSocket connection. Uses SLNG unified protocol with graceful degradation - same client code works across all TTS providers.

Chatterbox WS StreamHeaders

  • Authorizationstring · required

    The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

  • Upgradestring · enum · required

    Must be 'websocket' for WebSocket upgrade

    Enum values:
    websocket
  • Connectionstring · enum · required

    Must be 'Upgrade' for WebSocket upgrade

    Enum values:
    Upgrade

Chatterbox WS StreamResponses

Switching Protocols - WebSocket connection established

No data returned

XTTS-V2 WS Stream

GET
https://api.slng.ai
/v1/tts/slng/xtts-websocket-stream

Real-time text-to-speech synthesis using XTTS-V2 model via WebSocket. Advanced voice cloning with multilingual support and custom speaker training.

XTTS-V2 WS Streamquery Parameters

  • modelstring

    Model variant (xtts, xtts-v2)

  • voicestring

    Speaker name or voice ID

XTTS-V2 WS StreamHeaders

  • Authorizationstring · required

    The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

XTTS-V2 WS StreamResponses

Switching Protocols

No data returned

Orpheus Indic WS Stream

GET
https://api.slng.ai
/v1/tts/slng/orpheus-indic-websocket-stream

Real-time text-to-speech synthesis for 8 Indic languages using Orpheus Indic model via WebSocket. Supports Hindi, Bengali, Tamil, Telugu, Marathi, Gujarati, Kannada, and Malayalam with native pronunciation and prosody.

Orpheus Indic WS Streamquery Parameters

  • voice_idstring · enum

    Voice identifier for Indic languages. Supports voices optimized for Hindi, Bengali, Tamil, Telugu, Marathi, Gujarati, Kannada, and Malayalam.

    Enum values:
    kanak
    divya
    arjun
    priya
    amit
    neha
    rahul
    ananya
    Default: kanak
  • languagestring · enum

    Indic language code. Supports 8 major Indian languages.

    Enum values:
    hi
    bn
    ta
    te
    mr
    gu
    kn
    ml
    Default: hi
  • regionstring · enum

    Compute region for processing

    Enum values:
    us-west
    us-east
    eu-west
    ap-south
    Default: us-west

Orpheus Indic WS StreamHeaders

  • Authorizationstring · required

    The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

  • Upgradestring · enum · required

    Must be 'websocket' for WebSocket upgrade

    Enum values:
    websocket
  • Connectionstring · enum · required

    Must be 'Upgrade' for WebSocket upgrade

    Enum values:
    Upgrade

Orpheus Indic WS StreamResponses

Switching Protocols - WebSocket connection established

No data returned

Kyutai TTS WS Stream

GET
https://api.slng.ai
/v1/tts/slng/kyutai-websocket-stream

Real-time text-to-speech synthesis using Kyutai model via WebSocket. Supports English and French with configurable buffer processing. Outputs 24kHz 16-bit PCM mono audio.

Kyutai TTS WS Streamquery Parameters

  • languagestring · enum

    Language for synthesis (English or French)

    Enum values:
    en
    fr
    Default: en
  • buffer_sizeinteger · min: 10 · max: 200

    Text buffer size in words (10-200)

    Default: 10

Kyutai TTS WS StreamHeaders

  • Authorizationstring · required

    The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

  • Upgradestring · enum · required

    Must be 'websocket' for WebSocket upgrade

    Enum values:
    websocket
  • Connectionstring · enum · required

    Must be 'Upgrade' for WebSocket upgrade

    Enum values:
    Upgrade

Kyutai TTS WS StreamResponses

Switching Protocols - WebSocket connection established

No data returned