Skip to navigation

FAQs

Beta
View as Markdown

Common questions about the Instant Voice Cloning API (beta). 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. The Python and TypeScript SDKs take the same key as api_subscription_key / apiSubscriptionKey.

Yes. Use the official sarvamai Python and TypeScript SDKs — the same client shape as Bulbul Text-to-Speech: voice_cloning.convert / convert_stream, plus voice_cloning_streaming for WebSocket, and create_voice / list / get / delete for the voice library. Requires sarvamai ≥ 0.1.37 (or TypeScript 1.1.12). See Libraries & SDKs and the API overview.

Synchronous. You can either create a saved voice with POST /voices/create (or client.voice_cloning.create_voice) and pass voice_id, or upload ref_audio on each generate call. Neither create nor one-shot generate requires polling. HTTP stream and WebSocket return audio progressively as sentences are synthesized.

No, if you save the voice first. Upload the clip once to POST /voices/create, then pass the returned voice_id to POST /voices/clone, POST /voices/clone/stream, or the WebSocket config. You can also send ref_audio (and optional ref_text) on each generate call when you do not want a saved voice — send exactly one of ref_audio or voice_id.

Use POST /voices/create to create, GET /voices to list, GET /voices/{voice_id} to inspect, and DELETE /voices/delete/{voice_id} to delete. See Manage saved voices.

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.

Yes. Send ref_audio as a multipart file (optional ref_text), or pass a saved voice_id. Exactly one is required — sending both returns 400. The same choice applies to POST /voices/clone/stream and the WebSocket config (ref_audio as base64). Inline generate clips are limited to 10 MB and 15 seconds; create accepts up to 50 MB.

Use POST /voices/clone/stream (client.voice_cloning.convert_stream) for a single binary HTTP stream, or GET /voices/clone/ws (client.voice_cloning_streaming) for a persistent WebSocket. See HTTP Streaming and WebSocket Streaming.

Reference clips

Use 10-15 seconds of clean, single-speaker audio. POST /voices/create accepts files up to 50 MB. Inline ref_audio on generate endpoints is capped at 10 MB and 15 seconds. See Prepare Reference Audio.

The model copies the performance of the reference, not only the voice. A slow, monotone read produces a slow, monotone clone. A quick, emotional read produces a quick, emotional one. Keep pace and emotion consistent through the clip. A take that jumps between styles leads to more varied output between generations. See The clone copies the performance.

No. POST /voices/create transcribes the reference clip automatically and stores the transcript with the voice. On generate with ref_audio, ref_text is optional — omit it to let the API transcribe the clip for that request.

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

On POST /voices/clone, output_audio_codec accepts wav (default), mp3, flac, opus, aac, linear16, mulaw, and alaw. On the streaming endpoints (/voices/clone/stream and /voices/clone/ws), only mp3 (default), wav, linear16, mulaw, and alaw are accepted — flac, aac, and opus cannot be concatenated across sentences. 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 on the one-shot endpoint, an explicitly set sample rate must be one of 8000, 16000, 24000, or 48000 Hz. See Choose Audio Formats.

Yes. POST /voices/clone and POST /voices/clone/stream accept up to 1000 characters of text per request. On the WebSocket, each text message accepts up to 2500 characters. Split longer scripts into multiple requests or messages.

Quality and errors

When enable_qc is true on POST /voices/clone, 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, and it is not available on the streaming endpoints. 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.