FAQs

View as Markdown

Common questions about the Voice Cloning API. If yours isn’t here, reach out on Discord.

Getting started

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.

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.

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.

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.

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.

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

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.

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.

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

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.

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

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.

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.

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.

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.