Skip to main content

Voice Cloning API

The Voice Cloning API accepts reference audio, an exact transcript of the reference audio, and text to synthesize in one multipart request, then returns audio.

API overview

ItemValue
Base URLhttps://api.kitschlabs.com
Authenticationxi-api-key: <API_KEY>
MethodPOST
Endpoint/v1/voice-cloning/text-to-speech
Content-Typemultipart/form-data
Default outputmp3_44100_128 (audio/mpeg)
Additional outputwav_24000 (audio/wav)

How do I authenticate?

Send your issued API key in the xi-api-key header. Store the real key in a server environment variable or secret management service, and do not include it in browsers, app bundles, or logs.

xi-api-key: <API_KEY>

How do I generate speech?

The reference audio must match reference_text exactly. The examples below send the reference file and text to synthesize in one request.

curl --request POST \
"https://api.kitschlabs.com/v1/voice-cloning/text-to-speech?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
speedformnumberNoSpeaking speed from 0.25 to 4
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.

How should I prepare reference audio?

  • Use a clean, speech-only clip with one speaker.
  • Avoid music, reverberation, background conversation, and strong noise.
  • Do not cut off speech at the beginning or end of the clip.
  • Choose a section that clearly contains the pronunciation and tone you need.
  • Use only your own voice or a voice you have explicit permission to use.
Use only audio you have the right to use

Do not clone another person's voice without consent or use a cloned voice for impersonation, deception, or rights infringement.

Responses and errors

A successful request returns audio binary in the selected output_format. Save the response to a file and log the x-kitsch-request-id.

StatusMeaningRecommended action
400·422Required value, transcript, or file format errorCorrect the request and reference audio
401API key is missing or invalidCheck the key and xi-api-key header
402Not enough available creditsCheck the Billing status
413Reference audio is too largeReduce it to 25 MiB or less and retry
429Account request limit exceededFollow Retry-After and apply backoff
5xxTemporary server errorRecord the request ID and retry a limited number of times