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.1-flash/text-to-speech",
"input": {
"text": "Welcome to the studio. [short pause] Let us tell your story.",
"style_instructions": "Warm narration with a relaxed pace.",
"voice": "Kore",
"temperature": 1,
"output_format": "mp3"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-example",
"status": "running",
"created_time": "2026-09-10T08:00:00"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Request timeout{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Google
Gemini 3.1 Flash TTS
使用 Gemini 3.1 Flash TTS 生成语音,支持风格指令和可选音色,适用于旁白或双人对话。
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.1-flash/text-to-speech",
"input": {
"text": "Welcome to the studio. [short pause] Let us tell your story.",
"style_instructions": "Warm narration with a relaxed pace.",
"voice": "Kore",
"temperature": 1,
"output_format": "mp3"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-example",
"status": "running",
"created_time": "2026-09-10T08:00: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,都可以通过统一的查询任务状态接口获取结果。
模型
- google/gemini-3.1-flash/text-to-speech - 将文本转换为语音。
功能
- 将文本转换为语音。
- 使用单一音色,或两个说话人别名。
- 使用
style_instructions和temperature控制演绎方式。 - 使用
voice选择音色,使用language_code指定朗读语言。
输出选项
输出格式
output_format:可选。可选值:mp3、wav、ogg_opus。默认:mp3。
高级参数
在请求根级设置model 和可选的 callback_url。所有工作流程参数(包括输出选项)都放在 input 中。
使用参数参考中的字段配置语音生成。
- 提供
speakers时,必须恰好包含两个不同的speaker_id别名,只能使用字母、数字和下划线。语音使用为每位说话人指定的音色。
文本
text:必填。要朗读的文本。长度:1-50,000 个字符。- 填写要朗读的内容,可加入
[short pause]、[whispering]、[laughing]等音频标签。对话中每一轮都以对应的speaker_id加冒号开头。
风格指令
style_instructions:可选。描述语音应如何演绎。
音色
voice:可选。选择音色。字符串。默认:Kore。
支持的音色
支持的音色
AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKoreLaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi
语言代码
language_code:可选。从下列值中选择,或省略以根据text自动识别语言。
支持的语言代码
支持的语言代码
Arabic (Egypt)Bangla (Bangladesh)Dutch (Netherlands)English (India)English (US)French (France)German (Germany)Hindi (India)Indonesian (Indonesia)Italian (Italy)Japanese (Japan)Korean (South Korea)Marathi (India)Polish (Poland)Portuguese (Brazil)Romanian (Romania)Russian (Russia)Spanish (Spain)Tamil (India)Telugu (India)Thai (Thailand)Turkish (Turkey)Ukrainian (Ukraine)Vietnamese (Vietnam)Afrikaans (South Africa)Albanian (Albania)Amharic (Ethiopia)Arabic (World)Armenian (Armenia)Azerbaijani (Azerbaijan)Basque (Spain)Belarusian (Belarus)Bulgarian (Bulgaria)Burmese (Myanmar)Catalan (Spain)Cebuano (Philippines)Chinese Mandarin (China)Chinese Mandarin (Taiwan)Croatian (Croatia)Czech (Czech Republic)Danish (Denmark)English (Australia)English (UK)Estonian (Estonia)Filipino (Philippines)Finnish (Finland)French (Canada)Galician (Spain)Georgian (Georgia)Greek (Greece)Gujarati (India)Haitian Creole (Haiti)Hebrew (Israel)Hungarian (Hungary)Icelandic (Iceland)Javanese (Java)Kannada (India)Konkani (India)Lao (Laos)Latin (Vatican City)Latvian (Latvia)Lithuanian (Lithuania)Luxembourgish (Luxembourg)Macedonian (North Macedonia)Maithili (India)Malagasy (Madagascar)Malay (Malaysia)Malayalam (India)Mongolian (Mongolia)Nepali (Nepal)Norwegian Bokmal (Norway)Norwegian Nynorsk (Norway)Odia (India)Pashto (Afghanistan)Persian (Iran)Portuguese (Portugal)Punjabi (India)Serbian (Serbia)Sindhi (India)Sinhala (Sri Lanka)Slovak (Slovakia)Slovenian (Slovenia)Spanish (Latin America)Spanish (Mexico)Swahili (Kenya)Swedish (Sweden)Urdu (Pakistan)
说话人
-
speakers:可选。必须恰好包含 2 项,每项为一个对象。 -
speakers[].voice:必填。为该说话人选择音色。
支持的音色
支持的音色
AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKoreLaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi
speakers[].speaker_id:必填。字符串,只能使用字母、数字和下划线。
温度
temperature:可选。控制语音生成的随机性。数值0到2。默认:1。
输出文件
- 读取返回的
files数组中的每一项。 - 生成的音频
file_type为"audio"。 - 从
files[].file_url读取音频 URL。
授权
使用 VIDGO_API_KEY。
请求体
application/json