跳转到主要内容
POST
/
fish
/
tts
Fish Tts
curl --request POST \
  --url https://api.acedata.cloud/fish/tts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "Hello, this is a Fish-Audio-compatible test."
}
'
import requests

url = "https://api.acedata.cloud/fish/tts"

payload = { "text": "Hello, this is a Fish-Audio-compatible test." }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({text: 'Hello, this is a Fish-Audio-compatible test.'})
};

fetch('https://api.acedata.cloud/fish/tts', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "audio_url": "https://platform.r2.fish.audio/task/8a72ff9840234006a9f74cb2fa04f978.mp3"
}
{
  "error": {
    "code": "token_mismatched",
    "message": "The specified token is not matched with API."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
  "error": {
    "code": "invalid_token",
    "message": "The specified token is invalid or wrong."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
  "error": {
    "code": "used_up",
    "message": "Your balance is not sufficient for current request, please buy more in Ace Data Cloud."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
  "error": {
    "code": "no_api",
    "message": "API does not exist, please make sure url is correct."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
  "error": {
    "code": "too_many_requests",
    "message": "You have exceeded the rate limit."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}
{
  "error": {
    "code": "api_error",
    "message": "Internal server error."
  },
  "trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}

授权

Authorization
string
header
必填

请求头

accept
enum<string>

Fish Tts Param Accept

可用选项:
application/json
model
enum<string>

Fish Tts Param Model

可用选项:
s1,
s2-pro

请求体

application/json
text
string
必填

Fish Tts Text

示例:

"Hello, this is a Fish-Audio-compatible test."

reference_id
string

Fish Tts Reference Id

示例:

"d7900c21663f485ab63ebdb7e5905036"

format
enum<string>

Fish Tts Format

可用选项:
mp3,
wav,
pcm,
opus
sample_rate
integer

Fish Tts Sample Rate

mp3_bitrate
enum<integer>

Fish Tts Mp3 Bitrate

可用选项:
64,
128,
192
opus_bitrate
integer

Fish Tts Opus Bitrate

latency
enum<string>

Fish Tts Latency

可用选项:
normal,
balanced
chunk_length
integer

Fish Tts Chunk Length

min_chunk_length
integer

Fish Tts Min Chunk Length

temperature
number

Fish Tts Temperature

top_p
number

Fish Tts Top P

repetition_penalty
number

Fish Tts Repetition Penalty

max_new_tokens
integer

Fish Tts Max New Tokens

normalize
boolean

Fish Tts Normalize

prosody
object

Fish Tts Prosody

references
object[]

Fish Tts References

callback_url
string

Fish Tts Callback Url

async
boolean

Fish Tts Async

响应

Fish Tts Response 200

audio_url
string

Fish Tts Response 200 Audio Url