PopNowAPI 文档
正文

Gemini 3.8 Flash TTS API 调用参考

富有表现力的语音,能演出 [laughing] 这类提示

用一个 PopNow API 密钥,就能在自己的代码里调用 Gemini 3.8 Flash TTS。下面列出要填的调用名、这个型号接受的每个输入字段、每次请求花多少积分,以及一段可以直接粘进终端运行的请求。

参数说明直接取自型号的输入 schema,暂时只有英文。

一览

出品方
Google
产出
音频
起价
0.05 积分 每秒成片 ($0.0005)
一般耗时
约 11 秒

1 积分 = 0.01 美元。任务受理时先冻结可能的最高费用,完成后按实际用量结算、向上取整到整积分,多冻的退回;失败的任务不扣积分。想在运行前知道确切数字,先调 POST /api/v1/jobs/quote。

文字转语音

google/gemini-3.8-flash-tts/text-to-speech

价格

选项积分 (每秒成片)美元
默认0.05$0.0005

参数

字段类型默认值取值范围作用
text可选string—最多 5000 个字符The words to be spoken, exactly as written. Direction such as [whispering] or [sighs] goes into the text itself.
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可选stringKoreAchernar, 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, deadpanOverall manner of the reading. Omit it to use the voice's own default manner.
pace可选string—natural, rapid_fire, the_drift, staccatoRhythm 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, australianEnglish 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 到 2Variation between takes; higher is less predictable.

请求示例

这段请求原样就能运行,没写的字段都用默认值。运行前先把密钥放进环境变量 POPNOW_API_KEY。

POST /api/v1/jobs/createTask?wait=60
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 等通知。

GET /api/v1/jobs/recordInfo
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

接下来

本页内容