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.
- Giá cơ bản
- $0.02USD / lần chạy
- Thực thi
- async
- Loại model
- audio
- Các trường đầu vào
- 7
Thử model
Phòng thử nghiệm
Đầu ra của bạn sẽ xuất hiện ở đây
Hoàn tất đầu vào, rồi nhấp Run.
Thẻ model
Thông số kỹ thuật
Giá
- Giá cơ bản
- $0.02 / lần chạy
Ngữ cảnh & phương thức
- Đầu vào
- Định nghĩa theo schema
- Đầu ra
- audio
Tính năng
- Chat
- Không được hỗ trợ
- Thị giác
- Không được hỗ trợ
- Suy luận
- Không được hỗ trợ
- Đầu ra có cấu trúc
- Không được hỗ trợ
- Gọi hàm
- Không được hỗ trợ
- Đầu vào âm thanh
- Không được hỗ trợ
Truy cập
- Nhà cung cấp
- ID mô hình
- google/gemini-tts
- Thực thi
- async
- URL cơ sở
- https://api.sandbase.ai
- API
- Unified Run API
- Endpoint
- /v1/run
README API
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:.
Bắt đầu xây dựng
Gửi request đầu tiên của bạn
Endpoint tương thích OpenAI với xác thực và theo dõi mức sử dụng thống nhất.
# 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 đầu vào
7 tham số · 1 bắt buộc · 6 tùy chọn
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
prompt | string | Bắt buộc | 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!'). · Độ dài tối thiểu: 1 · Độ dài tối đa: 50000 |
voice | string | Tùy chọn | 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). · Tùy chọn: 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 · Mặc định: "Kore" AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKoreLaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi |
language | string | Tùy chọn | Language to speak. Omit it to detect the language from the text. · Tùy chọn: 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[] | Tùy chọn | Multi-speaker configuration. Each entry maps a speaker alias used in the prompt to a voice preset. |
tts_model | string | Tùy chọn | 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. · Tùy chọn: gemini-2.5-flash-tts, gemini-2.5-pro-tts · Mặc định: "gemini-2.5-flash-tts" gemini-2.5-flash-ttsgemini-2.5-pro-tts |
output_format | string | Tùy chọn | mp3: compressed (recommended). wav: 24 kHz 16-bit mono PCM. ogg_opus: Opus in an Ogg container. · Tùy chọn: wav, mp3, ogg_opus · Mặc định: "mp3" wavmp3ogg_opus |
style_instructions | string | Tùy chọn | Optional style and delivery instructions prepended to the prompt: tone, accent, pace, emotion. · Độ dài tối đa: 4000 |
Schema đầu ra
| Trường | Kiểu | Mô tả |
|---|---|---|
id | string | Mã định danh duy nhất cho tác vụ tạo |
status | string | Trạng thái tác vụ: pending, running, completed, failed, timeout |
model | string | Model được dùng cho quá trình tạo |
outputs | array | Mảng các mục đầu ra |
outputs[].url | string | URL của artifact đã tạo |
outputs[].content_type | string | Kiểu MIME (ví dụ image/png, video/mp4) |
error | object | null | Chi tiết lỗi nếu thất bại, null nếu thành công |
error.type | string | Mã loại lỗi có thể đọc bằng máy |
error.message | string | Mô tả lỗi dễ đọc cho người dùng |
Quy trình không đồng bộ
Model này chạy bất đồng bộ. Gửi yêu cầu, rồi thăm dò để lấy kết quả.
- Gửi: POST tới /v1/run và đọc
idđược trả về. - Thăm dò: GET /v1/run/{id} cho đến khi trạng thái là
completed,failedhoặctimeout. - Truy xuất: đọc
outputstừ phản hồi hoàn tất.
Chọn model của bạn
So sánh model
| Mô hình | Loại | Giá mặc định | Phát hành |
|---|---|---|---|
Gemini 2.5 TTSMô hình này Google | Âm thanh | $0.02 / lượt chạy | 20 thg 3, 2026 |
Google | Âm thanh | $0.04 / lượt chạy | 25 thg 9, 2026 |
Google | Âm thanh | $0.03 / lượt chạy | 25 thg 9, 2026 |
Google | Âm thanh | $0.10 / lượt chạy | 15 thg 9, 2026 |
Google | Âm thanh | $0.05 / lượt chạy | 16 thg 4, 2026 |
Google | Âm thanh | $0.08 / lượt chạy | 30 thg 3, 2026 |
Câu hỏi
FAQ
Làm thế nào để gọi Google Gemini 2.5 TTS qua SandBase?
Tạo một API key SandBase, sau đó gửi yêu cầu với model ID "google/gemini-tts" tới Unified Run API (/v1/run) tại https://api.sandbase.ai. Các ví dụ yêu cầu trên trang này cho thấy chính xác payload.
Tôi có cần tài khoản Google riêng không?
Không. Chỉ cần một API key và số dư SandBase là bạn có thể truy cập Google Gemini 2.5 TTS và các model khác trong danh mục; bạn không cần đăng ký riêng với Google.
