统一鉴权:请求头 x-api-key(若后端启用)
1) 健康检查:GET /health
curl -sS https://tts.feigood.com/health
2) 获取音色列表:GET /api/voices
curl -sS https://tts.feigood.com/api/voices \
-H "x-api-key: 你的APIKey"
3) 语音合成:POST /api/synthesize
curl -sS -X POST https://tts.feigood.com/api/synthesize \
-H "Content-Type: application/json" \
-H "x-api-key: 你的APIKey" \
--data '{
"text": "你好,这是 API 调用测试",
"voice": "zh-CN-XiaoxiaoNeural",
"rate": "+0%",
"volume": "+0%",
"pitch": "+0Hz",
"boundary": "SentenceBoundary",
"generate_srt": true,
"auto_split": true,
"split_max_chars": 280,
"srt_merge_sentences": true,
"srt_max_chars": 24
}'
返回示例(JSON):包含 job_id、audio_url、可选 srt_url。
4) 下载文件:GET /api/files/{name}
curl -L -o demo.mp3 "https://tts.feigood.com/api/files/<job_id>.mp3" \
-H "x-api-key: 你的APIKey"