Black Friday deposit bonus·Top up $50+ and get $10 · Top up $100+ and get $25·Ends November 30Top up →
Text to speech

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

Prepaid, no subscriptionREST or MCPOne key for models, data and agents
voices$ curl https://lovelyrouter.com/v1/audio/voices -F sample=@me.wav -… ✓ voice saved · voc_…$ curl https://lovelyrouter.com/v1/audio/speech -d '{"voice": "voc_… any text, in your voice ✓ 200 OK
Black Friday

Black Friday deposit bonus

Every qualifying top-up earns free credit, on top of any other offer.

Ends November 30

Deposit $50
+$10
20% bonus
Deposit $100
+$25
25% bonus
Sign up and claim

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>
01

Record a sample that clones well

The sample is the whole input, so its quality is the clone's quality:

Length

: 3 to 15 seconds of speech.

One speaker

, speaking clearly, with no music and no second voice in the background.

The words it says

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.

Formats

: WAV, MP3, M4A, OGG/Opus, FLAC or WebM, up to 10 MB.

02

Clone, then speak

  1. Save the voice

    Send the clip as multipart file, or as JSON with audio set to an https or data: URL. consent: true is required.

    cURL
    curl 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.wav

    The answer is 201 with 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
    }
  2. Speak in it

    Use the id as voice with either model. On qwen3-tts you can still add instructions to change how the cloned voice speaks.

    Python
    import 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")
  3. Or speak another language

    The same saved voice works in every language its model speaks. Set language for short texts:

    Node.js
    import 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()));
03

Which engine to clone with

Both models clone from the same saved voice, so you can try one and switch without uploading again.

  • zonos2 makes close clones and needs no transcript. It speaks 40+ languages, best in English, Chinese and Japanese, at 44.1 kHz, and its emotion field changes the delivery while the voice stays the same.
  • qwen3-tts clones more closely when the sample has its transcript, and lets you steer the cloned voice with instructions in plain words. It speaks 10 languages at 24 kHz.
04

A saved voice or a one-off clip

search_toolsrun_toolget_run
Saved voiceOne-off clip
HowPOST /v1/audio/voices, then voice: "voice_…"reference_audio in the speech request
The clipUploaded once, kept until you delete itSent with every request: an https URL, a data: URL or base64
Transcripttranscript on the voicereference_text on the request
Consentconsent: true when you save itconsent: true on every request
Best forA narrator, a brand voice, a character you reuseTrying a sample, or voices you don't want stored
cURL
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.mp3

reference_audio can't be combined with voice in the same request.

05

Manage your voices

RequestWhat it does
GET /v1/audio/voicesYour saved voices, newest first
GET /v1/audio/voices/{id}One voice; another account's voice answers 404
GET /v1/audio/voices/{id}/audioDownloads 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.

06

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.

07

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.

09

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.

One prepaid key for models, data and agents

No subscription. Top up, use what you need, see every charge in your logs.