API Reference
Text to speech — task query
GET
aihuman-tts-query
ID 45
查询语音合成任务结果。配合语音合成创建接口使用,创建后用 task_id 轮询。查询不扣费。
GET
https://xiaoapis.com/api/aihuman/tts_query
Authentication
Send the platform API key (query parameter key or JSON field key, as this page specifies). Create one in API key management.
GET https://xiaoapis.com/api/aihuman/tts_query
Content-Type: application/json
{
"key": "YOUR_API_KEY"
}
Request example
https://xiaoapis.com/api/aihuman/tts_query?task_id=你的task_id&key=你的密钥
Details
接口说明:
配合语音合成创建接口使用。创建任务后,用返回的 task_id 查询结果。音频与字幕会转存到本站,请及时下载。查询不扣费。
关联接口:语音合成
请求参数说明:
| 名称 | 必填 | 类型 | 示例值 | 说明 |
|---|---|---|---|---|
| task_id | 是 | string | t546950c297cde85 | 语音合成创建接口返回的任务ID |
返回参数说明:
| 名称 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码,200 表示查询成功 |
| msg | string | 状态信息 |
| data | object | 结果数据 |
| - task_id | string | 任务id |
| - status | int | 0 处理中,1 成功,2 失败 |
| - audio_url | string | 结果音频url。成功时有值,已转存到本站 |
| - audio_duration | int | 声音时长(毫秒),例如 52886。未完成时为 0 |
| - srt_url | string | 本音频配套的字幕文件url。成功且返回时有值 |
| - fail_reason | string | 失败原因,仅失败时有值 |
处理中请间隔数秒再次查询。
Response example
{"code":200,"msg":"查询成功","data":{"task_id":"t546950c297cde85","status":1,"audio_url":"https://xiaoapis.com/upload/audio/2026/09/19/demo.mp3","audio_duration":52886,"srt_url":"https://xiaoapis.com/upload/audio/2026/09/19/demo.srt","fail_reason":""}}
Error codes
| HTTP 响应状态码 | 说明 |
|---|---|
| 200 | 请求成功 |
| 400 | 参数错误,或任务不存在 |
| 401 | 认证失败,请检查 key |
Full console doc (with the debugger):/doc/45