# 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. ## Aperçu - **Endpoint**: `POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts` - **ID du modèle**: `gemini-3-8-flash-tts` - **Catégorie**: Audio IA - **Variante**: 3.8 Flash - **Famille**: gemini-tts - **Coût**: 0.015 crédits par appel (certains modèles calculent le coût de manière dynamique en fonction des paramètres) ## Utilisation de l'API MuApi utilise un modèle **submit-then-poll** : soumettez une tâche, obtenez un `request_id`, puis interrogez le point de terminaison des prédictions jusqu'à ce que le `statut` soit `terminé`. Transmettez éventuellement `?webhook=YOUR_URL` lors de l'appel de soumission pour recevoir un rappel POST lorsque le travail est terminé (ignorer l'interrogation). **Authentification** : envoyez votre clé MuApi dans l'en-tête `x-api-key`. Obtenez-en un à https://muapi.ai/access-keys. ### 1. Soumettre une tâche ```http POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts Content-Type: application/json x-api-key: YOUR_API_KEY ``` **Minimum (obligatoire seulement) :** ```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." } ] } ``` **Exemple complet (tous les paramètres) :** ```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 } ``` **Réponse :** ```json { "request_id": "abc123", "status": "processing" } ``` ### 2. Interroger le résultat (Polling) ```http GET https://api.muapi.ai/api/v1/predictions/{request_id}/result x-api-key: YOUR_API_KEY ``` Valeurs de « statut » possibles : « en file d'attente », « en attente », « en cours de traitement », « terminé », « en échec », « annulé ». Sondez toutes les 2 à 5 secondes jusqu'au terminal. Une fois « terminé », les URL de résultat sont dans le tableau « sorties ». **Exemple de réponse lorsque « terminé » :** ```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": [] } ``` ### cURL ```bash 1. Soumettre une tâche 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. Interroger jusqu'à la fin 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) ``` ## Schéma d'entrée L'API accepte les paramètres d'entrée suivants : - **`speakers`** (`array`, _required_): . IDENTIFIANT . - **`speakers[].speaker_id`** (`string`, _required_): . « Haut-parleur N » (« Haut-parleur 1 »). - **`speakers[].voice_name`** (`string`, _required_): Gémeaux. - Possibilités: `"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_): . - Par défaut: `"Neutral"` - Possibilités: `"Neutral"`, `"American (Gen)"`, `"American (Valley)"`, `"American (South)"`, `"British (RP)"`, `"British (Brixton)"`, `"Transatlantic"`, `"Australian"` - **`speakers[].style`** (`string`, _required_): . - Par défaut: `"Empathetic"` - Possibilités: `"Vocal Smile"`, `"Newscaster"`, `"Whisper"`, `"Empathetic"`, `"Promo/Hype"`, `"Deadpan"` - **`speakers[].pace`** (`string`, _required_): . - Par défaut: `"Natural"` - Possibilités: `"Natural"`, `"Rapid Fire"`, `"The Drift"`, `"Staccato"` - **`dialogue_turns`** (`array`, _required_): . haut-parleur_id . [criant] [chuchotant] . - **`dialogue_turns[].speaker_id`** (`string`, _required_): ID ("Haut-parleur 1") . - **`dialogue_turns[].text`** (`string`, _required_): . compatible avec. 10000. - **`scene`** (`string`, _optional_): Optional scene description that sets the acoustic setting, e.g. "A quiet, warm room with a fireplace crackling softly." - Par défaut: `""` - **`sample_context`** (`string`, _optional_): Optional overall tone/style, e.g. "Audiobook style narration. Tone is gentle and inviting." - Par défaut: `""` - **`temperature`** (`number`, _optional_): (0-2) . , . - Par défaut: `1` - Gamme: `0` to `2` ## Schéma de sortie Le point de terminaison d'interrogation renvoie les champs suivants : - **`id`** (`string`): L’ID de la demande. - **`status`** (`string`): L'un des éléments suivants : "en file d'attente", "en attente", "en cours de traitement", "terminé", "échoué", "annulé". - **`outputs`** (`array`): URL vers les images/vidéos/audio générés. Vide jusqu'à ce que le « statut » soit « terminé ». - **`urls.get`** (`string`): Créez un lien automatique pour récupérer cette prédiction. - **`error`** (`string` | `null`): Message d'erreur si le « statut » est « échec ». - **`created_at`** (`string`): Horodatage ISO-8601 indiquant le moment où la demande a été créée. - **`has_nsfw_contents`** (`array of boolean`): Indicateurs de détection NSFW par sortie. ## Webhooks (facultatif) Ajoutez `?webhook=https://your-server/path` à l'URL de soumission. Lorsque la tâche atteint un état terminal, MuApi POSTera la même forme que la réponse à l'interrogation sur votre URL — aucune interrogation n'est nécessaire. ## Intégration des agents MuApi fournit un serveur MCP et une CLI afin que les agents (Claude Code, Cursor, personnalisé) puissent appeler ce point de terminaison sans écrire de code HTTP : ```bash # Installer la CLI npm install -g muapi-cli # Authentification unique muapi auth login # Expose all MuApi models as MCP tools to your agent muapi mcp serve ``` Le serveur MCP expose des outils qui encapsulent la soumission + le sondage pour chaque modèle, y compris `gemini-3-8-flash-tts`. Voir `muapi --help` pour les raccourcis spécifiques à la catégorie (`muapi image generate`, `muapi video from-image`, etc.). ## Modèles associés - [3.1 Flash](https://muapi.ai/fr/playground/gemini-3-1-flash-tts) - [2.5 Pro](https://muapi.ai/fr/playground/gemini-2-5-pro-tts) - [3.8 Flash Lite](https://muapi.ai/fr/playground/gemini-3-8-flash-lite-tts) - [3.8 Flash](https://muapi.ai/fr/playground/gemini-3-8-flash-tts) ## Ressources - [Page du terrain de jeu](https://muapi.ai/fr/playground/gemini-3-8-flash-tts) - [Référence API](https://muapi.ai/fr/playground/gemini-3-8-flash-tts/api) - [llms.txt global](https://muapi.ai/fr/llms.txt)