黑色星期五充值赠礼
每笔符合条件的充值都可获赠额度,并可与其他优惠叠加。
11月30日截止
克隆声音始于一段录音:一个人清晰说话的 3 到 15 秒。把它上传到 POST /v1/audio/voices 一次,你就会得到一个 voice_… id;把这个 id 作为 voice 传给 POST /v1/audio/speech,任何文本都会以那个声音返回,且覆盖模型所说的每一种语言。保存声音不花钱。你只需为用它们合成的语音付费,每分钟 $0.036,与在我们的文本转语音 API 上使用预设声音相同。
交给你的 AI 智能体
把这段提示词复制到 Claude Code、Cursor、Codex 或任何编程智能体中。它会告诉智能体文档在哪里,以及如何使用你的 API 密钥。
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>
录一段适合克隆的样本
样本就是全部输入,所以它的质量就是克隆的质量:
:3 到 15 秒的语音。
,说话清晰,没有音乐,背景里没有第二个声音。
把它作为 transcript 发送。有 transcript 时 Qwen3-TTS 克隆得更像;没有时它只匹配音色。ZONOS2 不需要它。
:WAV、MP3、M4A、OGG/Opus、FLAC 或 WebM,最大 10 MB。
先克隆,再说话
保存声音
把片段作为 multipart 的
file发送,或用 JSON 把audio设为https或data:URL。consent: true是必需的。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.wav返回
201和声音对象: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 }用它说话
把 id 作为
voice用于任一模型。在qwen3-tts上你仍可添加instructions来改变克隆声音的说话方式。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")或者换一种语言说
同一个保存的声音在其模型所说的每种语言里都可用。短文本请设置
language: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()));
用哪个引擎来克隆
两个模型都从同一个保存的声音克隆,所以你可以先试一个,再切换,无需重新上传。
zonos2能做出接近的克隆,且不需要 transcript。它说 40 多种语言,英语、中文和日语最佳,采样率 44.1 kHz,其emotion字段能改变表达方式,而声音保持不变。qwen3-tts在样本带有transcript时克隆得更像,并允许你用大白话的instructions引导克隆声音。它说 10 种语言,采样率 24 kHz。
保存的声音还是一次性片段
| 保存的声音 | 一次性片段 | |
|---|---|---|
| 方式 | POST /v1/audio/voices,然后 voice: "voice_…" | 在语音请求里用 reference_audio |
| 片段 | 上传一次,保留到你删除为止 | 每次请求都发送:https URL、data: URL 或 base64 |
| Transcript | 声音上的 transcript | 请求上的 reference_text |
| 授权 | 保存时的 consent: true | 每次请求的 consent: true |
| 最适合 | 旁白、品牌声音、反复使用的角色 | 试听样本,或不想存储的声音 |
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 不能和 voice 一起用。
管理你的声音
| 请求 | 作用 |
|---|---|
GET /v1/audio/voices | 你保存的声音,最新的在前 |
GET /v1/audio/voices/{id} | 单个声音;其他账号的声音返回 404 |
GET /v1/audio/voices/{id}/audio | 按你上传的原样下载样本 |
PATCH /v1/audio/voices/{id} | 重命名或修改它的 transcript |
DELETE /v1/audio/voices/{id} | 永久删除该声音及其样本 |
保存的声音免费,仅你的账号可见,保留到你删除为止,每个账号最多 100 个。
保留设计出来的声音
你不需要真人录音也能得到稳定的声音。在 instructions 里向 qwen3-tts 描述一个声音,不带 voice,它就会按该描述设计一个新声音。设计出的声音每次都会有些许差异,所以当某个听起来合适时,用 POST /v1/audio/voices 保存那段音频,并从那时起使用它的 id:之后每一句都保持同一个说话人。
授权与责任
每次克隆都需要 consent: true,无论是在保存的声音上还是一次性请求上。它表示你确认该声音是你自己的,或你已获得说话人许可来克隆它,并对如何使用它负责。不要用克隆声音欺骗或冒充他人。可接受使用政策适用于每一次请求。
常见问题
声音样本应该多长?+
一个人清晰说话的 3 到 15 秒,不要音乐。把片段说的内容作为 transcript 发送,可在 qwen3-tts 上获得最接近的克隆。
克隆声音要多少钱?+
保存声音免费。用克隆声音合成语音每分钟音频 $0.036,按秒计费,与其他任何声音相同。
克隆的声音能说其他语言吗?+
能。保存的声音在其模型所说的每种语言里都可用:qwen3-tts 10 种,zonos2 40 多种。
我能保存多少个声音?+
每个账号最多 100 个。它们仅你的账号可见,保留到你删除为止。
克隆声音需要授权吗?+
需要。每个保存的声音和每个一次性片段都需要 consent: true,它确认声音是你的,或你已获得说话人许可。
能改变克隆声音的情绪吗?+
能。在 zonos2 上设置 emotion;在 qwen3-tts 上,用 instructions 描述表达方式。说话人保持不变。