# Gemini 3.8 Flash TTS > Generate expressive multi-speaker speech with Gemini 3.8 Flash TTS. Studio-grade voice fidelity and long-form stability. Try free, pay per use. ## Ikhtisar - **Titik akhir**: `POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts` - **ID Model**: `gemini-3-8-flash-tts` - **Kategori**: Audio AI - **Varian**: 3.8 Flash - **Keluarga**: gemini-tts - **Biaya**: _0.015 kredit per panggilan (beberapa model menghitung biaya secara dinamis berdasarkan parameter) ## Penggunaan API MuApi menggunakan pola **kirim-lalu-jajak pendapat**: kirimkan pekerjaan, dapatkan `request_id`, lalu lakukan polling titik akhir prediksi hingga `status` menjadi `selesai`. Secara opsional, teruskan `?webhook=YOUR_URL` pada panggilan kirim untuk menerima panggilan balik POST ketika pekerjaan selesai (lewati polling). **Otentikasi**: kirim kunci MuApi Anda di header `x-api-key`. Dapatkan satu di https://muapi.ai/access-keys. ### 1. Kirim tugas ```http POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts Content-Type: application/json x-api-key: YOUR_API_KEY ``` **Minimum (hanya wajib):** ```json { "speakers": [ { "speaker_id": "Speaker 1", "voice_name": "Fenrir", "audio_profile": "A stern and weary gatekeeper", "accent": "British (RP)", "style": "Deadpan", "pace": "Natural" }, { "speaker_id": "Speaker 2", "voice_name": "Puck", "audio_profile": "A determined and courageous traveler seeking answers.", "accent": "American (Gen)", "style": "Empathetic", "pace": "Staccato" } ], "dialogue_turns": [ { "speaker_id": "Speaker 1", "text": "[shouting] Halt, traveler! The northern pass is sealed by order of the council." }, { "speaker_id": "Speaker 2", "text": "[determination] I carry a message for the elder. Step aside, or I will force my way through." }, { "speaker_id": "Speaker 1", "text": "[caution] No one passes. [pensive] The elder is... he's no longer receiving visitors." }, { "speaker_id": "Speaker 2", "text": "It's too late. [whispers] The shadow... it reached him first. [urgency] You need to leave. [shouting] Now." } ] } ``` **Contoh lengkap (semua parameter):** ```json { "speakers": [ { "speaker_id": "Speaker 1", "voice_name": "Fenrir", "audio_profile": "A stern and weary gatekeeper", "accent": "British (RP)", "style": "Deadpan", "pace": "Natural" }, { "speaker_id": "Speaker 2", "voice_name": "Puck", "audio_profile": "A determined and courageous traveler seeking answers.", "accent": "American (Gen)", "style": "Empathetic", "pace": "Staccato" } ], "dialogue_turns": [ { "speaker_id": "Speaker 1", "text": "[shouting] Halt, traveler! The northern pass is sealed by order of the council." }, { "speaker_id": "Speaker 2", "text": "[determination] I carry a message for the elder. Step aside, or I will force my way through." }, { "speaker_id": "Speaker 1", "text": "[caution] No one passes. [pensive] The elder is... he's no longer receiving visitors." }, { "speaker_id": "Speaker 2", "text": "It's too late. [whispers] The shadow... it reached him first. [urgency] You need to leave. [shouting] Now." } ], "scene": "", "sample_context": "", "temperature": 1 } ``` **Tanggapan:** ```json { "request_id": "abc123", "status": "processing" } ``` ### 2. Polling hasil ```http GET https://api.muapi.ai/api/v1/predictions/{request_id}/result x-api-key: YOUR_API_KEY ``` Nilai `status` yang mungkin: `antrian`, `tertunda`, `sedang diproses`, `selesai`, `gagal`, `dibatalkan`. Jajak pendapat setiap 2-5 detik hingga terminal. Saat `selesai`, URL hasil berada dalam larik `outputs`. **Contoh respon ketika `selesai`:** ```json { "id": "abc123", "status": "completed", "outputs": [ "https://cdn.muapi.ai/.../output.png" ], "urls": { "get": "https://api.muapi.ai/api/v1/predictions/abc123/result" }, "created_at": "2026-05-08T12:34:56Z", "has_nsfw_contents": [] } ``` ### keriting ```bash 1. Kirim tugas REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts \ -H "x-api-key: $MUAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{"speakers":[{"speaker_id":"Speaker 1","voice_name":"Fenrir","audio_profile":"A stern and weary gatekeeper","accent":"British (RP)","style":"Deadpan","pace":"Natural"},{"speaker_id":"Speaker 2","voice_name":"Puck","audio_profile":"A determined and courageous traveler seeking answers.","accent":"American (Gen)","style":"Empathetic","pace":"Staccato"}],"dialogue_turns":[{"speaker_id":"Speaker 1","text":"[shouting] Halt, traveler! The northern pass is sealed by order of the council."},{"speaker_id":"Speaker 2","text":"[determination] I carry a message for the elder. Step aside, or I will force my way through."},{"speaker_id":"Speaker 1","text":"[caution] No one passes. [pensive] The elder is... he's no longer receiving visitors."},{"speaker_id":"Speaker 2","text":"It's too late. [whispers] The shadow... it reached him first. [urgency] You need to leave. [shouting] Now."}]}' | jq -r .request_id) 2. Polling hingga selesai while :; do RESP=$(curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY") STATUS=$(echo "$RESP" | jq -r .status) [ "$STATUS" = "completed" ] && echo "$RESP" | jq .outputs && break [ "$STATUS" = "failed" ] && echo "$RESP" && exit 1 sleep 3 done ``` ### ular piton ```python import os, time, requests API = "https://api.muapi.ai/api/v1" headers = {"x-api-key": os.environ["MUAPI_API_KEY"]} r = requests.post(f"{API}/gemini-3-8-flash-tts", headers=headers, json={"speakers":[{"speaker_id":"Speaker 1","voice_name":"Fenrir","audio_profile":"A stern and weary gatekeeper","accent":"British (RP)","style":"Deadpan","pace":"Natural"},{"speaker_id":"Speaker 2","voice_name":"Puck","audio_profile":"A determined and courageous traveler seeking answers.","accent":"American (Gen)","style":"Empathetic","pace":"Staccato"}],"dialogue_turns":[{"speaker_id":"Speaker 1","text":"[shouting] Halt, traveler! The northern pass is sealed by order of the council."},{"speaker_id":"Speaker 2","text":"[determination] I carry a message for the elder. Step aside, or I will force my way through."},{"speaker_id":"Speaker 1","text":"[caution] No one passes. [pensive] The elder is... he's no longer receiving visitors."},{"speaker_id":"Speaker 2","text":"It's too late. [whispers] The shadow... it reached him first. [urgency] You need to leave. [shouting] Now."}]}) request_id = r.json()["request_id"] while True: res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json() if res["status"] == "completed": print(res["outputs"]); break if res["status"] == "failed": raise RuntimeError(res.get("error")); time.sleep(3) ``` ## Skema Masukan API menerima parameter masukan berikut: - **`speakers`** (`array`, _required_): . PENGENAL . - **`speakers[].speaker_id`** (`string`, _required_): . "Pembicara N" ("Pembicara 1"). - **`speakers[].voice_name`** (`string`, _required_): kembar. - Pilihan: `"Achernar"`, `"Achird"`, `"Algenib"`, `"Algieba"`, `"Alnilam"`, `"Aoede"`, `"Autonoe"`, `"Callirrhoe"`, `"Charon"`, `"Despina"`, `"Enceladus"`, `"Erinome"`, `"Fenrir"`, `"Gacrux"`, `"Iapetus"`, `"Kore"`, `"Laomedeia"`, `"Leda"`, `"Orus"`, `"Puck"`, `"Pulcherrima"`, `"Rasalgethi"`, `"Sadachbia"`, `"Sadaltager"`, `"Schedar"`, `"Sulafat"`, `"Umbriel"`, `"Vindemiatrix"`, `"Zephyr"`, `"Zubenelgenubi"` - **`speakers[].audio_profile`** (`string`, _optional_): Optional natural-language description of the persona, e.g. "A warm and soothing narrator". - **`speakers[].accent`** (`string`, _required_): . - Bawaan: `"Neutral"` - Pilihan: `"Neutral"`, `"American (Gen)"`, `"American (Valley)"`, `"American (South)"`, `"British (RP)"`, `"British (Brixton)"`, `"Transatlantic"`, `"Australian"` - **`speakers[].style`** (`string`, _required_): . - Bawaan: `"Empathetic"` - Pilihan: `"Vocal Smile"`, `"Newscaster"`, `"Whisper"`, `"Empathetic"`, `"Promo/Hype"`, `"Deadpan"` - **`speakers[].pace`** (`string`, _required_): . - Bawaan: `"Natural"` - Pilihan: `"Natural"`, `"Rapid Fire"`, `"The Drift"`, `"Staccato"` - **`dialogue_turns`** (`array`, _required_): . pembicara_id . [berteriak] [berbisik]. - **`dialogue_turns[].speaker_id`** (`string`, _required_): ID ("Pembicara 1") . - **`dialogue_turns[].text`** (`string`, _required_): . kompatibel dengan. 10.000. - **`scene`** (`string`, _optional_): Optional scene description that sets the acoustic setting, e.g. "A quiet, warm room with a fireplace crackling softly." - Bawaan: `""` - **`sample_context`** (`string`, _optional_): Optional overall tone/style, e.g. "Audiobook style narration. Tone is gentle and inviting." - Bawaan: `""` - **`temperature`** (`number`, _optional_): (0-2) . , . - Bawaan: `1` - Jangkauan: `0` to `2` ## Skema Keluaran Titik akhir pemungutan suara mengembalikan bidang berikut: - **`id`** (`string`): ID permintaan. - **`status`** (`string`): Salah satu dari `antrian`, `pending`, `sedang diproses`, `selesai`, `gagal`, `dibatalkan`. - **`outputs`** (`array`): URL ke gambar/video/audio yang dihasilkan. Kosongkan hingga `status` menjadi `selesai`. - **`urls.get`** (`string`): Tautan mandiri untuk mengambil ulang prediksi ini. - **`error`** (`string` | `null`): Pesan kesalahan jika `status` adalah `gagal`. - **`created_at`** (`string`): Stempel waktu ISO-8601 saat permintaan dibuat. - **`has_nsfw_contents`** (`array of boolean`): Tanda deteksi NSFW per keluaran. ## Webhook (opsional) Tambahkan `?webhook=https://server-Anda/path` ke URL pengiriman. Saat tugas mencapai status terminal, MuApi akan POST dalam bentuk yang sama dengan respons polling ke URL Anda — tidak perlu polling. ## Integrasi Agen MuApi mengirimkan server MCP dan CLI sehingga agen (Claude Code, Cursor, custom) dapat memanggil endpoint ini tanpa menulis kode HTTP: ```bash # Instal CLI npm install -g muapi-cli # Autentikasi sekali muapi auth login # Paparkan semua model MuApi sebagai alat MCP kepada agen Anda muapi mcp serve ``` Server MCP menampilkan alat yang menggabungkan pengiriman + jajak pendapat untuk setiap model, termasuk `gemini-3-8-flash-tts`. Lihat `muapi --help` untuk pintasan khusus kategori (`muapi image generate`, `muapi video from-image`, dll.). ## Model Terkait - [3.1 Flash](https://muapi.ai/id/playground/gemini-3-1-flash-tts) - [2.5 Pro](https://muapi.ai/id/playground/gemini-2-5-pro-tts) - [3.8 Flash Lite](https://muapi.ai/id/playground/gemini-3-8-flash-lite-tts) - [3.8 Flash](https://muapi.ai/id/playground/gemini-3-8-flash-tts) ## Sumber daya - [Halaman Taman Bermain](https://muapi.ai/id/playground/gemini-3-8-flash-tts) - [Referensi API](https://muapi.ai/id/playground/gemini-3-8-flash-tts/api) - [llms.txt global](https://muapi.ai/id/llms.txt)