任务查询

查询合成任务的状态和结果。

文字转语音和声音转换都会创建“合成任务”。用下面的接口查询状态和获取音频。

任务对象

{
  "id": "9a3e6b1c-…",
  "object": "synthesis",
  "type": "tts",
  "status": "completed",
  "voice_id": "VOICE_ID",
  "title": "文章 88 第 1 段",
  "text": "今天的天气非常好,适合出门散步。",
  "language": "zh",
  "speed": 1.1,
  "mode": "balance",
  "input_duration_seconds": null,
  "audio_url": "https://cdn.voiceailabs.com/…/9a3e6b1c.mp3",
  "duration_ms": 3240,
  "credits_used": 16,
  "batch_id": null,
  "error": null,
  "refund": null,
  "created_at": "2026-10-09T02:00:00.000Z",
  "updated_at": "2026-10-09T02:00:06.000Z"
}
字段说明
typetts 文字转语音;voice_conversion 声音转换
statuspending、processing、completed、failed
audio_urlMP3 地址,只在 completed 时有值
duration_ms生成音频的时长(毫秒)
credits_used本任务预扣的积分
batch_id通过批量接口创建时为批量 ID
error失败时为 { code, message, retryable }
refund失败时的退分状态:{ status, credits },status 为 refunded(已退还)、pending(退还处理中)或 none(未扣费)

查询单个任务

GET /api/v1/syntheses/{id}

任务未结束时,查询会顺带推进任务状态。轮询建议:

  • 间隔 2–5 秒,单个文字转语音通常在几秒到几十秒内完成。
  • 超过 10 分钟仍未结束时,请停止轮询并联系支持(附上任务 id)。
  • 每次查询都计入请求频率限制,大量任务请使用 Webhook。

任务列表

GET /api/v1/syntheses?page=1&limit=20&status=completed&type=tts
参数说明
page / limit分页,limit 1–100,默认 20
status只看 processing、completed 或 failed 的任务
typetts 或 voice_conversion

列表按创建时间倒序,包含网页版创建的任务;每项是简化后的任务对象(id、type、status、voice_id、title、text、audio_url、credits_used、created_at)。

音频保留

生成的音频按套餐的历史保留期保存(免费版 7 天,入门版 30 天,标准版 180 天,高级版 365 天),过期后 audio_url 失效。请在完成后及时下载到你自己的存储。