tts
curl --request POST \
--url https://api.maxapi.ai/fish/v1/tts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'model: <model>' \
--data '{
"text": "xxx"
}'import requests
url = "https://api.maxapi.ai/fish/v1/tts"
payload = { "text": "xxx" }
headers = {
"Authorization": "<authorization>",
"model": "<model>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
model: '<model>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({text: 'xxx'})
};
fetch('https://api.maxapi.ai/fish/v1/tts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/fish/v1/tts"
payload := strings.NewReader("{\n \"text\": \"xxx\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("model", "<model>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maxapi.ai/fish/v1/tts")
.header("Authorization", "<authorization>")
.header("model", "<model>")
.header("Content-Type", "<content-type>")
.body("{\n \"text\": \"xxx\"\n}")
.asString();"<string>"POST
https://api.maxapi.ai
/
fish
/
v1
/
tts
tts
curl --request POST \
--url https://api.maxapi.ai/fish/v1/tts \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'model: <model>' \
--data '{
"text": "xxx"
}'import requests
url = "https://api.maxapi.ai/fish/v1/tts"
payload = { "text": "xxx" }
headers = {
"Authorization": "<authorization>",
"model": "<model>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
model: '<model>',
'Content-Type': '<content-type>'
},
body: JSON.stringify({text: 'xxx'})
};
fetch('https://api.maxapi.ai/fish/v1/tts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.maxapi.ai/fish/v1/tts"
payload := strings.NewReader("{\n \"text\": \"xxx\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("model", "<model>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.maxapi.ai/fish/v1/tts")
.header("Authorization", "<authorization>")
.header("model", "<model>")
.header("Content-Type", "<content-type>")
.body("{\n \"text\": \"xxx\"\n}")
.asString();"<string>"请求体
application/json
要合成的文本。
预先创建的音色或模型 ID。
必填范围:
0 <= x <= 1必填范围:
0 <= x <= 1必填范围:
100 <= x <= 300可用选项:
wav, pcm, mp3, opus 输出音频的采样率;不传时使用对应格式的默认值。
可用选项:
64, 128, 192 可用选项:
-1000, 24000, 32000, 48000, 64000 延迟与质量的平衡模式。
可用选项:
low, normal, balanced 必填范围:
0 <= x <= 100必填范围:
0 <= x <= 1响应
返回合成后的音频流。音频格式由请求体中的 format 决定。
The response is of type file.