fish-audio
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFish Audio — Text-to-Speech
Fish Audio — Text-to-Speech
Generate narration / voiceover through AceDataCloud's Fish Audio API.
Setup: See authentication for token setup.
通过AceDataCloud的Fish Audio API生成旁白/解说音频。
设置: 请查看身份验证了解令牌设置方法。
Quick Start
快速开始
bash
curl -X POST https://api.acedata.cloud/fish/tts \
-H "Authorization: ******ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-H "model: s2-pro" \
-d '{"text":"你好,欢迎使用 AceData Cloud。","reference_id":"d7900c21663f485ab63ebdb7e5905036","format":"mp3"}'Synchronous responses return a direct audio URL:
json
{"audio_url":"https://platform.r2.fish.audio/task/8a72ff9840234006a9f74cb2fa04f978.mp3"}bash
curl -X POST https://api.acedata.cloud/fish/tts \
-H "Authorization: ******ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-H "model: s2-pro" \
-d '{"text":"你好,欢迎使用 AceData Cloud。","reference_id":"d7900c21663f485ab63ebdb7e5905036","format":"mp3"}'同步请求会直接返回音频URL:
json
{"audio_url":"https://platform.r2.fish.audio/task/8a72ff9840234006a9f74cb2fa04f978.mp3"}Endpoints
接口列表
| Endpoint | Purpose |
|---|---|
| Text-to-speech generation |
| Browse/search public Fish reference voices |
| Poll async TTS jobs when |
| 接口 | 用途 |
|---|---|
| 文本转语音生成 |
| 浏览/搜索公开的Fish参考语音 |
| 当 |
Workflows
工作流程
1. Find a reference voice
1. 查找参考语音
bash
curl "https://api.acedata.cloud/fish/model?page_size=10&page_number=1&title=Marcus" \
-H "Authorization: ******ACEDATACLOUD_API_TOKEN"The response includes with public voice metadata such as , ,
, , , and . Use an item as
in TTS requests.
items[]_idtitlelanguagestagsvisibilitystate_idreference_idbash
curl "https://api.acedata.cloud/fish/model?page_size=10&page_number=1&title=Marcus" \
-H "Authorization: ******ACEDATACLOUD_API_TOKEN"响应包含带有公共语音元数据的数组,元数据包括、、、、和。在TTS请求中使用某个条目的作为。
items[]_idtitlelanguagestagsvisibilitystate_idreference_id2. Text-to-Speech
2. 文本转语音
json
POST /fish/tts
Headers:
model: s2-pro
{
"text": "Your narration text.",
"reference_id": "d7900c21663f485ab63ebdb7e5905036",
"format": "mp3"
}json
POST /fish/tts
Headers:
model: s2-pro
{
"text": "Your narration text.",
"reference_id": "d7900c21663f485ab63ebdb7e5905036",
"format": "mp3"
}3. Async TTS
3. 异步文本转语音
json
POST /fish/tts
Headers:
model: s1
{
"text": "Longer narration for background processing.",
"async": true,
"callback_url": "https://api.acedata.cloud/health"
}Async: See async task polling. Poll viawithPOST /fish/tasks.{"id":"..."}
json
POST /fish/tts
Headers:
model: s1
{
"text": "Longer narration for background processing.",
"async": true,
"callback_url": "https://api.acedata.cloud/health"
}异步: 请查看异步任务轮询。通过接口并携带POST /fish/tasks进行轮询。{"id":"..."}
Parameters — /fish/tts
/fish/tts参数说明 — /fish/tts
/fish/ttsHeader
请求头
| Parameter | Values | Description |
|---|---|---|
| | Fish TTS engine selection |
| 参数 | 可选值 | 说明 |
|---|---|---|
| | Fish TTS引擎选择 |
JSON body
JSON 请求体
| Parameter | Type / Values | Description |
|---|---|---|
| string | Text to synthesize (required) |
| string | Public/reference voice ID from |
| | Output format |
| integer | Optional output sample rate |
| | MP3 bitrate |
| integer | Opus bitrate |
| | TTS latency mode |
| integer | Chunking controls |
| number | Sampling controls |
| integer | Maximum generated tokens |
| boolean | Normalize generated audio |
| object | Prosody tuning |
| array | Additional reference objects |
| string | Async callback URL |
| boolean | Run asynchronously and poll |
| 参数 | 类型/可选值 | 说明 |
|---|---|---|
| string | 需要合成的文本(必填) |
| string | 从 |
| | 输出格式 |
| integer | 可选的输出采样率 |
| | MP3比特率 |
| integer | Opus比特率 |
| | TTS延迟模式 |
| integer | 分块控制参数 |
| number | 采样控制参数 |
| integer | 最大生成令牌数 |
| boolean | 是否标准化生成的音频 |
| object | 韵律调优参数 |
| array | 额外参考对象数组 |
| string | 异步回调URL |
| boolean | 以异步方式运行并通过 |
Gotchas
注意事项
- The documented TTS endpoint is — not
POST /fish/tts./fish/audios - Choose the Fish engine with the request header, not a JSON
modelfield.model - Use from
reference_id— notGET /fish/model.voice_id - Synchronous requests return directly; async jobs should be polled via
audio_url./fish/tasks - The current OpenAPI spec documents voice browsing via ; it does not document a voice-cloning write endpoint.
GET /fish/model
- 文档中记录的TTS接口是,而非
POST /fish/tts。/fish/audios - 通过**请求头**选择Fish引擎,而非JSON请求体中的
model字段。model - 使用从获取的
GET /fish/model,而非reference_id。voice_id - 同步请求直接返回;异步任务需通过
audio_url接口轮询结果。/fish/tasks - 当前OpenAPI规范记录了通过浏览语音的方法,但未记录语音克隆的写入接口。
GET /fish/model