接口信息(ai_tts) 正常
总调用 9,284 次
首次添加 2025-11-23
最后更新 2026-08-02
计费 ¥0.0010/次
请求信息 GET
请求地址
https://ecyapi.cn/API/ai_tts.php
请求示例
https://ecyapi.cn/API/ai_tts.php?category=1000&role=1&msg=你好&apikey=API秘钥
请求参数
参数名类型必填说明
category integer 角色类别,不填默认为 1000 ,即 崩坏:星穹铁道
role integer 角色ID序号,不填默认为 1 ,即 银狼
msg string 合成内容,支持各种语言,不填默认为 你好 ,限制为100个字符,内容越长合成速度越慢
apikey string API秘钥
sample_rate integer 采样率,不填默认 24000 ,不会请不要填
volume string 音量,不填默认 90 ,不会请不要填
rate string 语速,不填默认 1 ,不会请不要填
状态码说明
状态码说明
200请求成功,服务器已成功处理了请求
403服务器拒绝请求可能是缺少认证凭据(如API密钥)或权限不足
404请求的资源未找到请检查请求地址是否正确
429请求过于频繁您已超出速率限制,请稍后再试
500服务器内部错误服务器在执行请求时遇到了问题
在线测试
响应结果
点击“发送测试”查看返回结果...
调用示例
<?php
$url = 'https://ecyapi.cn/API/ai_tts.php';
$params = ['category' => 'YOUR_VALUE', 'role' => 'YOUR_VALUE', 'msg' => 'YOUR_VALUE', 'apikey' => 'YOUR_VALUE', 'sample_rate' => 'YOUR_VALUE', 'volume' => 'YOUR_VALUE', 'rate' => 'YOUR_VALUE', ];
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests

url = "https://ecyapi.cn/API/ai_tts.php"
params = {
    'category': 'YOUR_VALUE',
    'role': 'YOUR_VALUE',
    'msg': 'YOUR_VALUE',
    'apikey': 'YOUR_VALUE',
    'sample_rate': 'YOUR_VALUE',
    'volume': 'YOUR_VALUE',
    'rate': 'YOUR_VALUE',
}
response = requests.get(url, params=params)
print(response.text)
const url = new URL('https://ecyapi.cn/API/ai_tts.php');
const params = {
    'category': 'YOUR_VALUE',
    'role': 'YOUR_VALUE',
    'msg': 'YOUR_VALUE',
    'apikey': 'YOUR_VALUE',
    'sample_rate': 'YOUR_VALUE',
    'volume': 'YOUR_VALUE',
    'rate': 'YOUR_VALUE',
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

fetch(url)
    .then(response => response.text())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));