curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/gemini-3.8-flash/text-to-speech",
"input": {
"text": "In the spring of 1912, the ship left Southampton carrying more than two thousand people.",
"voice": "Charon",
"style_instructions": "Slow, measured documentary narration with a hint of gravity"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1762160000-abc123",
"status": "not_started",
"created_time": "2026-11-03T10:30:00"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Request timeout{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Google
Gemini 3.8 Flash TTS
Gemini 3.8 Flash TTS API 将脚本或双人对话转为 WAV 音频,提供 30 种预设音色,并可用风格指示控制演绎方式。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/gemini-3.8-flash/text-to-speech",
"input": {
"text": "In the spring of 1912, the ship left Southampton carrying more than two thousand people.",
"voice": "Charon",
"style_instructions": "Slow, measured documentary narration with a hint of gravity"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1762160000-abc123",
"status": "not_started",
"created_time": "2026-11-03T10:30:00"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Request timeout{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
model 即可切换。
模型
- google/gemini-3.8-flash/text-to-speech — Gemini 3.8 Flash 文本转语音,用于单人旁白和双人对话。
功能
- 文本转语音(TTS),支持单人朗读或双人对话脚本。
- 30 种预设音色,可按请求或按说话人设置。
- 用自然语言的
style_instructions控制语气、语速、口音和情绪,可全局设置,也可逐句设置。 - 自动识别语言(Google 列出 130 种语言)。
- 输出 WAV 音频。
输入模式
- 单人:发送
text,可选voice(默认Kore)。 - 双人对话:发送恰好两位
speakers和一组turns。此模式下不要发送顶层的text或voice。
必填参数
单人:text(string):要朗读的文本,不能为空白。
speakers(object[]):恰好两个对象,每个对象只包含:speaker_id(string):非空别名,在请求内不能重复,例如host。voice(string):预设音色之一。
turns(object[]):至少一句,按说话顺序排列:speaker_id(string):必须与两位speakers之一一致。text(string):该说话人说的内容,不能为空白。style_instructions(string,可选):仅作用于这一句的演绎指示。
可选参数
voice(string):仅单人模式。预设音色之一。默认Kore。style_instructions(string):作用于整个请求的全局演绎指示,例如Calm, warm documentary narration。两种模式都适用。enable_safety_checker(boolean):启用上游安全检查。默认true。
输出
任务完成后,查询任务状态和回调内容的files 数组中会返回一个 WAV 音频文件。输出格式固定,没有 output_format 字段。
预设音色
voice 和 speakers[].voice 可用以下 30 个值(区分大小写):
支持的音色取值
支持的音色取值
AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKoreLaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi
示例
- 带风格指示的单人旁白:
voice: Charon,配合全局style_instructions生成缓慢的纪录片式旁白。 - 双人播客对话:
host(Kore)与guest(Puck),其中两句带逐句style_instructions,并提供callback_url。
注意事项
- 积分在提交时预扣,按计费字符数计算:
text、全局style_instructions,以及每一句的text和style_instructions。说话人 ID 不计入。任务失败会全额退还。当前费率见定价页。 - Gemini 3.8 Flash-Lite TTS 字段相同,计费更低。
- 对话模式只支持恰好两位说话人。出现第三位说话人、
turns中的speaker_id不在speakers里,或对话请求中带有顶层text/voice,都会返回 400。 - 演绎指示请写在
style_instructions中,不要写进text;写在text里的指示可能会被读出来。 - 本接口不支持
output_format、language_code、temperature、seed和时间戳,也不支持声音克隆或自定义音色。
授权
所有 API 接口都需要 Bearer Token 认证
获取 API Key:
进入 仪表盘 → API 密钥(API Key 管理页面)获取你的 API Key
在请求头中添加:
Authorization: Bearer VIDGO_API_KEY
请求体
application/json
模型 ID,填 google/gemini-3.8-flash/text-to-speech。
示例:
"google/gemini-3.8-flash/text-to-speech"
生成参数。发送 text(单人)或 speakers + turns(双人对话),二者只能选其一。
Show child attributes
Show child attributes
可选的公开 HTTP(S) 地址,任务变为 finished 或 failed 时会收到 POST 请求。建议使用 HTTPS。省略、传 null 或空字符串即不发送回调。
示例:
"https://your-domain.com/callback"