Speech
Streaming text to speech
Convert text to speech with real-time streaming audio delivery.
Key Features:
- Low-latency audio streaming - playback can start immediately as chunks arrive
- Automatic language detection
- Multiple format support: MP3 or PCM/WAV
- High-quality audio: 24kHz sample rate, 16-bit mono
Request Body:
text: Input text to convert to speech - requiredlanguage: Language code (default: “auto”) - “auto” for automatic detection, or one of the supported ISO 639-1 codes: en, zh, hi, es, ar, bn, pt, ru, ja, pa, de, ko, fr, tr, it, th, pl, nl, id, vi, ur, ukformat: Audio format (default: “mp3”) - “mp3” for compressed MPEG audio (96 kbps) or “pcm” for uncompressed WAVvoice: Optional public voice ID from model discovery; otherwise the resolved language selects its configured default. The example assumes an operator-configuredmeetkai:speechmodel exposingsophia; use IDs advertised by your deploymentmodel: TTS model identifier (default: “auto”) - “auto” selects the default provider; a registry-resolvable id dispatches to the matching provider (note: not all providers supportformat: "mp3")
Response:
- Streams audio chunks in real-time
- Returns
X-Language-Codeheader with detected/used language - Content-Type:
audio/mpeg(MP3) oraudio/wav(PCM) - When
storeistrue, returns theX-Tts-Idheader with the id the history record will be stored under; persistence is best-effort and completes shortly after the stream ends
Use Cases:
- Real-time applications requiring immediate audio playback
- Interactive voice responses
- Low-latency text-to-speech scenarios
POST
CSharp (SDK)
Authorizations
Body
application/json
Request parameters for streaming text-to-speech conversion with language selection and format options.
Input text to convert to speech
Minimum string length:
1Language code: 'auto' for automatic detection, or ISO 639-1 language codes. With 'auto', text confidently detected as a language without a voice is rejected with a 400 naming it.
Available options:
auto, en, zh, hi, es, ar, bn, pt, ru, ja, pa, de, ko, fr, tr, it, th, pl, nl, id, vi, ur, uk Response
Streaming audio in MP3 or PCM/WAV format with language code header
MP3 audio stream (when format=mp3): 24kHz sample rate, 96 kbps bitrate, 16-bit, mono
CSharp (SDK)