Gemini 3.8 Flash TTS
gemini-3.8-flash-tts
Google's text-to-speech model that supports dialogue synthesis with 1 to 2 speakers by turn; each turn's lines can have individually set tone, emotion, and speaking rate, and angle-bracket tags can control vocal details such as laughter. Suitable for character dialogue, narration, and voice-over
Try gemini-3.8-flash-tts
Input
Output
Pricing
gemini-3.8-flash-tts $0.033 $0.0264 per 1,000 characters
Overview
This text-to-speech model takes script text as input and outputs synthesized speech audio, making it suitable for character dialogue, narration, and voice-over content production. The input is organized as speaker configurations and dialogue turns: you can declare 1–2 speakers and assign a preset voice to each speaker; each line can carry its own style description for tone, emotion, and speaking rate, and the lines are synthesized in order into a single dialogue audio track. It is aimed at developers, content teams, and voice-over creators who need to generate spoken content in batches, and can be used in real production workflows such as short-drama dialogue, narrated reading, and marketing voice-overs.
Highlights
- Dialogue input organized by role — speakers and dialogue turns are configured separately; each turn specifies who is speaking, so a two-person conversation can be synthesized in a single request.
- Per-turn style descriptions — each line can include up to 2,000 characters of style text describing tone, emotion, and speaking rate, and each turn of the same speaker can be set independently.
- Inline vocal tags in lines — English angle-bracket tags can be inserted mid-sentence to control tone, for example adding a laughter tag to the text to refine performance details.
- Voices specified directly by name — each speaker just fills in a preset voice name to select a voice; names are case-sensitive, and Fola is used when left empty.
Capabilities
- Single-speaker text reading: configure one speaker and provide several lines to synthesize a script into single-speaker speech audio, suitable for narration and long-form reading.
- Two-person dialogue synthesis: declare 2 speakers with their respective voices and fill in lines alternately by turn to produce two-person dialogue audio in a single request.
- Per-turn style control: each turn can use style to describe tone, emotion, and speaking rate; different turns of the same speaker can use different styles to add nuance to the performance.
- Spoken filler-word switch: when filler_words is enabled, spoken fillers such as “um” and “ah” are inserted into the dialogue; this parameter only takes effect when exactly 2 speakers are configured.
- Inline vocal tags in lines: each line can include English angle-bracket tags to control tone; each turn's text is 1–10,000 characters, and turns are concatenated in order into the complete audio.
Use cases
- Game developers producing character dialogue — configure speakers with different voices per character, write lines and emotion descriptions turn by turn, and produce dialogue audio for story and cutscene content.
- Content teams producing narration voice-overs — use a single speaker for the narration script, set tone and speaking rate with style descriptions, and generate audio for the commentary track of videos or audio programs.
- Voice-over for marketing and social media assets — write short dialogue or spoken scripts, use per-turn styles and filler words to make the delivery more conversational, and output audio to embed in promotional assets.
Limitations and selection advice
A single request can configure at most 2 speakers and at most 100 dialogue turns; each line is 1–10,000 characters, and the style description is at most 2,000 characters. The combined lines and styles across all turns must not exceed 12,000 characters, or the entire request is rejected. filler_words only takes effect when exactly 2 speakers are configured; supplying it in a single-speaker request has no effect. Speaker identifiers must use the format Speaker followed by a space and a positive integer, and must match the values used in the turns exactly; voice names are case-sensitive, and unsupported names will not select the intended voice.
What's new
View changelog →- New model New models: Gemini 3.8 Flash TTS & Flash Lite TTS (dialogue text-to-speech)
Frequently asked questions
View all FAQs →-
How should style prompts be written?
Put style in a separate style field independent of the dialogue instead of stuffing it into text: first write the character's identity, then the emotion, and finally the speaking rate and rhythm, for example "like a tired late-night radio host, speaking slowly and dryly." style applies only to the current turn, and different turns of the same speaker can be set separately, changing the performance turn by turn.
-
How do I add laughter or pauses within a sentence?
Insert English angle-bracket tags into the sentence in text, for example Hello there. <laugh> That works. The tags are read out as vocal events rather than pronounced literally. Write the text before and after the tag as complete, readable sentences, and avoid breaking the sentence at the tag in a way that causes an abrupt change in tone.
-
How should I adjust it when the tone sounds too flat?
First, make that turn's style specific about emotion and speaking rate, then adjust temperature. temperature ranges from 0 to 2, with a default of 1; the higher the value, the greater the variation in tone and pacing. If only one particular turn sounds flat, prioritize changing that turn's style rather than raising temperature overall.
-
Can I design a new timbre from a description?
Designing timbres from text prompts and cloning audio samples are capabilities of the model itself, but this model currently only accepts preset voice names from speakers and does not support uploading samples or generating new timbres from descriptions. When you need a character-style voice, choose the closest one from the preset voices, then use the per-round style for performance fine-tuning.
Create a generation task
https://api.hiapi.sh/v1/tasks Headers
AuthorizationstringRequiredAccount API key. Required on every request. Example: Bearer YOUR_HIAPI_API_KEY. Get your API key
Content-TypestringOptionalThe request body is always parsed as JSON; when sent, only application/json (optionally with charset) is accepted — any other value returns 415. Example: application/json.
Idempotency-KeystringOptionalIdempotency key, up to 255 bytes. Retries with the same key from the same account create the task only once; replays return the original taskId.
On network timeouts or client retries, the same key creates the task only once — no double charges (scope: the API key's account). Use a business-unique identifier as the key (e.g. "order-42"); replays return the original taskId, and keys expire 24 hours after the first request. See the Unified Async API overview for the full scenario matrix.
Body
modelstringRequiredCurrent fixed value: gemini-3.8-flash-tts
routestringOptionalCurrent fixed value: default
inputobjectRequired
Business parameters for gemini-3.8-flash-tts and route default — see the parameter table below.
speakersarrayRequiredminItems 1maxItems 2
说话人配置,支持 1–2 人。每人的 speaker_id 必须与 dialogue_turns 中出现的取值一一对应;双人对话才会启用 filler_words。
Array [ object ]
Array items
speaker_idstringRequiredmaxLength 32pattern ^Speaker [1-9][0-9]*$说话人标识,格式固定为 Speaker 1、Speaker 2……(Speaker + 空格 + 正整数),需与对话轮次里的 speaker_id 完全一致。
voice_namestringOptional预置音色名,大小写敏感,未填时上游使用 Fola。examples 只是 12 个常用音色示例,不是全集(上游共 70 个音色),任何上游支持的音色名都可用;同一段对话建议不同说话人选用不同音色。
FolaKorePuckAoedeZephyrCharonLedaEnceladusShow all (4)Show less
JoriTovaEnzoIapetustemperaturenumberOptionalDefault: 1min 0max 2采样温度(0–2,默认 1)。数值越高,语气与节奏的变化越大;留空时按 1 处理。
filler_wordsbooleanOptionalDefault: false是否在对话中插入“嗯”“啊”等口语填充词,默认关闭。仅在恰好配置 2 个说话人时生效,单人请求填了也不产生效果。
dialogue_turnsarrayRequiredminItems 1maxItems 100
按顺序合成的对话轮次,一次请求最多 100 轮;每一轮的 speaker_id 必须属于 speakers 中已声明的说话人。整单所有轮次的 text 与 style 合计不超过 12,000 字符(HiAPI 整单预扣上限,足以覆盖单轮最大 10,000 字 text + 2,000 字 style)。
Array [ object ]
Array items
textstringRequiredminLength 1maxLength 10000本轮台词,1–10000 字符。可在句中插入英文尖括号标签控制语气,例如 Hello there. <laugh> That works.
stylestringOptionalmaxLength 2000本轮的说话风格,自由文本,描述语气、情绪与语速;同一说话人不同轮次可分别设置,例如“像疲惫的深夜电台主持人,语速慢而干”。
speaker_idstringRequiredmaxLength 32pattern ^Speaker [1-9][0-9]*$本轮由谁来说,取值必须是 speakers 中已声明的 speaker_id。
callbackobjectOptional
Terminal-state notification config. When omitted, no callback is delivered — poll the task yourself. See the callback note below.
Provide callback.url when creating a task and HiAPI POSTs to your service once the task reaches a terminal state — no polling needed. The callback payload mirrors the task detail structure; signature verification, delivery retries and idempotency are documented on the Unified Async API overview page.
urlstringRequiredRequired when callback is present. A POST is sent to this URL once the task reaches a terminal state; must be a valid http(s) URL.
whenstringOptionalDefault: "final"Only final is supported today — notified on both success and fail.
finalstoragestringOptionalDefault: "temp"Artifact storage tier: temp (default, retained about 7 days) or persistent (long-term, billed by size). Insufficient balance or exceeding the storage cap silently downgrades to temp; the effective tier is shown in the task detail response.
temppersistentRequest examples
# Submit an async task; returns a taskId immediately (no waiting for generation)
curl -X POST "https://api.hiapi.sh/v1/tasks" \
-H "Authorization: Bearer $HIAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.8-flash-tts",
"input": {
"speakers": "…",
"temperature": 1,
"filler_words": false,
"dialogue_turns": "…"
}
}' const res = await fetch("https://api.hiapi.sh/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HIAPI_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gemini-3.8-flash-tts",
input: {
"speakers": "…",
"temperature": 1,
"filler_words": false,
"dialogue_turns": "…"
}
}),
});
const task = await res.json();
// { code: 200, message: "success", data: { taskId } } import os, requests
res = requests.post(
"https://api.hiapi.sh/v1/tasks",
headers={"Authorization": f"Bearer {os.environ['HIAPI_API_KEY']}"},
json={
"model": "gemini-3.8-flash-tts",
"input": {
"speakers": "…",
"temperature": 1,
"filler_words": False,
"dialogue_turns": "…"
}
},
)
print(res.json()) # { code, message, data: { taskId } } 200 OK
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR"
}
} 400 Bad Request
{
"code": 400,
"message": "invalid request",
"data": null,
"error_code": "INVALID_REQUEST"
} Get task detail
https://api.hiapi.sh/v1/tasks/:id Response fields
taskIdstringRequiredTask ID, always prefixed with tk-hiapi-.
modelstringRequiredResolved full model name. Tasks submitted with the route parameter return base@route (e.g. gpt-image-2/text-to-image@ext); otherwise identical to the name passed at creation.
routestringOptionalPresent only when the task was submitted with an explicit route parameter; echoes the submitted value.
statusstringRequiredTask status.
queued Queued, not started yet.
handling Being processed.
archiving Processing finished, artifacts being prepared.
success Terminal: completed, artifacts available (output returned).
fail Terminal: failed (error returned).
After submission, check status: success and fail are terminal, everything else is non-terminal. Poll every 1–3 seconds until terminal. On success, download artifacts from output[].url and transfer them before expireAt; pass storage: "persistent" at creation time when long-term retention is needed.
creatednumberRequiredTask creation time (Unix seconds).
completednumberRequiredUnix seconds when the task reached a terminal state; fixed to 0 while not terminal.
outputarrayOptional
Present only when status == success. Artifact list — always an array; a single task may return multiple types at once (e.g. video + first_frame).
Array [ object ]
Array items
urlstringRequiredArtifact URL, directly downloadable.
typestringRequiredCurrent possible values: video, image, audio, first_frame, last_frame, thumbnail; more may be added later.
expireAtnumberRequiredUnix seconds until which the artifact remains accessible; download or transfer before it expires.
errorobjectOptional
Present only when status == fail.
codestringRequiredBusiness error code.
messagestringRequiredError description.
Response examples
Success
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-01HZTQ8BX2N3GM3YFK4Z9D7VQR",
"model": "happyhorse-1-0",
"status": "success",
"created": 1777282033,
"completed": 1777282099,
"output": [
{
"url": "https://cdn.hiapi.ai/tasks/.../video.mp4",
"type": "video",
"expireAt": 1777886899
}
]
}
} Processing (non-terminal)
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "archiving",
"created": 1777282033,
"completed": 0
}
} Failed
{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-...",
"model": "happyhorse-1-0",
"status": "fail",
"created": 1777282033,
"completed": 1777282099,
"error": {
"code": "TASK_FAILED",
"message": "task failed"
}
}
} Articles
View all articles →-
Tutorial
gemini-3.8-flash-tts in Practice: 5 High-Value TTS Application Scenarios and Implementation Essentials
-
Comparison
How to Choose gemini-3.8-flash-tts: A Side-by-Side TTS Model Comparison and Integration Decision Guide
-
Guide
Getting Started with gemini-3.8-flash-tts: Capabilities, Pricing, and Integration Practices
From capability boundaries to per-character cost estimation, helping engineering teams quickly decide whether it is worth integrating
Related Models
View all models →Same Type
-
ElevenLabs Sound Effects ElevenLabs $0.0029 /second -
Gemini 3.8 Flash Lite TTS Google $0.023 /1,000 characters -
Eleven v4 Turbo ElevenLabs $0.057 /1,000 characters -
Mirelo SFX 2.0 Mirelo AI $0.021 /second -
Seed Audio 1.0 ByteDance $0.268 per minute -
Eleven v4 ElevenLabs $0.114 /1,000 characters -
MiniMax Music 1.5 MiniMax $0.070 /song -
Qwen Audio 3.0 TTS Alibaba $0.030 /1,000 characters -
Stable Audio 3 Medium Stability AI $0.054 per audio -
MiniMax Music 3 MiniMax $0.0026 /second -
Lyria 3.5 Google $0.090 /song -
Seed Audio 1.5 $0.0012 /second
Same Provider
-
Google Virtual Try-On Google $0.107 /image -
Nano Banana Pro Google $0.029 /image -
Gemini 3.8 Flash Lite TTS Google $0.023 /1,000 characters -
Gemini 3.8 Google $0.227 /1M tokens -
Imagen 4 Google $0.030 /image -
Nano Banana 2 Google $0.018 /image -
Lyria 3.5 Google $0.090 /song -
Veo 3.1 Lite Google $0.060 /second -
Gemini 4 Google $0.057 /1M tokens -
Gemini Omni 1.2 Google $0.023 /second -
Veo 3.1 Google $0.290 /second -
Nano Banana Google $0.011 /image