文本转音频
curl --request POST \
--url https://aiapi.xiaoliu.fun/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"model": "<string>",
"voice": "<string>"
}
'import requests
url = "https://aiapi.xiaoliu.fun/v1/audio/speech"
payload = {
"input": "<string>",
"model": "<string>",
"voice": "<string>"
}
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({input: '<string>', model: '<string>', voice: '<string>'})
};
fetch('https://aiapi.xiaoliu.fun/v1/audio/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://aiapi.xiaoliu.fun/v1/audio/speech",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => '<string>',
'model' => '<string>',
'voice' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aiapi.xiaoliu.fun/v1/audio/speech"
payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://aiapi.xiaoliu.fun/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://aiapi.xiaoliu.fun/v1/audio/speech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body语音
文生语音
将文本转换为自然流畅的语音
POST
/
v1
/
audio
/
speech
文本转音频
curl --request POST \
--url https://aiapi.xiaoliu.fun/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"model": "<string>",
"voice": "<string>"
}
'import requests
url = "https://aiapi.xiaoliu.fun/v1/audio/speech"
payload = {
"input": "<string>",
"model": "<string>",
"voice": "<string>"
}
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({input: '<string>', model: '<string>', voice: '<string>'})
};
fetch('https://aiapi.xiaoliu.fun/v1/audio/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://aiapi.xiaoliu.fun/v1/audio/speech",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => '<string>',
'model' => '<string>',
'voice' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aiapi.xiaoliu.fun/v1/audio/speech"
payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://aiapi.xiaoliu.fun/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://aiapi.xiaoliu.fun/v1/audio/speech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\",\n \"model\": \"<string>\",\n \"voice\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body音色列表
| voice | description |
|---|---|
| A-SOUL贝拉 | 可爱元气的女声 |
| Rupa | 温柔母性又带有狡黠可爱、活泼的少女声音 |
| 东雪莲 | |
| 丰川祥子 | |
| 佐伊 | 古灵精怪的可爱小女孩 |
| 初音未来 | 初音未来,日语版 |
| 刻晴22 | |
| 千早爱音 | |
| 千早爱音中文 | |
| 可爱少女 | |
| 塑心_public | |
| 多情女声 | |
| 女大学生 | |
| 孤独摇滚-后藤独 | |
| 学姐 | |
| 宵崎奏 | |
| 小凌潇 | |
| 少女 | |
| 弦卷-心 | 弦卷心的声音特点是极具能量与感染力的甜美声音,如同阳光般能瞬间点亮周围氛围。 |
| 御姐 | |
| 御姐(新) | |
| 懒羊羊 | |
| 提纳里 | |
| 曼波(短视频) | |
| 柔情萝莉 | |
| 永雏塔菲 | |
| 派蒙 | |
| 流浪者 | |
| 温情学妹 | |
| 温柔女生 | |
| 温柔老师 | |
| 温迪 | |
| 爱丽丝 | |
| 爱莉希雅 | |
| 特蕾西娅 | |
| 甜美主播 | |
| 米浴 | |
| 纳西妲 | |
| 艾雅法拉 | |
| 芙宁娜 | |
| 赛马娘 | |
| 长崎素世 | |
| 风情御姐 | |
| 高松灯 | |
| 魈 | |
| 黍_public |
⌘I