Skip to main content

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

ItemValue
Base URLhttps://api.kitschlabs.com
Authenticationxi-api-key: <API_KEY>
MethodPOST
Endpoint/v1/voice-cloning/text-to-speech/stream
Content-Typemultipart/form-data
Default outputmp3_44100_128 (audio/mpeg)
Additional outputwav_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?

FieldLocationTypeRequiredDescription
textformstringYesText to synthesize
reference_textformstringYesExact transcript of the speech in the reference audio
reference_audioformfileYesWAV, MP3, FLAC, or OGG file
language_codeformstringNoOne of en, ko, ja, or zh
instructformstringNoNatural-language instructions for the speaking style
output_formatquerystringNomp3_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.