Voice cloning via API: what it can do and where it stops
Not long ago, reading a text in your own voice sounded like fantasy. Today it is one line in an API call: you upload a short clip of clean speech, attach its transcript, and you get a voice model that can read anything you write. But the magic has a price, and not only in money: there are plan quotas, physical quality limits, and legal obligations toward the person whose voice you clone. Let's walk through cloning honestly - with code examples and no promises the technology cannot keep.
What voice cloning actually is
Start with the terms, because that is where most of the confusion lives. In speech synthesis there are three very different things, and people mix them up constantly. Preset voices are a library of pre-built models: Voice kit API ships 29 of them, they work on every plan, and they are the default, model=standard. Think of it as picking a font: you choose a ready one, you do not make your own.
Voice cloning creates a brand-new voice model from your audio. You provide a reference clip, and the system builds a voice that sounds like that speaker. From then on it behaves like any preset: same synthesis endpoint, just a different voice value. Voice identification (Voice ID) is the inverse task: not reproducing a voice, but determining whose it is.
One important detail: cloning today is zero-shot. The model is not retrained on your voice; it receives the reference and its transcript at synthesis time. That is why one short clip is enough - and why clone quality depends so heavily on what you put into that clip.
How it works under the hood
You send two required things: the reference audio and its exact transcript (prompt_text). The engine (CosyVoice on the premium engine in Voice kit API) conditions synthesis on the pair of audio and the exact text of that audio. If the transcript diverges from the recording, the model gets a contradictory signal: it hears one thing and reads another. The result is a drifting timbre and a loss of the voice's character.
Then the system extracts a representation of the voice from the reference - latents, or a speaker embedding. It is a compact numeric description of how the person sounds: pitch, timbre, articulation habits. On every synthesis that description is mixed into generation: the text is yours, the timbre comes from the reference.
Three practical consequences follow. First: a reference is not just a file but the sample the model builds a portrait from, so garbage in means garbage out. Second: transcript accuracy is critical, and it is the most common beginner mistake. Third: a cloned voice lives on the worker side with its metadata next to your account, so clones are manageable - list them, fetch one by id, delete one together with its reference data.
What makes a clone good: reference requirements
Duration: 3-30 seconds of clean speech. Under three seconds, the model does not hear enough phonetics and the clone comes out averaged. Over thirty seconds, the worker rejects the request: for zero-shot that is redundant and, more importantly, it raises the chance of something unwanted in the clip (a pause, a breath, a stumble). The sweet spot is 8-15 seconds of calm, even speech.
One speaker, no music, echo, or background voices. If two people are in the recording, the embedding blends and the clone sounds like an average voice. A backing track, room reverb, street noise, and air conditioning hum all land in the voice representation as part of the timbre. Levels should be even, without clipping. Accepted formats are wav, mp3, ogg, flac, m4a, and aac, each file up to 10 MB, 16 kHz or higher.
And the key rule: prompt_text must match the recording word for word. If the sample is noisy, you do not have to re-record it - the clean=true flag automatically removes noise and normalizes loudness. The web cabinet also has a Transcribe sample button that runs the reference through speech recognition and fills the transcript in one click.
Cloning in the API: step by step
Cloning (model=premium) is part of the Pro and Business plans; on Free and Basic the request returns clone_forbidden with status 403. The first step is to create a clone with a single POST: name, language, transcript, and the audio file.
curl -X POST https://ttsapi.ru/v1/voices/clone \
-H "X-Api-Key: rtt_…" \
-F "name=Диктор Анна" \
-F "language=ru" \
-F "prompt_text=Это мой голос, и я говорю по-русски спокойно и чётко." \
-F "samples=@reference.wav"
# для шумной записи добавьте автоматическую очистку:
# -F "clean=true"
{
"id": "clone_ab12cd34ef56",
"name": "Диктор Анна",
"language": "ru",
"sample_count": 1,
"created_at": "2026-09-18T10:22:41+00:00"
}
The response is 201 Created with the new voice's passport, including its id. That id is then used as a regular voice identifier: in synthesis you pass voice=clone_… with model=premium. The output is a normal audio file in mp3, wav, or ogg, up to 5000 characters of text per request.
curl -X POST https://ttsapi.ru/v1/synthesize \
-H "X-Api-Key: rtt_…" \
-H "Content-Type: application/json" \
-d '{"text":"Здравствуйте! Это синтез клонированным голосом.","voice":"clone_ab12cd34ef56","model":"premium","format":"mp3"}'
Managing voices takes three requests: list, fetch by id, and delete. Deletion is irreversible: the voice disappears from the cabinet and from the worker. That is not just hygiene but also part of proper personal-data handling when a speaker withdraws consent. With the official Python SDK all of it reduces to a couple of lines. see the docs.
curl https://ttsapi.ru/v1/voices/clone -H "X-Api-Key: rtt_…"
curl https://ttsapi.ru/v1/voices/clone/clone_ab12cd34ef56 -H "X-Api-Key: rtt_…"
curl -X DELETE https://ttsapi.ru/v1/voices/clone/clone_ab12cd34ef56 -H "X-Api-Key: rtt_…"
from voicekit import VoiceKitClient
client = VoiceKitClient(api_key="rtt_…")
clone = client.create_clone_voice(
name="Диктор Анна",
prompt_text="Это мой голос, и я говорю по-русски спокойно и чётко.",
samples="reference.wav",
language="ru",
)
audio = client.synthesize(
"Здравствуйте! Это синтез клонированным голосом.",
voice=clone["id"],
model="premium",
format="mp3",
)
with open("speech.mp3", "wb") as f:
f.write(audio)
Where to use a cloned voice
Video and advertising: a founder's clone who never found time to record a hundred variations of a spot. Record ten minutes of honest speech once, then the text changes in a script, not in a studio. An audio-effects chain right in the synthesis request adapts one voice to different channels.
E-learning and corporate training: course content ages faster than it can be re-recorded, and long courses have asynchronous synthesis - text goes into a queue and the result is fetched by job_id. Audiobooks and long reads work the same way: chapters become a WAV manifest, while one consistent timbre carries the whole book.
IVR, voice bots, and assistants: if a brand has a recognizable voice, a clone carries it into automated scenarios, and streaming output in chunks voices replies on the fly without waiting for a whole paragraph. Podcasts and media close the last scenario: stings, announcements, and service inserts are generated from text with no studio trip.
Limits and honest boundaries
Cloning is a Pro and Business feature. Pro allows up to 5 cloned voices, while Business allows them without a hard limit within the plan; exceed it and you get clone_limit_exceeded. Clone synthesis works in 9 languages, Russian included, and it is not any language on Earth: request an unsupported one and synthesis will not run.
Zero-shot transfers timbre and delivery, but not native-level phonetics: if a Russian speaker's clone talks in English, you will almost certainly hear a slight accent. A clone does not become an actor either: if the reference was even and calm, do not expect a convincing shout or whisper. The emotion parameter is accepted for backward compatibility but ignored by the engine - better to know that up front.
Synchronous synthesis accepts up to 5000 characters; anything longer goes through the asynchronous endpoint. Cloning is more compute-heavy than a preset voice, because conditioning runs on every synthesis. And a clone lives until deletion: if quality stops satisfying you, the only fix is a new clone from a cleaner reference.
Legal and ethical aspects
A voice is a personal and, in many jurisdictions, biometric trait of a person, so cloning almost always requires consent. The baseline rule: obtain explicit, documented consent from the speaker specifically for cloning and speech synthesis, stating purposes, channels, duration, and the withdrawal procedure. If the person is a minor, a legal guardian gives consent.
Biometric data handling is governed by special rules: in Russia it is 152-FZ on personal data; in the EU, GDPR, which explicitly classifies voice data as biometric. The practical conclusion: you need not just a technical but an organizational process - where the reference is stored, who can access it, and how data is deleted on request.
On transparency: regulators worldwide are moving the same way - listeners have a right to know when a machine is talking, and the AI Act explicitly requires marking synthetic content. On abuse: the risk comes not from the technology but from using it for fraud. Team practice: keep rights to the clone, the term of use, and the withdrawal procedure in a dedicated clause of the agreement with the speaker - this prevents most future disputes before the first recording.
Cloning and Voice ID: defending against spoofing
The tool for faking a voice and the tool for detecting it live in the same API, and that is healthy design: protection is not about banning a technology but about separating real from synthetic where it matters. Creating a clone automatically creates a voice profile (source=clone) from the first sample - a reference fingerprint of the speaker.
curl -X POST https://ttsapi.ru/v1/voice-id/verify \
-H "X-Api-Key: rtt_…" \
-F "audio=@suspect.wav" \
-F "profile_id=clone_ab12cd34ef56"
With that profile you can check questionable recordings: send the audio for verification and pass the clone id as profile_id. The response contains similarity (cosine similarity of the fingerprints) and a verified flag. Verification passes when similarity rises above a threshold, 0.70 by default: different speakers typically score 0.5-0.6, the same speaker scores 0.7 and above.
For searching the base there is identify (1:N), which you can narrow with the profile_ids parameter. A separate voice-id endpoint returns an audio passport, including an ai_probability score, but treat it carefully: anti-spoofing models are trained mostly on English, and this is an indicative hint rather than legal evidence. Checks consume a separate quota: 100 per month on Pro and 1000 on Business. Voice ID.
Plans and budget
Cloning is not a separate product with its own price but part of a plan. On Pro (1490 RUB per month) you get synthesis, cloning, streaming, and long-form text: up to 5 clones, 2,000,000 synthesis characters, and 450,000 transcription seconds per month.
Business (7990 RUB per month) scales roughly threefold: 7,000,000 characters, clones without a hard plan limit, more Voice ID profiles, and a priority queue. Free and Basic have no cloning, and you can start free: synthesize text with a standard voice, hear the engine's quality, and only then decide whether you need your own timbre.
Simple arithmetic that saves money: a single 10-second reference can produce thousands of narrated paragraphs. What you spend is not references but synthesis characters - you pay for how much text you voiced, not for how many times the model looked at your sample. A high-quality reference is a one-time investment with a very long payback period. see pricing.
A checklist before your first clone
- The speaker consented in writing - with purposes, channels, and duration. Without it, do not proceed.
- The reference is 3-30 seconds, one speaker, no music, echo, or noise. Prefer 8-15 seconds of even speech.
- prompt_text matches the recording word for word. Use the Transcribe sample button and proofread the result.
- Format and size are fine: wav, mp3, ogg, flac, m4a, or aac, up to 10 MB, 16 kHz or higher.
- For a noisy reference, add clean=true. Cheaper and faster than re-recording.
- Check the target language. Clone synthesis covers 9 languages; evaluate accent on non-native languages in advance.
- Set up a deletion procedure from day one. A clone is deleted with one request, and you need a clear scenario for consent withdrawal.
- For anti-spoofing, remember the auto-enrolled Voice ID profile and verification using the clone id as profile_id.
Takeaways
Voice cloning stopped being a lab curiosity and became an ordinary API feature: one POST, one short reference, one model=premium in synthesis. The zero-shot approach removed the old barrier of training a model for hours or days.
But it also left an honest constraint: clone quality is almost entirely determined by reference quality. Ten clean seconds of even speech produce a result that is hard to distinguish from a recording; a noisy clip with music and a second voice in the background produces an averaged timbre you should not ship.
The main thing to remember: cloning is not about fooling a listener but about not dragging a real person into a studio for every new line. The technology removes the routine; responsibility stays with whoever writes the text and holds the consent. Sign up, get a key, and listen to your voice read text you never said.
Create a cloned voice
Sign up, get an API key, and upload a clean 10-second speech clip. Pro unlocks cloning, streaming, and long-form text.
Get an API key see pricing