Skip to main content

Voice Cloning Streaming API

The Voice Cloning Streaming API accepts reference audio and text to synthesize in one multipart request, then returns an audio binary stream. The reference transcript is optional.

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?​

When provided, reference_text must match the reference audio exactly. If it is omitted or blank, the service automatically transcribes the reference audio.

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_textformstringNoExact transcript of the reference audio. Automatically transcribed when omitted
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. When providing 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.