Gemini 3.8 Flash-Lite TTS API 调用参考
又快又轻的语音合成,30 种音色
用一个 PopNow API 密钥,就能在自己的代码里调用 Gemini 3.8 Flash-Lite TTS。下面列出要填的调用名、这个型号接受的每个输入字段、每次请求花多少积分,以及一段可以直接粘进终端运行的请求。
参数说明直接取自型号的输入 schema,暂时只有英文。
一览
- 出品方
- 产出
- 音频
- 起价
- 0.03 积分 每秒成片 ($0.0003)
- 一般耗时
- 约 11 秒
1 积分 = 0.01 美元。任务受理时先冻结可能的最高费用,完成后按实际用量结算、向上取整到整积分,多冻的退回;失败的任务不扣积分。想在运行前知道确切数字,先调 POST /api/v1/jobs/quote。
文字转语音
google/gemini-3.8-flash-lite-tts/text-to-speech
价格
| 选项 | 积分 (每秒成片) | 美元 |
|---|---|---|
默认 | 0.03 | $0.0003 |
参数
| 字段 | 类型 | 默认值 | 取值范围 | 作用 |
|---|---|---|---|---|
text可选 | string | — | 最多 5000 个字符 | The words to be spoken, exactly as written. Spell out sounds such as sighs or laughter; bracketed cues may be read aloud. |
dialogue可选 | array<object> | — | 最多 20 项 | A scripted conversation, used instead of text: each line names a speaker from speakers. |
speakers可选 | array<object> | — | 最多 2 项 | The cast for dialogue: one or two voices, each with a name the lines refer to. |
voice_id可选 | string | Kore | Achernar, Achird, Algenib, Algieba, Alnilam, Aoede, Autonoe, Callirrhoe, Charon, Despina, Enceladus, Erinome, Fenrir, Gacrux, … (+16) | Prebuilt voice that reads the text. Each voice has a fixed character. |
style可选 | string | — | whisper, empathetic, vocal_smile, newscaster, promo_hype, deadpan | Overall manner of the reading. Omit it to use the voice's own default manner. |
pace可选 | string | — | natural, rapid_fire, the_drift, staccato | Rhythm of the reading. Omit it to keep the voice's own rhythm. |
accent可选 | string | — | neutral, american_general, american_valley, american_south, british_rp, british_brixton, transatlantic, australian | English accent used for the reading. |
instructions可选 | string | — | 最多 1000 个字符 | How to read the text: mood, distance from the microphone, who is listening. Shapes the delivery and is not spoken. |
scene可选 | string | — | 最多 500 个字符 | Where and to whom the words are spoken. Shapes the delivery and is not spoken. |
temperature可选 | number | — | 0 到 2 | Variation between takes; higher is less predictable. |
请求示例
这段请求原样就能运行,没写的字段都用默认值。运行前先把密钥放进环境变量 POPNOW_API_KEY。
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask?wait=60" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "google/gemini-3.8-flash-lite-tts/text-to-speech",
"input": {
"text": "Hi there! This voice was created with the PopNow API in just a few seconds."
}
}'响应里会立刻带回 taskId。之后用 GET /api/v1/jobs/recordInfo 取结果,或者在请求里加上 callBackUrl 等通知。
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
