Voice cloning API from a 3 to 15 second clip
Clone a voice from a short recording, save it once and speak any text in it with Qwen3-TTS or ZONOS2. Saved voices are free; speech is billed per minute.
Last updated 2026-11-05
Black Friday deposit bonus
Every qualifying top-up earns free credit, on top of any other offer.
Ends November 30
A cloned voice starts with a recording: 3 to 15 seconds of one person speaking clearly. Upload it to POST /v1/audio/voices once and you get a voice_… id; pass that id as voice to POST /v1/audio/speech and any text comes back in that voice, in every language the model speaks. Saving voices costs nothing. You pay only for the speech made with them, $0.036 per minute, the same as with a preset voice on our text to speech API.
Hand it to your AI agent
Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.
Clone a voice with the Lovely Router voices API and use it for speech. - Docs (read first): https://lovelyrouter.com/docs/api/audio.md and https://lovelyrouter.com/docs/models/speech.md - Save a voice once with POST https://lovelyrouter.com/v1/audio/voices (a short clean sample, `consent: true` = I confirm I may use this voice), then pass its id as `voice` to POST https://lovelyrouter.com/v1/audio/speech. A one-off clone can send `reference_audio` with the speech request instead. - Only clone voices I have the right to use; ask me to confirm before saving one. - Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys. - Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large. - Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt. My task: <the voice sample, whose voice it is and what it should say>
Record a sample that clones well
The sample is the whole input, so its quality is the clone's quality:
: 3 to 15 seconds of speech.
, speaking clearly, with no music and no second voice in the background.
Send them as transcript. Qwen3-TTS clones more closely with a transcript; without one it matches the voice's sound only. ZONOS2 doesn't need it.
: WAV, MP3, M4A, OGG/Opus, FLAC or WebM, up to 10 MB.
Clone, then speak
Save the voice
Send the clip as multipart
file, or as JSON withaudioset to anhttpsordata:URL.consent: trueis required.cURLcurl https://lovelyrouter.com/v1/audio/voices \ -H "Authorization: Bearer $LOVELY_API_KEY" \ -F name="Narrator" \ -F transcript="Thanks for listening. See you next week on the show." \ -F consent=true \ -F file=@narrator.wavThe answer is
201with the voice object:JSON{ "id": "voice_8f2c4a1e9b7d3f60a5c2e1d4", "object": "voice", "name": "Narrator", "transcript": "Thanks for listening. See you next week on the show.", "type": "audio/wav", "bytes": 482044, "audio_url": "https://lovelyrouter.com/v1/audio/voices/voice_8f2c4a1e9b7d3f60a5c2e1d4/audio", "created_at": 1792915200 }Speak in it
Use the id as
voicewith either model. Onqwen3-ttsyou can still addinstructionsto change how the cloned voice speaks.Pythonimport os from openai import OpenAI client = OpenAI(base_url="https://lovelyrouter.com/v1", api_key=os.environ["LOVELY_API_KEY"]) with client.audio.speech.with_streaming_response.create( model="qwen3-tts", voice="voice_8f2c4a1e9b7d3f60a5c2e1d4", input="Today we talk about the history of tea.", instructions="Relaxed, like the start of a podcast", ) as response: response.stream_to_file("episode.mp3")Or speak another language
The same saved voice works in every language its model speaks. Set
languagefor short texts:Node.jsimport fs from 'node:fs'; import OpenAI from 'openai'; const client = new OpenAI({ baseURL: 'https://lovelyrouter.com/v1', apiKey: process.env.LOVELY_API_KEY }); const audio = await client.audio.speech.create({ model: 'zonos2', voice: 'voice_8f2c4a1e9b7d3f60a5c2e1d4', input: 'Merci de nous avoir écoutés. À la semaine prochaine !', language: 'fr', emotion: 'happy', }); fs.writeFileSync('outro-fr.mp3', Buffer.from(await audio.arrayBuffer()));
Which engine to clone with
Both models clone from the same saved voice, so you can try one and switch without uploading again.
zonos2makes close clones and needs no transcript. It speaks 40+ languages, best in English, Chinese and Japanese, at 44.1 kHz, and itsemotionfield changes the delivery while the voice stays the same.qwen3-ttsclones more closely when the sample has itstranscript, and lets you steer the cloned voice withinstructionsin plain words. It speaks 10 languages at 24 kHz.
A saved voice or a one-off clip
| Saved voice | One-off clip | |
|---|---|---|
| How | POST /v1/audio/voices, then voice: "voice_…" | reference_audio in the speech request |
| The clip | Uploaded once, kept until you delete it | Sent with every request: an https URL, a data: URL or base64 |
| Transcript | transcript on the voice | reference_text on the request |
| Consent | consent: true when you save it | consent: true on every request |
| Best for | A narrator, a brand voice, a character you reuse | Trying a sample, or voices you don't want stored |
curl https://lovelyrouter.com/v1/audio/speech \
-H "Authorization: Bearer $LOVELY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-tts",
"input": "This line is spoken in the voice from the clip.",
"reference_audio": "https://example.com/sample.wav",
"reference_text": "Hi, this is a short sample of how I speak.",
"consent": true
}' \
--output line.mp3reference_audio can't be combined with voice in the same request.
Manage your voices
| Request | What it does |
|---|---|
GET /v1/audio/voices | Your saved voices, newest first |
GET /v1/audio/voices/{id} | One voice; another account's voice answers 404 |
GET /v1/audio/voices/{id}/audio | Downloads the sample as you uploaded it |
PATCH /v1/audio/voices/{id} | Renames it or changes its transcript |
DELETE /v1/audio/voices/{id} | Deletes the voice and its sample for good |
Saved voices are free, private to your account and kept until you delete them, up to 100 per account.
Keep a designed voice
You don't need a real person's recording to get a stable voice. Describe one to qwen3-tts in instructions, without voice, and it designs a new voice for that description. Designed voices vary a little each time, so when one sounds right, save that audio with POST /v1/audio/voices and use its id from then on: every later line keeps the same speaker.
Voices for video characters
A saved voice can belong to a saved character. In video shots, a tagged character with a voice speaks their lines in it, its timbre, pitch and manner, for up to 3 voiced characters per shot. Live video takes a voice clip too: the live video API keeps one speaker's voice for the whole stream.
Consent and responsibility
Every clone needs consent: true, on the saved voice or on the one-off request. With it you confirm the voice is your own or that you have the speaker's permission to clone it, and you take responsibility for how you use it. Don't clone voices to deceive or impersonate people. The acceptable use policy applies to every request.
Frequently asked questions
How long should a voice sample be?+
3 to 15 seconds of one person speaking clearly, without music. Send what the clip says as transcript for the closest clone on qwen3-tts.
How much does voice cloning cost?+
Saving a voice is free. Speech in a cloned voice costs $0.036 per minute of audio, billed by the second, the same as any other voice.
Can a cloned voice speak other languages?+
Yes. A saved voice works in every language its model speaks: 10 on qwen3-tts, 40+ on zonos2.
How many voices can I save?+
Up to 100 per account. They are private to your account and kept until you delete them.
Do I need consent to clone a voice?+
Yes. Every saved voice and every one-off clip needs consent: true, which confirms the voice is yours or you have the speaker's permission.
Can I change the emotion of a cloned voice?+
Yes. On zonos2, set emotion; on qwen3-tts, describe the delivery in instructions. The speaker stays the same.
The speech guide has more examples, and the audio API reference every field and error.