用户指南 API 参考

语音列表

获取可用的 TTS 语音

发布 /api/v1/voices/

返回经身份验证的用户可在 Text-to-Speech API 中使用的所有语音列表。

身份验证

请将您的 API 密钥包含在 Authorization 请求头中,格式为 `Bearer YOUR_API_KEY`。

响应

领域 类型 描述
voice_id 整数 唯一语音标识符
voice_name 字符串 语音显示名称
voice_sample_url 字符串 语音样本音频文件的 URL
voice_fees 漂浮 使用此语音的费用(0 表示免费)
voice_badges 物体 语音的附加元数据,例如语言、性别、年龄、使用场景

示例

curl "https://moknah.io/api/v1/voices/" \
  -H "Authorization: Bearer YOUR_API_KEY"
import requests

response = requests.post(
    "https://moknah.io/api/v1/voices/",
    headers={"Authorization": "Bearer YOUR_API_KEY"}
)

voices = response.json()
for voice in voices:
    print(voice["voice_name"], voice["voice_sample_url"])
const response = await fetch(
    'https://moknah.io/api/v1/voices/',
    {
        headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
    }
);

const voices = await response.json();
console.log(voices);

响应示例

[
    {
        "voice_id": 1328,
        "voice_name": "Adnan",
        "voice_sample_url": "https://storage.moknah.io/media/voice_samples/Adnan.mp3",
        "voice_fees": 0.0,
        "voice_badges": {
            "language": "Arabic",
            "gender": "Male",
            "age": "Young Adult",
            "use_case": "Documentary, Audiobook, Article",
        }
    }
]
API 支持

如有关于 API 的问题或疑问,请联系我们: api@moknah.io.