Fish Audio 声音克隆
- 2025.9.14 本站已经支持 fish-tts 模型
- 超多默认声音 比如:马斯克、赵本山、猪八戒、孙悟空 声音克隆
- 支持情感控制
Emotion Control - 支持自己上传音频文件进行克隆
- 完全支持 openai tts
/v1/audio/speech接口
计费
- 价格按汇率 1:3
- 官网:每百万 UTF-8 字节 15.00 美元
- 我们:每百万 UTF-8 字节 45.00 人民币
API
- 约定 header 中含有
Authorization : Bearer hk-你的key
1.克隆声音
shell
curl --request POST \
--url https://api.openai-hk.com/v1/audio/speech \
--header 'Authorization: Bearer hk-your-key' \
--header 'Content-Type: application/json' \
--data '{
"model": "fish-tts",
"input": "(高兴) 师傅,我想娶媳妇",
"voice": "d7900c21663f485ab63ebdb7e5905036"
}' \
--output speech.mp3curl --request POST \
--url https://api.openai-hk.com/v1/audio/speech \
--header 'Authorization: Bearer hk-your-key' \
--header 'Content-Type: application/json' \
--data '{
"model": "fish-tts",
"input": "(高兴) 师傅,我想娶媳妇",
"voice": "d7900c21663f485ab63ebdb7e5905036"
}' \
--output speech.mp3输出是 mp3 header
Content-Type: application/octet-stream输出的 header 中含有
task-id: b7f228140bd949d7b466e1c33566a2fd得到这个 task-id mp3 的链接为 https://platform.r2.fish.audio/task/b7f228140bd949d7b466e1c33566a2fd.mp3
voice是声音克隆来源d7900c21663f485ab63ebdb7e5905036是猪八戒的声音,可以是 fish 中的 model id更多声音来源 可以通过接口获取 或者 自己上传 克隆你上传的声音
input是内容,内容中支持情感控制指令 官方文档返回 json 格式
提交体
json
{
"model": "fish-tts",
"input": "(高兴) 师傅,我想娶媳妇",
"voice": "d7900c21663f485ab63ebdb7e5905036",
"response_format": "url"
}{
"model": "fish-tts",
"input": "(高兴) 师傅,我想娶媳妇",
"voice": "d7900c21663f485ab63ebdb7e5905036",
"response_format": "url"
}参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| model | string | 声音克隆名称 |
| input | string | 内容 |
| voice | string | 声音克隆来源,fish 中的 model id |
| response_format | string | 返回格式 默认是 stream,可以是 url |
返回
json
{
"audio_url": "https://platform.r2.fish.audio/task/ad68621d26334758922403bd2d0a4bd4.mp3"
}{
"audio_url": "https://platform.r2.fish.audio/task/ad68621d26334758922403bd2d0a4bd4.mp3"
}2.自创声音克隆源
shell
curl --request POST \
--url https://api.openai-hk.com/fish/model \
--header 'Authorization: Bearer hk-your-key' \
--header 'Content-Type: application/json' \
--data '{
"title":"老师"
,"description":"描述"
,"voices":"https://platform.r2.fish.audio/task/604133d7b3c7430385382470f67770e8.mp3"
,"cover_image":"https://www.open-hk.com/res/img/open.png"
,"train_mode":"fast"
}'curl --request POST \
--url https://api.openai-hk.com/fish/model \
--header 'Authorization: Bearer hk-your-key' \
--header 'Content-Type: application/json' \
--data '{
"title":"老师"
,"description":"描述"
,"voices":"https://platform.r2.fish.audio/task/604133d7b3c7430385382470f67770e8.mp3"
,"cover_image":"https://www.open-hk.com/res/img/open.png"
,"train_mode":"fast"
}'参数说明
参数 类型 说明 title string 声音克隆名称 description string 声音克隆描述 voices string 声音文件地址 cover_image string 封面 train_mode string 声音克隆训练模式 is_save bool 默认是 false 是否保留 不保存 10 分钟回删除此模型 返回体
其中_id给 voice 使用的
json
{
"_id": "d3645891f9e742108c313e66271394ac",
"type": "tts",
"title": "老师",
"description": "描述",
"cover_image": "coverimage/d3645891f9e742108c313e66271394ac",
"train_mode": "fast",
"state": "trained",
"tags": [],
"samples": [
{
"title": "Default Sample",
"text": "通过光合作用,植物能够将阳光转化为生命所需的能量。这个精密的生物化学过程不仅维持了植物的生长,更为地球上的氧气循环做出了重要贡献,展现了自然界的奇妙平衡。",
"task_id": "1ae43d4f956d4744b7ecb6c6d54e4437",
"audio": "task/1ae43d4f956d4744b7ecb6c6d54e4437.mp3"
}
],
"created_at": "2025-09-14T15:10:09.033883Z",
"updated_at": "2025-09-14T15:10:09.033485Z",
"languages": ["zh"],
"visibility": "public",
"lock_visibility": false,
"default_text": "通过光合作用,植物能够将阳光转化为生命所需的能量。这个精密的生物化学过程不仅维持了植物的生长,更为地球上的氧气循环做出了重要贡献,展现了自然界的奇妙平衡。",
"like_count": 0,
"mark_count": 0,
"shared_count": 0,
"task_count": 0,
"unliked": false,
"liked": false,
"marked": false
}{
"_id": "d3645891f9e742108c313e66271394ac",
"type": "tts",
"title": "老师",
"description": "描述",
"cover_image": "coverimage/d3645891f9e742108c313e66271394ac",
"train_mode": "fast",
"state": "trained",
"tags": [],
"samples": [
{
"title": "Default Sample",
"text": "通过光合作用,植物能够将阳光转化为生命所需的能量。这个精密的生物化学过程不仅维持了植物的生长,更为地球上的氧气循环做出了重要贡献,展现了自然界的奇妙平衡。",
"task_id": "1ae43d4f956d4744b7ecb6c6d54e4437",
"audio": "task/1ae43d4f956d4744b7ecb6c6d54e4437.mp3"
}
],
"created_at": "2025-09-14T15:10:09.033883Z",
"updated_at": "2025-09-14T15:10:09.033485Z",
"languages": ["zh"],
"visibility": "public",
"lock_visibility": false,
"default_text": "通过光合作用,植物能够将阳光转化为生命所需的能量。这个精密的生物化学过程不仅维持了植物的生长,更为地球上的氧气循环做出了重要贡献,展现了自然界的奇妙平衡。",
"like_count": 0,
"mark_count": 0,
"shared_count": 0,
"task_count": 0,
"unliked": false,
"liked": false,
"marked": false
}3.官网声音源
返回体 其中_id给 voice 使用的
json
{
"total": 272820,
"items": [
{
"_id": "54a5170264694bfc8e9ad98df7bd89c3",
"type": "tts",
"title": "丁真",
"description": "",
"cover_image": "coverimage/54a5170264694bfc8e9ad98df7bd89c3",
"train_mode": "fast"
},
......,
{}
]
}{
"total": 272820,
"items": [
{
"_id": "54a5170264694bfc8e9ad98df7bd89c3",
"type": "tts",
"title": "丁真",
"description": "",
"cover_image": "coverimage/54a5170264694bfc8e9ad98df7bd89c3",
"train_mode": "fast"
},
......,
{}
]
}4.情感与控制指令
示例
- 句首用法:(愤怒)你就是这样回报我的吗?
- 句中用法:我对你这么信任,(愤怒)你就是这样回报我的吗?
- 语速变快:快走!后面有人在追,(语速变快)再不跑就来不及了!
- 语速变慢:他一字一顿,(语速变慢)仿佛每个字都有千斤重。
- 声音变小:他凑到我耳边,(声音变小)悄悄告诉我一个秘密。
- 声音变大:(大声)你说什么?我听不见!
- 语气激动:这太不可思议了!(语气激动)我们竟然真的成功了!
- 大笑:听到这个笑话,他再也忍不住了,(大笑)哈哈哈哈!
- 哭泣:她捂着脸,(哭泣)呜呜呜,再也说不出一句话。
- 叹气:事情怎么会变成这样……(叹气)唉。
5.官网/v1/tts 接口
shell
curl --request POST \
--url https://api.openai-hk.com/fish/v1/tts \
--header 'Authorization: Bearer hk-your-key' \
--header 'format: url' \
--header 'model: s2-pro' \
--data '{
"text": "[嘿嘿]你说什么?",
"reference_id": "5c353fdb312f4888836a9a5680099ef0",
"temperature": 0.7,
"top_p": 0.7,
"prosody": {
"speed": 1,
"volume": 0,
"normalize_loudness": true
},
"chunk_length": 300,
"normalize": true,
"format": "mp3",
"sample_rate": 44100,
"mp3_bitrate": 128,
"latency": "normal",
"max_new_tokens": 1024,
"repetition_penalty": 1.2,
"min_chunk_length": 50,
"condition_on_previous_chunks": true,
"early_stop_threshold": 1,
"references":[{
"audio_url":"http://cos.aitutu.cc/mp4/ru-user-voice.mp3",
"text":"Hello! Welcome to Fish Audio."
}]
}'curl --request POST \
--url https://api.openai-hk.com/fish/v1/tts \
--header 'Authorization: Bearer hk-your-key' \
--header 'format: url' \
--header 'model: s2-pro' \
--data '{
"text": "[嘿嘿]你说什么?",
"reference_id": "5c353fdb312f4888836a9a5680099ef0",
"temperature": 0.7,
"top_p": 0.7,
"prosody": {
"speed": 1,
"volume": 0,
"normalize_loudness": true
},
"chunk_length": 300,
"normalize": true,
"format": "mp3",
"sample_rate": 44100,
"mp3_bitrate": 128,
"latency": "normal",
"max_new_tokens": 1024,
"repetition_penalty": 1.2,
"min_chunk_length": 50,
"condition_on_previous_chunks": true,
"early_stop_threshold": 1,
"references":[{
"audio_url":"http://cos.aitutu.cc/mp4/ru-user-voice.mp3",
"text":"Hello! Welcome to Fish Audio."
}]
}'model 放在 header 中 支持
s2-pros1如果要返回 url,需要在 header 中
format: url默认返回 stream参数说明
| 参数 | 类型 | 说明 |
|---|---|---|
| text | string | 声音内容 |
| reference_id | string | 声音音色克隆 id |
| references | object | 声音音色克隆 references 如果 reference_id 有值不起作用 |
| references[0].audio_url | string | 声音音色克隆地址 时长 10s~270s 格式支持 mp3 wav |
| references[0].text | string | 声音音色克隆地址 参考样例文本 |
OpenAi-HK