FAQs
Common questions about the Voice Cloning API. If yours isn’t here, reach out on Discord.
Getting started
Which host and auth header does voice cloning use?
See the API Reference for the current base URL. Send your key in the api-subscription-key header (recommended); Authorization: Bearer <key> is also accepted. Generate a key at Key Management using the same email as your Sarvam account.
Is the API synchronous or asynchronous?
Synchronous. One POST /voices/clone request carries the reference audio and the text, and the response carries the finished base64 audio. There is no job to create, upload, start, or poll.
Do I need to upload a reference clip for every call?
No. Create the voice once and pass its voice_id instead of ref_audio. You can create it over the API with POST /voices/create (the response returns the voice_id), or in Content Studio - see Creating a Clone - and copy Voice ID from the clone card under Voice Library → My voices (or Voice Cloning home). See Using a Cloned Voice. The API fetches the stored reference audio and transcript for that voice. This requires your API key to be bound to an organization. See Two ways to clone.
How do I manage my cloned voices over the API?
The voice lifecycle is fully API-manageable: POST /voices/create (one-shot create), GET /voices (list), GET /voices/{voice_id} (detail with signed audio URLs), and DELETE /voices/delete/{voice_id} (delete). On list/get, the field id is the same value you pass as voice_id when synthesizing. See Manage voices over the API.
Can I use a voice created in Content Studio with the API (and the reverse)?
Yes. Studio and the API share the same org-scoped voice library. A clone created in Content Studio is listed by GET /voices and usable as voice_id on POST /voices/clone; a voice created with POST /voices/create appears under Studio My voices and can be selected in Text to Speech and Dubbing. Your API key must be bound to that organization. See Using a Cloned Voice.
What happens if I send both ref_audio and voice_id?
What happens if I send both ref_audio and voice_id?
The API returns a 400 error - send exactly one of ref_audio or voice_id. If you intended to use a saved voice, send voice_id alone.
Reference clips
How long should my reference clip be?
10-15 seconds is the sweet spot: long enough to capture the voice’s character, short enough to keep latency low and avoid drift. The documented limits are 10 MB and 30 seconds. See Prepare Reference Audio.
Do I have to provide ref_text?
Do I have to provide ref_text?
No. When you omit it, the API transcribes the reference clip automatically before cloning. Providing the actual transcript usually improves fidelity, especially for cross-lingual cloning, and skips the transcription step. Keep it within 500 characters and aligned with the spoken content of the clip.
Can the reference clip be in a different language than the output?
Yes - that is cross-lingual cloning, and it works in any direction. The model preserves the speaker’s timbre and identity while applying the phonetics and prosody of language_code. See Clone Across Languages.
Output control
What codecs and sample rates can I get back?
output_audio_codec accepts wav (default), mp3, flac, opus, aac, linear16, mulaw, and alaw. speech_sample_rate accepts one of 8000, 16000, 22050, 24000, 32000, 44100, or 48000 Hz; when omitted the output is returned at the model’s native 24,000 Hz. With opus, an explicitly set sample rate must be one of 8000, 16000, 24000, or 48000 Hz. See Choose Audio Formats.
Is there a limit on the text length?
No hard character limit is enforced. Longer scripts are split into sentences and synthesized chunk-by-chunk by the API, then merged into one audio file, so you do not need to split them yourself. Keep in mind billing is per character, so very long inputs cost proportionally more.
Quality and errors
What does quality control (QC) do?
When enable_qc is true (the default), single-chunk generations are transcribed back with ASR, scored for character error rate against your text, and checked for prompt leaks from the reference clip. Failing generations are retried with bounded attempts before anything is returned. QC does not run for long text that is split into sentence chunks. See Use Quality Control.
Should I ever disable QC?
Only when you need the lowest possible latency, are benchmarking raw model behavior, or run your own verification downstream. For production traffic, keep it enabled - the latency cost is small relative to shipping malformed audio.
Which errors should I retry?
Retry 429, 500, 502, 503, and 504 with exponential backoff. Do not retry 400, 401, 402, 403, 404, or 422 - those indicate problems with the request, auth, or subscription that retrying will not fix. Log the request_id from any failed response; support uses it to look up the request.
How is voice cloning billed?
Per character of text, against the text_to_speech_voice_cloning API. See Pricing for the current rate. Commercial use of cloned-voice audio has consent requirements - see Commercial Licensing.