Gemini 2.5 TTS
google/gemini-ttsGemini 2.5 TTS by Google turns text into expressive speech with 30 voices, single- or multi-speaker dialogue, and natural-language style control in 80+ languages, using the Flash or Pro TTS model.
- 基礎價格
- $0.02美元/次執行
- 執行
- async
- 模型類型
- audio
- 輸入欄位
- 7
試用這個模型
Playground
您的輸出會顯示在這裡
完成輸入後,點擊執行。
模型卡片
規格
定價
- 基本價格
- $0.02/次執行
上下文與多模態
- 輸入
- 由結構定義
- 輸出
- audio
功能
- 聊天
- 不支援
- 視覺
- 不支援
- 推理
- 不支援
- 結構化輸出
- 不支援
- 函式呼叫
- 不支援
- 音訊輸入
- 不支援
存取
- 供應商
- 模型 ID
- google/gemini-tts
- 執行
- async
- 基礎 URL
- https://api.sandbase.ai
- API
- Unified Run API
- 端點
- /v1/run
API README
Gemini 2.5 TTS
Gemini 2.5 TTS speaks text with 30 preset voices, supports two-speaker dialogue and natural-language style direction, and covers 80+ languages. Choose Flash for speed or Pro for the highest quality.
Fields
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Text to speak, up to 50,000 characters; inline cues such as [whispering] work. |
tts_model | gemini-2.5-flash-tts / gemini-2.5-pro-tts | gemini-2.5-flash-tts | Flash is faster and cheaper; Pro has the best quality. |
voice | string | Kore | Single-speaker voice preset; ignored when speakers is set. See the schema for supported values. |
style_instructions | string | — | Tone, accent, pace, or emotion, up to 4,000 characters. |
speakers | array of {speaker_id, voice} | — | Multi-speaker setup; prefix prompt lines with each speaker_id. |
language | string | — | Language to speak; omit to auto-detect. See the schema for supported values. |
output_format | wav / mp3 / ogg_opus | mp3 | Audio file format. |
Billing
$0.02 per 1,000 characters of prompt with Flash, $0.04 with Pro, billed per character with a $0.01 minimum per request.
| Text | Flash | Pro |
|---|---|---|
| 200 characters | $0.01 | $0.01 |
| 1,000 characters | $0.02 | $0.04 |
| 10,000 characters | $0.20 | $0.40 |
Failed runs are not charged.
Prompting
- Put stable style direction in
style_instructionsand keeppromptfor the words to speak. - For dialogue, define each speaker in
speakersand start every line withAlias:.
開始建置
送出您的第一個請求
具備統一驗證與用量追蹤的 OpenAI 相容端點。
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "google/gemini-tts",
"voice": "Kore",
"prompt": "Host: Welcome back to AI Frontiers, the podcast where we explore the latest breakthroughs in artificial intelligence. Today we have a very special guest. Doctor Chen, thank you for joining us!\nDrChen: Thanks for having me! I'm excited to be here.\nHost: So, let's dive right in. Your recent paper on neural architecture search has been making waves. Can you tell our listeners what inspired this research?\nDrChen: Absolutely. It all started when we noticed that most existing approaches were optimizing for the wrong metrics. We asked ourselves, what if we could let the model design itself?",
"language": "English (US)",
"speakers": [
[
{
"voice": "Charon",
"speaker_id": "Host"
},
{
"voice": "Kore",
"speaker_id": "DrChen"
}
]
],
"tts_model": "gemini-2.5-flash-tts",
"output_format": "mp3",
"style_instructions": "Say the following in a warm, conversational tone"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"輸入 Schema
7 個參數 · 1 個必要 · 6 個選用
| 參數 | 類型 | 必要 | 說明 |
|---|---|---|---|
prompt | string | 必要 | Text to speak, up to 50,000 characters. Inline delivery cues work (e.g. 'Say cheerfully: Have a wonderful day!', [whispering], [slowly]). For multi-speaker synthesis, prefix lines with the speaker aliases defined in speakers (e.g. 'Alice: Hello!\nBob: Hi!'). · 最小長度:1 · 最大長度:50000 |
voice | string | 選用 | Voice preset for single-speaker synthesis; ignored when speakers is set. Popular: Kore (firm female), Puck (upbeat male), Charon (calm male), Zephyr (bright female), Aoede (warm female). · 選項:Achernar, Achird, Algenib, Algieba, Alnilam, Aoede, Autonoe, Callirrhoe, Charon, Despina, Enceladus, Erinome, Fenrir, Gacrux, Iapetus, Kore, Laomedeia, Leda, Orus, Pulcherrima, Puck, Rasalgethi, Sadachbia, Sadaltager, Schedar, Sulafat, Umbriel, Vindemiatrix, Zephyr, Zubenelgenubi · 預設值:"Kore" AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKoreLaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi |
language | string | 選用 | Language to speak. Omit it to detect the language from the text. · 選項: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), 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) 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)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[] | 選用 | Multi-speaker configuration. Each entry maps a speaker alias used in the prompt to a voice preset. |
tts_model | string | 選用 | gemini-2.5-flash-tts: low latency and lower cost. gemini-2.5-pro-tts: highest quality, for podcasts, audiobooks, and other structured long-form speech. · 選項:gemini-2.5-flash-tts, gemini-2.5-pro-tts · 預設值:"gemini-2.5-flash-tts" gemini-2.5-flash-ttsgemini-2.5-pro-tts |
output_format | string | 選用 | mp3: compressed (recommended). wav: 24 kHz 16-bit mono PCM. ogg_opus: Opus in an Ogg container. · 選項:wav, mp3, ogg_opus · 預設值:"mp3" wavmp3ogg_opus |
style_instructions | string | 選用 | Optional style and delivery instructions prepended to the prompt: tone, accent, pace, emotion. · 最大長度:4000 |
輸出 Schema
| 欄位 | 類型 | 說明 |
|---|---|---|
id | string | 生成任務的唯一識別碼 |
status | string | 任務狀態:pending、running、completed、failed、timeout |
model | string | 用於生成的模型 |
outputs | array | 輸出項目陣列 |
outputs[].url | string | 生成產物的 URL |
outputs[].content_type | string | MIME 類型(例如 image/png、video/mp4) |
error | object | null | 若失敗則顯示錯誤詳細資訊;成功時為 null |
error.type | string | 機器可讀的錯誤類型代碼 |
error.message | string | 可供人閱讀的錯誤描述 |
非同步流程
這個模型會非同步執行。請先送出請求,接著輪詢結果。
- 送出:對 /v1/run 發送 POST,並讀取回傳的
id。 - 輪詢:以 GET /v1/run/{id} 持續查詢,直到狀態為
completed、failed或timeout。 - 擷取:從已完成的回應中讀取
outputs。
選擇您的模型
比較模型
| 模型 | 類型 | 預設價格 | 發布時間 |
|---|---|---|---|
Google | 音訊 | $0.02 / 次執行 | 2026年3月20日 |
Google | 音訊 | $0.04 / 次執行 | 2026年9月25日 |
Google | 音訊 | $0.03 / 次執行 | 2026年9月25日 |
Google | 音訊 | $0.10 / 次執行 | 2026年9月15日 |
Google | 音訊 | $0.05 / 次執行 | 2026年4月16日 |
Google | 音訊 | $0.08 / 次執行 | 2026年3月30日 |
問題
常見問題
我要如何透過 SandBase 呼叫 Google Gemini 2.5 TTS?
先建立一組 SandBase API 金鑰,接著使用模型 ID「google/gemini-tts」向 https://api.sandbase.ai 的 Unified Run API (/v1/run) 發送請求。此頁的請求範例會顯示完整的 payload。
我需要另外申請 Google 帳號嗎?
不需要。一組 SandBase API 金鑰與餘額即可讓您存取 Google Gemini 2.5 TTS 以及目錄中的其他模型;您不需要另外註冊 Google。
