Voice Cloning Streaming API
The Voice Cloning Streaming API accepts reference audio, its exact transcript, and text to synthesize in one multipart request, then returns an audio binary stream.
API overview
| Item | Value |
|---|---|
| Base URL | https://api.kitschlabs.com |
| Authentication | xi-api-key: <API_KEY> |
| Method | POST |
| Endpoint | /v1/voice-cloning/text-to-speech/stream |
| Content-Type | multipart/form-data |
| Default output | mp3_44100_128 (audio/mpeg) |
| Additional output | wav_24000 (audio/wav) |
How do I generate speech?
The reference audio must match reference_text exactly.
curl --request POST \
"https://api.kitschlabs.com/v1/voice-cloning/text-to-speech/stream?output_format=wav_24000" \
--header "xi-api-key: <API_KEY>" \
--form "text=This is the text to synthesize." \
--form "reference_text=This is the exact reference transcript." \
--form "reference_audio=@reference.wav" \
--form "language_code=en" \
--output speech.wav
Which fields do I send?
| Field | Location | Type | Required | Description |
|---|---|---|---|---|
text | form | string | Yes | Text to synthesize |
reference_text | form | string | Yes | Exact transcript of the speech in the reference audio |
reference_audio | form | file | Yes | WAV, MP3, FLAC, or OGG file |
language_code | form | string | No | One of en, ko, ja, or zh |
instruct | form | string | No | Natural-language instructions for the speaking style |
output_format | query | string | No | mp3_44100_128 or wav_24000 |
Reference audio can be up to 25 MiB and 20 seconds. In reference_text, include
only the words that can be heard. Do not include timestamps, speaker names,
subtitle markers, or translations.
A successful request returns audio binary in the selected output_format. See
the Voice Cloning API for required values,
reference audio guidance, and error handling.