Gemini 3.8 Flash TTS API 调用参考
表现力丰富的语音合成,支持 [laughing] 等情感提示
用一个 PopNow API 密钥,就能在自己的代码里调用 Gemini 3.8 Flash TTS。下面列出要填的调用名、这个型号接受的每个输入字段、每次请求花多少美元(USD),以及一段可以直接粘进终端运行的请求。
参数说明直接取自型号的输入 schema,暂时只有英文。
一览
- 出品方
- 产出
- 音频
- 起价
- $0.00032 USD 每秒成片
- 一般耗时
- 约 22 秒
价格以 USD 显示,从你的 PopNow 余额扣款。任务受理时预留可能的最高费用,完成后按实际用量结算并释放余款;失败任务不收费。运行前可调用 POST /api/v1/jobs/quote 获取准确报价。
文字转语音
google/gemini-3.8-flash-tts/text-to-speech
价格
| 选项 | USD |
|---|---|
默认 | $0.00032 每秒成片 |
参数
| 字段 | 类型 | 默认值 | 取值范围 | 作用 |
|---|---|---|---|---|
text可选 | string | — | 最多 10000 个字符 | Words to speak, up to 10,000 characters. Native inline cues include <laugh>, <sigh> and <short pause>. |
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, Arlo, Autonoe, Bodi, Brio, Callirrhoe, Charon, Cleo, Cruz, … (+56) | 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. |
filler_words可选 | boolean | false | — | Allow filler words in a two-speaker conversation. Has no effect on single-speaker requests. |
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-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"
