Migrating Voice Cloning from ElevenLabs to Sarvam

View as Markdown

Last updated: September 7, 2026

This guide covers moving cloned voices from ElevenLabs Instant Voice Cloning (IVC) to Sarvam’s Voice Cloning API. For plain text-to-speech with stock voices, start from Migrating Text-to-Speech; the base URL and auth changes below are the same.

In short: re-create each cloned voice once with POST /voices/create (one clean 10-15 second clip in, a svc-{uuid} voice ID out), then swap your synthesis call to POST /voices/clone with that voice_id. ElevenLabs returns raw audio bytes; Sarvam returns JSON with base64 audio you decode. Voice settings like stability and similarity_boost have no dial here - fidelity comes from the clip and built-in quality control.

Quick start

ElevenLabsSarvam
Base URLhttps://api.elevenlabs.iohttps://api.sarvam.ai
Auth headerxi-api-keyapi-subscription-key
Auth failure status401403 on POST /voices/clone; 401 on create/list/get/delete

Concept mapping

ElevenLabsSarvamNotes
POST /v1/voices/add (IVC create)POST /voices/createBoth take multipart form data and return a stored voice ID
POST /v1/text-to-speech/{voice_id}POST /voices/clone with voice_idSynthesis with a saved clone
-POST /voices/clone with ref_audioOne-shot cloning per request; nothing stored (no ElevenLabs analog)
files[] (many samples)file (one clip)Pick your single best 10-15 seconds
labels (language, gender, accent)language (required), gender, stylelanguage is a required BCP-47 code, e.g. hi-IN
voice_settings.speedpace
voice_settings.stability / similarity_boost / style / use_speaker_boost-No dials; fidelity comes from the clip plus built-in QC
model_id-The cloning model is fixed behind the API
output_format (mp3_44100_128)output_audio_codec + speech_sample_rateSeparate codec and sample-rate fields
remove_background_noise-Clean the clip before uploading
requires_verification-No verification step; commercial use has consent requirements

Step 1: Pick one clean reference clip

ElevenLabs IVC accepts a list of samples and improves with more; Sarvam’s POST /voices/create takes exactly one file per voice. Pick your single cleanest clip:

  • 10-15 seconds of continuous speech from the target speaker
  • Under 50 MB and 5-60 seconds (hard caps for POST /voices/create; the ref_audio limits for one-shot cloning via POST /voices/clone are stricter - 10 MB and 30 seconds)
  • Minimal background noise - there is no server-side cleanup step, so what you upload is what the clone learns from

See Prepare Reference Audio for what makes a good clip.

Step 2: Create the voice once

curl -X POST "https://api.elevenlabs.io/v1/voices/add" \
-H "xi-api-key: $ELEVENLABS_API_KEY" \
-F "name=my-cloned-voice" \
-F "files=@sample-1.mp3" \
-F "files=@sample-2.mp3"
# {"voice_id": "21m00Tcm4TlvDq8ikWAM", "requires_verification": false}

language is required and must be a BCP-47 code from the supported languages list. The response’s auto-generated transcript is stored with the voice and reused on every synthesis call, which is why ref_text is optional when generating.

SDK equivalents: client.voices.ivc.create(...) on ElevenLabs, client.voiceCloning.createVoice(...) on Sarvam’s sarvamai SDK (Python and TypeScript).

Step 3: Generate speech with the saved voice

curl -X POST "https://api.elevenlabs.io/v1/text-to-speech/$VOICE_ID?output_format=mp3_44100_128" \
-H "xi-api-key: $ELEVENLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Welcome to our platform!",
"model_id": "eleven_multilingual_v2",
"voice_settings": {
"stability": 0.5,
"similarity_boost": 0.75,
"speed": 1.0
}
}' --output speech.mp3

Two response-handling changes: Sarvam returns JSON, so decode response.audio from base64, and language_code is required on every synthesis call. Sample rates above 24000 Hz are neural-upsampled; see Choose Audio Formats.

SDK equivalent: client.voiceCloning.textToSpeech({ voiceId, text, language_code }) on Sarvam’s sarvamai SDK.

What Sarvam gives you that ElevenLabs doesn’t

  • One-shot cloning. POST /voices/clone accepts ref_audio directly - clone and synthesize in a single stateless call with nothing stored, handy for per-user or ephemeral voices.
  • Built-in quality control. enable_qc (on by default) transcribes the generation back with ASR, scores the character error rate against your text, and retries failing generations before returning anything.
  • Cross-lingual cloning in one call. Clone a voice once and synthesize across the supported languages by changing language_code - see Clone Across Languages.
  • Explicit language targeting. Every request carries a required language_code across 13 Indian languages, so pronunciation and prosody are correct by design rather than auto-detected.
  • Duration control. max_audio_duration targets a fixed output length (use it or pace, not both - sending both returns a 400).

What ElevenLabs has that Sarvam doesn’t

  • Professional Voice Cloning - a fine-tuned model tier trained on longer recordings; Sarvam cloning is instant-clip based.
  • Multiple samples per clone - Sarvam learns from one clip, so sample selection matters more.
  • remove_background_noise - clean your clip before uploading.
  • Voice sharing and library categories.
  • Streaming for cloned voices - Voice Cloning is synchronous REST only; for streaming, use stock-voice Text-to-Speech.

Errors and retries

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; see the FAQ.

Pricing and limits

Synthesis is billed per character of text against the Voice Cloning API; creating, listing, and deleting voices is not billed per character. See Pricing for the current rate. Rate limits for POST /voices/clone are Starter 10 / Pro 50 / Business 500 req/min - see Credits & Rate Limits.