VoiceRouter

开发者 API

受控异步 API。与网页共用账户、参考声音、任务和并发限制。模型离线时不能提交新生成;历史结果仍可访问。

API key 功能尚未在此环境开放。

read:模型和任务查询;write:上传、裁选、提交、取消与恢复;audio:创建音频访问链接和下载。WAV/MP3 上传上限 25 MiB、0.5–120 秒;参考 0.5–15 秒;每任务最多 1400 字符、24 段、600 秒成品。每账户最多 3 个有效 key,每分钟共用 60 次 API 请求,最多 1 个活动任务。网页的任务准入限制同样适用。

# Keep VR_API_KEY on your server. Never put it in a URL.
curl https://voicerouter.top/api/v1/models -H "Authorization: Bearer $VR_API_KEY"

# Upload WAV/MP3, max 25 MiB and 0.5–120 seconds. Authorized voices only.
curl https://voicerouter.top/api/v1/uploads -X POST -H "Authorization: Bearer $VR_API_KEY" \
  -H "x-file-name: reference.wav" --data-binary @reference.wav
# POST /api/v1/references with {"originalId":"UPLOAD_UUID","startMs":0,"endMs":5000}
# Use the returned reference id below; clips must be 0.5–15 seconds.
# POST /api/v1/speech/jobs with a UUID Idempotency-Key and:
{"text":"Hello","referenceId":"YOUR_REFERENCE_UUID","model":"indextts-2.5",
 "capabilityVersion":"2026-10-02.2","parameters":{"language":"en","speed":1}}

# Paths below are relative to /api/v1. GET /usage returns owner-only usage.
# GET /speech/jobs/{id} to poll. POST /speech/jobs/{id}/cancel to cancel.
# POST /speech/jobs/{id}/resume with a new Idempotency-Key and
# {"stateVersion": CURRENT_VERSION}. Completed segments are reused.
# POST /assets/{outputId}/access returns a relative URL, valid for 10 min.
# GET that URL on this origin, still with Authorization: Bearer $VR_API_KEY.

相同幂等 key 与输入会返回原任务,改变输入返回 IDEMPOTENCY_CONFLICT。错误返回 {error:{code}}:401 无效身份;403 权限不足;404 不存在或不属于你;409 状态或幂等冲突;410 链接过期;422 输入无效;429 限流(Retry-After);503 模型离线。文件保存期限另见存储说明。撤销 key 不会自动取消已提交任务。