fish-audio

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fish 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

接口列表

EndpointPurpose
POST /fish/tts
Text-to-speech generation
GET /fish/model
Browse/search public Fish reference voices
POST /fish/tasks
Poll async TTS jobs when
async: true
接口用途
POST /fish/tts
文本转语音生成
GET /fish/model
浏览/搜索公开的Fish参考语音
POST /fish/tasks
async: true
时,轮询异步TTS任务

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
items[]
with public voice metadata such as
_id
,
title
,
languages
,
tags
,
visibility
, and
state
. Use an item
_id
as
reference_id
in TTS requests.
bash
curl "https://api.acedata.cloud/fish/model?page_size=10&page_number=1&title=Marcus" \
  -H "Authorization: ******ACEDATACLOUD_API_TOKEN"
响应包含带有公共语音元数据的
items[]
数组,元数据包括
_id
title
languages
tags
visibility
state
。在TTS请求中使用某个条目的
_id
作为
reference_id

2. 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 via
POST /fish/tasks
with
{"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

Header

请求头

ParameterValuesDescription
model
"s1"
,
"s2-pro"
Fish TTS engine selection
参数可选值说明
model
"s1"
,
"s2-pro"
Fish TTS引擎选择

JSON body

JSON 请求体

ParameterType / ValuesDescription
text
stringText to synthesize (required)
reference_id
stringPublic/reference voice ID from
GET /fish/model
format
"mp3"
,
"wav"
,
"pcm"
,
"opus"
Output format
sample_rate
integerOptional output sample rate
mp3_bitrate
64
,
128
,
192
MP3 bitrate
opus_bitrate
integerOpus bitrate
latency
"normal"
,
"balanced"
TTS latency mode
chunk_length
/
min_chunk_length
integerChunking controls
temperature
,
top_p
,
repetition_penalty
numberSampling controls
max_new_tokens
integerMaximum generated tokens
normalize
booleanNormalize generated audio
prosody
objectProsody tuning
references
arrayAdditional reference objects
callback_url
stringAsync callback URL
async
booleanRun asynchronously and poll
/fish/tasks
参数类型/可选值说明
text
string需要合成的文本(必填)
reference_id
string
GET /fish/model
获取的公共/参考语音ID
format
"mp3"
,
"wav"
,
"pcm"
,
"opus"
输出格式
sample_rate
integer可选的输出采样率
mp3_bitrate
64
,
128
,
192
MP3比特率
opus_bitrate
integerOpus比特率
latency
"normal"
,
"balanced"
TTS延迟模式
chunk_length
/
min_chunk_length
integer分块控制参数
temperature
,
top_p
,
repetition_penalty
number采样控制参数
max_new_tokens
integer最大生成令牌数
normalize
boolean是否标准化生成的音频
prosody
object韵律调优参数
references
array额外参考对象数组
callback_url
string异步回调URL
async
boolean以异步方式运行并通过
/fish/tasks
轮询结果

Gotchas

注意事项

  • The documented TTS endpoint is
    POST /fish/tts
    — not
    /fish/audios
    .
  • Choose the Fish engine with the
    model
    request header
    , not a JSON
    model
    field.
  • Use
    reference_id
    from
    GET /fish/model
    — not
    voice_id
    .
  • Synchronous requests return
    audio_url
    directly; async jobs should be polled via
    /fish/tasks
    .
  • The current OpenAPI spec documents voice browsing via
    GET /fish/model
    ; it does not document a voice-cloning write endpoint.
  • 文档中记录的TTS接口是
    POST /fish/tts
    ,而非
    /fish/audios
  • 通过**
    model
    请求头**选择Fish引擎,而非JSON请求体中的
    model
    字段。
  • 使用从
    GET /fish/model
    获取的
    reference_id
    ,而非
    voice_id
  • 同步请求直接返回
    audio_url
    ;异步任务需通过
    /fish/tasks
    接口轮询结果。
  • 当前OpenAPI规范记录了通过
    GET /fish/model
    浏览语音的方法,但记录语音克隆的写入接口。