跳转到内容

Gemini 3.1 Flash Tts

集成

模型 id gemini-3.1-flash-tts
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/gemini-3.1-flash-tts?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此请求: $0.003 3 API 积分 · ≈ ₽0.32 在此页面运行

获取 API 密钥
Google 文本转语音 口型同步快速 #lipsync#avatar

Gemini 3.1 Flash 文本转语音,支持内联风格控制、30 种音色和最多 10 位说话人

Google · 音频

你的第一个结果会显示在这里

在下方构建请求,并使用你的 API 密钥运行。输出会复制到我们的存储中,可永久保存,也可免费保存 7 天。

构建请求

控件根据模型架构生成。修改控件时,代码和价格会同步更新。

•必填 50 / 50000

Gemini 3.1 Flash TTS 的语音合成文本;多说话人行必须以 speakers 字段中的别名开头,例如 'Alice: Hello!\nBob: Hi!'。可使用 [sigh]、[laughing]、[whispering] 和 [short pause] 等表现力音频标签,或使用内联自然语言指令控制口音、情绪、语速和风格,例如 'Say cheerfully: Have a wonderful day!'。

高级 style_instructions · output_format · voice · language_code · temperature · speakers
0 / 4000

可选的自然语言指令,与朗读内容分开,并插入提示词前,用于调整表现力、口音、语速、语气和情绪。例如 'Speak warmly and slowly'、'Read this as a dramatic newscast'、'Use a British accent with a cheerful tone' 和 'Whisper mysteriously'。

output_format 默认 mp3

输出音频格式:mp3 提供压缩且紧凑的文件,推荐使用;wav 在 WAV 容器中包含 24 kHz、16 位单声道的未压缩 PCM 音频;ogg_opus 使用 Ogg 封装 Opus,在质量和大小之间取得良好平衡。

默认 Kore

从 30 个不同预设中选择单说话人声音;设置 speakers 后,此选择将失效。热门女性选项包括 Kore(强劲坚定)、Zephyr(明亮清晰)和 Aoede(温暖悦耳);热门男性选项包括 Puck(积极活泼)和 Charon(沉稳专业)。

多语言合成的语言覆盖设置:除非指定语言来引导模型的语音,否则会根据文本自动检测。

默认 1

语音随机性设置;较低值产生专注且可预测的表达,较高值产生更有创意且多变的表达。

启用多说话人朗读不同文本部分的语音配置。为每位说话人分配一个声音和一个与对应提示词前缀匹配的 speaker_id 别名。

POST /run/gemini-3.1-flash-tts?wait=20 报价 → $0.003
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/gemini-3.1-flash-tts?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

你的密钥会保留在此浏览器中:仅发送到 Doitong API;只有勾选“记住”后才会保存到 localStorage。 获取 API 密钥

关于 Gemini 3.1 Flash Tts

将最多 50000 个字符的 `prompt` 转换为语音。可通过内联指令或 `style_instructions` 控制表达方式。可选择 30 种音色之一,设置 `language_code`,或使用 `speakers`(2 到 10)生成多说话人音频。输出格式为 mp3、wav 或 ogg_opus,`temperature` 范围为 0 到 2。

参数

名称类型 默认值允许值 描述
prompt必填
类型string
≤ 50,000 个字符
Gemini 3.1 Flash TTS 的语音合成文本;多说话人行必须以 speakers 字段中的别名开头,例如 'Alice: Hello!\nBob: Hi!'。可使用 [sigh]、[laughing]、[whispering] 和 [short pause] 等表现力音频标签,或使用内联自然语言指令控制口音、情绪、语速和风格,例如 'Say cheerfully: Have a wonderful day!'。
style_instructions可选
类型string | null
≤ 4,000 个字符
可选的自然语言指令,与朗读内容分开,并插入提示词前,用于调整表现力、口音、语速、语气和情绪。例如 'Speak warmly and slowly'、'Read this as a dramatic newscast'、'Use a British accent with a cheerful tone' 和 'Whisper mysteriously'。
voice可选
类型enum
默认值Kore
AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKore
另有 14 个LaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi
从 30 个不同预设中选择单说话人声音;设置 speakers 后,此选择将失效。热门女性选项包括 Kore(强劲坚定)、Zephyr(明亮清晰)和 Aoede(温暖悦耳);热门男性选项包括 Puck(积极活泼)和 Charon(沉稳专业)。
language_code可选
类型enum
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)
另有 71 个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可选
类型object[]
启用多说话人朗读不同文本部分的语音配置。为每位说话人分配一个声音和一个与对应提示词前缀匹配的 speaker_id 别名。
temperature可选
类型number
默认值1
0 – 2
语音随机性设置;较低值产生专注且可预测的表达,较高值产生更有创意且多变的表达。
output_format可选
类型enum
默认值mp3
wavmp3ogg_opus
输出音频格式:mp3 提供压缩且紧凑的文件,推荐使用;wav 在 WAV 容器中包含 24 kHz、16 位单声道的未压缩 PCM 音频;ogg_opus 使用 Ogg 封装 Opus,在质量和大小之间取得良好平衡。
必填

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "gemini-3.1-flash-tts",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 3,
    "usd": "0.003",
    "charged": 3,
    "refunded": 0
  },
  "input": {
    "prompt": "Hello from Doitong. This is a short test sentence."
  },
  "output": {
    "audio": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_name": "0-output.mp3",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "audio",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_size": 1843200,
      "duration": 12,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
文件由你选择每个 outputs[].url 都是我们存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
所有模型的结构一致图像、视频和音频的字段均为 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
audio
object {url, content_type, file_name, file_size}生成生成的音频文件。

对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh-CN/developers/models/gemini-3.1-flash-tts.md. 所有模型和指南: https://doitong.com/developers/llms.txt