# 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. ## Overview - **Eindpunt**: `POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts` - **Model ID**: `gemini-3-8-flash-tts` - **Categorie**: AI Audio - **Variant**: 3.8 Flash - **Familie**: gemini-tts - **Cost**: 0.015 credits per call (some modellen compute cost dynamically based on params) ## API Usage MuApi gebruikt het patroon **verzenden-dan-poll**: dien een taak in, verkrijg een `request_id` en peil vervolgens het eindpunt van de voorspellingen totdat `status` `voltooid` is. Optioneel kunt u `?webhook=YOUR_URL` doorgeven bij de submission-aanroep om een ​​POST-callback te ontvangen wanneer de taak is voltooid (polling overslaan). **Authenticatie**: stuur uw MuApi-sleutel in de `x-api-key` header. Koop er een op https://muapi.ai/access-keys. ### 1. Submit a job ```http POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts Content-Type: application/json x-api-key: YOUR_API_KEY ``` **Minimum (alleen vereist):** ```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." } ] } ``` **Volledig voorbeeld (alle parameters):** ```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 } ``` **Response:** ```json { "request_id": "abc123", "status": "processing" } ``` ### 2. Poll voor het resultaat ```http GET https://api.muapi.ai/api/v1/predictions/{request_id}/result x-api-key: YOUR_API_KEY ``` Mogelijke `status`-waarden: `in wachtrij geplaatst`, `in behandeling`, `verwerking`, `voltooid`, `mislukt`, `geannuleerd`. Poll elke 2-5 seconden tot de terminal. Wanneer 'voltooid', bevinden de resultaat-URL's zich in de array 'outputs'. **Voorbeeldreactie bij 'voltooid':** ```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": [] } ``` ### krul ```bash 1. Submit 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. Poll tot voltooid 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 ``` ### Python ```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) ``` ## Input Schema De API accepteert de volgende invoerparameters: - **`speakers`** (`array`, _required_): . Identiteitskaart. - **`speakers[].speaker_id`** (`string`, _required_): . "Luidspreker N" ("Luidspreker 1"). - **`speakers[].voice_name`** (`string`, _required_): Tweeling. - Options: `"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_): voor verzoek-/poll-workflows en door de server verzonden gebeurtenissen - Default: `"Neutral"` - Options: `"Neutral"`, `"American (Gen)"`, `"American (Valley)"`, `"American (South)"`, `"British (RP)"`, `"British (Brixton)"`, `"Transatlantic"`, `"Australian"` - **`speakers[].style`** (`string`, _required_): voor verzoek-/poll-workflows en door de server verzonden gebeurtenissen - Default: `"Empathetic"` - Options: `"Vocal Smile"`, `"Newscaster"`, `"Whisper"`, `"Empathetic"`, `"Promo/Hype"`, `"Deadpan"` - **`speakers[].pace`** (`string`, _required_): voor verzoek-/poll-workflows en door de server verzonden gebeurtenissen - Default: `"Natural"` - Options: `"Natural"`, `"Rapid Fire"`, `"The Drift"`, `"Staccato"` - **`dialogue_turns`** (`array`, _required_): . luidspreker_id . [schreeuwt] [fluistert] . - **`dialogue_turns[].speaker_id`** (`string`, _required_): ID ("Luidspreker 1") . - **`dialogue_turns[].text`** (`string`, _required_): . compatibel met. 10000 . - **`scene`** (`string`, _optional_): Optional scene description that sets the acoustic setting, e.g. "A quiet, warm room with a fireplace crackling softly." - Default: `""` - **`sample_context`** (`string`, _optional_): Optional overall tone/style, e.g. "Audiobook style narration. Tone is gentle and inviting." - Default: `""` - **`temperature`** (`number`, _optional_): (0-2). , . - Default: `1` - Range: `0` to `2` ## Resultaat Schema Het polling-eindpunt retourneert de volgende velden: - **`id`** (`string`): De aanvraag-ID. - **`status`** (`string`): Eén van de opties 'in wachtrij', 'in behandeling', 'bezig met verwerken', 'voltooid', 'mislukt', 'geannuleerd'. - **`outputs`** (`array`): URL's naar gegenereerde afbeeldingen/video's/audio. Leeg totdat `status` `voltooid` is. - **`urls.get`** (`string`): Zelfkoppeling om deze voorspelling opnieuw op te halen. - **`error`** (`string` | `null`): Foutmelding als `status` `mislukt` is. - **`created_at`** (`string`): ISO-8601-tijdstempel van het moment waarop de aanvraag is gemaakt. - **`has_nsfw_contents`** (`array of boolean`): NSFW-detectievlaggen per uitgang. ## Webhooks (optional) Voeg `?webhook=https://uw-server/pad` toe aan de verzend-URL. Wanneer de taak een eindstatus bereikt, POST MuApi dezelfde vorm als het polling-antwoord op uw URL - geen polling nodig. ## Agent Integration MuApi levert een MCP-server en CLI zodat agenten (Claude Code, Cursor, aangepast) dit eindpunt kunnen aanroepen zonder HTTP-code te schrijven: ```bash # Installeer de CLI npm install -g muapi-cli # Authenticate once muapi auth login # Expose all MuApi modellen as MCP tools to your agent muapi mcp serve ``` De MCP-server stelt tools beschikbaar die verzend + poll voor elk model inpakken, inclusief `gemini-3-8-flash-tts`. Zie `muapi --help` voor categoriespecifieke snelkoppelingen (`muapi image genereren`, `muapi video from-image`, etc.). ## Related Models - [3.1 Flash](https://muapi.ai/nl/playground/gemini-3-1-flash-tts) - [2.5 Pro](https://muapi.ai/nl/playground/gemini-2-5-pro-tts) - [3.8 Flash Lite](https://muapi.ai/nl/playground/gemini-3-8-flash-lite-tts) - [3.8 Flash](https://muapi.ai/nl/playground/gemini-3-8-flash-tts) ## Bronnen - [Playground Page](https://muapi.ai/nl/playground/gemini-3-8-flash-tts) - [API Reference](https://muapi.ai/nl/playground/gemini-3-8-flash-tts/api) - [Global llms.txt](https://muapi.ai/nl/llms.txt)