Instant Voice Cloning API
Instant Voice Cloning is in beta, including HTTP streaming (POST /voices/clone/stream) and WebSocket streaming (GET /voices/clone/ws).
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). See Libraries & SDKs. Requires sarvamai ≥ 0.1.37 (Python) or ≥ 1.1.12 (TypeScript) for the Instant Voice Cloning surface.
Instant Voice Cloning can follow either path:
- Saved voice (recommended for reuse): create once with
POST /voices/create(orclient.voice_cloning.create_voice), then passvoice_idon every generate call. - Inline reference clip: send
ref_audio(optionalref_text) on each generate call — no saved voice required.
Generate speech with one of:
POST /voices/clone/voice_cloning.convert— one-shot JSON response with base64 audioPOST /voices/clone/stream/voice_cloning.convert_stream— binary audio stream as sentences become readyGET /voices/clone/ws/voice_cloning_streaming— WebSocket for incremental text and multi-turn sessions
Send exactly one of ref_audio or voice_id on each generate request. Sending both returns 400.
Base URL and authentication. See the API Reference for the current base URL and auth header. Generate a key from Key Management in the dashboard. The SDKs take the same key as api_subscription_key / apiSubscriptionKey.
What you get
How it works
Create a voice
Send a clean reference clip to POST /voices/create or client.voice_cloning.create_voice. The response returns a voice_id.
Generate speech
Call voice_cloning.convert / POST /voices/clone with text and either voice_id or ref_audio. language_code is optional — omit it to detect the language from the text, or pass it when pronunciation has to be exact. Use HTTP streaming / WebSocket for progressive audio.
Prefer the Python and TypeScript SDKs. Endpoint-level schemas and extra language snippets are on the API Reference.
Quickstart
Install the SDK (pip install "sarvamai>=0.1.37" or npm install sarvamai@1.1.12), then create a voice and synthesize:
language_code is optional. These examples omit it so the service detects Hindi from the text. Pass language_code when pronunciation has to be exact — see Supported languages.
The one-shot response contains audio / audio_b64 and request_id. See the API Reference for the complete request and response schemas.
Manage saved voices
Voices are shared with Content Studio for the same workspace.
The Starter plan (pay as you go) keeps up to 50 cloned voices across your organization, in Content Studio and the API. Pro and Enterprise plans have higher limits. On any plan, deleting a voice frees a slot. In Content Studio, only the person who created a voice, an organization owner or admin, or a workspace admin can delete it.
Limits and pricing
Generation is billed per character of text. See Pricing.
Voice cloning requires consent. Only clone a voice you have the right to use. See Commercial Licensing for the consent requirements that apply to cloned-voice audio.
Explore
Need help scoping a voice-cloning integration? Reach out on Discord.