# 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. ## सिंहावलोकन - **Endpoint**: `POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts` - **मॉडल आईडी**: `gemini-3-8-flash-tts` - **श्रेणी**: एआई ऑडियो - **वैरिएंट**: 3.8 Flash - **परिवार**: gemini-tts - **लागत**: 0.015 प्रति कॉल क्रेडिट (कुछ मॉडल पैरामीटर के आधार पर गतिशील रूप से लागत की गणना करते हैं) ## एपीआई उपयोग MuApi **submit-then-poll** पैटर्न का उपयोग करता है: एक नौकरी सबमिट करें, एक `request_id` प्राप्त करें, फिर `status` `पूरा` होने तक पूर्वानुमान समापन बिंदु पर पोल करें। वैकल्पिक रूप से कार्य समाप्त होने पर POST कॉलबैक प्राप्त करने के लिए सबमिट कॉल पर `?webhook=YOUR_URL` पास करें (मतदान छोड़ें)। **प्रमाणीकरण**: अपनी MuApi कुंजी को `x-api-key` हेडर में भेजें। https://muapi.ai/access-keys पर एक प्राप्त करें। ### 1. कार्य सबमिट करें ```http POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts Content-Type: application/json x-api-key: YOUR_API_KEY ``` **न्यूनतम (केवल आवश्यक):** ```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." } ] } ``` **पूर्ण उदाहरण (सभी पैरामीटर):** ```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 } ``` **प्रतिक्रिया:** ```json { "request_id": "abc123", "status": "processing" } ``` ### 2. परिणाम पोल करें ```http GET https://api.muapi.ai/api/v1/predictions/{request_id}/result x-api-key: YOUR_API_KEY ``` संभावित `स्थिति` मान: `कतारबद्ध`, `लंबित`, `प्रसंस्करण`, `पूर्ण`, `विफल`, `रद्द`। टर्मिनल तक हर 2-5 सेकंड में मतदान करें। जब `पूर्ण` होता है, तो परिणाम यूआरएल `आउटपुट` सरणी में होते हैं। **'पूरा' होने पर उदाहरण प्रतिक्रिया:** ```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. कार्य सबमिट करें 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. पूर्ण होने तक पोल करें 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) ``` ## इनपुट स्कीमा एपीआई निम्नलिखित इनपुट पैरामीटर स्वीकार करता है: - **`speakers`** (`array`, _required_): । पहचान । - **`speakers[].speaker_id`** (`string`, _required_): . "स्पीकर एन" ("स्पीकर 1")। - **`speakers[].voice_name`** (`string`, _required_): मिथुन. - विकल्प: `"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_): . - डिफ़ॉल्ट: `"Neutral"` - विकल्प: `"Neutral"`, `"American (Gen)"`, `"American (Valley)"`, `"American (South)"`, `"British (RP)"`, `"British (Brixton)"`, `"Transatlantic"`, `"Australian"` - **`speakers[].style`** (`string`, _required_): . - डिफ़ॉल्ट: `"Empathetic"` - विकल्प: `"Vocal Smile"`, `"Newscaster"`, `"Whisper"`, `"Empathetic"`, `"Promo/Hype"`, `"Deadpan"` - **`speakers[].pace`** (`string`, _required_): . - डिफ़ॉल्ट: `"Natural"` - विकल्प: `"Natural"`, `"Rapid Fire"`, `"The Drift"`, `"Staccato"` - **`dialogue_turns`** (`array`, _required_): . स्पीकर_आईडी। [चिल्लाते हुए] [फुसफुसाते हुए]। - **`dialogue_turns[].speaker_id`** (`string`, _required_): आईडी ("स्पीकर 1") . - **`dialogue_turns[].text`** (`string`, _required_): . के साथ संगत। 10000 . - **`scene`** (`string`, _optional_): Optional scene description that sets the acoustic setting, e.g. "A quiet, warm room with a fireplace crackling softly." - डिफ़ॉल्ट: `""` - **`sample_context`** (`string`, _optional_): Optional overall tone/style, e.g. "Audiobook style narration. Tone is gentle and inviting." - डिफ़ॉल्ट: `""` - **`temperature`** (`number`, _optional_): (0-2) . , . - डिफ़ॉल्ट: `1` - रेंज: `0` to `2` ## आउटपुट स्कीमा मतदान समापन बिंदु निम्नलिखित फ़ील्ड लौटाता है: - **`id`** (`string`): अनुरोध आईडी. - **`status`** (`string`): `कतारबद्ध`, `लंबित`, `प्रसंस्करण`, `पूर्ण`, `असफल`, `रद्द` में से एक। - **`outputs`** (`array`): उत्पन्न छवियों/वीडियो/ऑडियो के यूआरएल। `स्थिति` `पूर्ण` होने तक खाली रखें। - **`urls.get`** (`string`): इस भविष्यवाणी को पुनः प्राप्त करने के लिए स्व-लिंक। - **`error`** (`string` | `null`): यदि `स्थिति` `विफल` है तो त्रुटि संदेश। - **`created_at`** (`string`): अनुरोध कब बनाया गया था इसका आईएसओ-8601 टाइमस्टैम्प। - **`has_nsfw_contents`** (`array of boolean`): प्रति-आउटपुट NSFW पहचान झंडे। ## वेबहुक (वैकल्पिक) सबमिट URL में `?webhook=https://your-server/path` जोड़ें। जब कार्य अंतिम स्थिति में पहुंच जाता है, तो MuApi आपके URL पर पोलिंग प्रतिक्रिया के समान आकार में पोस्ट करेगा - किसी पोलिंग की आवश्यकता नहीं है। ## एजेंट एकीकरण MuApi एक MCP सर्वर और CLI शिप करता है ताकि एजेंट (क्लाउड कोड, कर्सर, कस्टम) HTTP कोड लिखे बिना इस एंडपॉइंट को कॉल कर सकें: ```bash # CLI स्थापित करें npm install -g muapi-cli # एक बार प्रमाणित करें muapi auth login # Expose all MuApi models as MCP tools to your agent muapi mcp serve ``` MCP सर्वर उन टूल को प्रदर्शित करता है जो `gemini-3-8-flash-tts` सहित प्रत्येक मॉडल के लिए सबमिट + पोल को लपेटते हैं। श्रेणी-विशिष्ट शॉर्टकट के लिए `muapi --help` देखें (`muapi image generate`, `muapi video from-image`, आदि)। ## संबंधित मॉडल - [3.1 Flash](https://muapi.ai/hi/playground/gemini-3-1-flash-tts) - [2.5 Pro](https://muapi.ai/hi/playground/gemini-2-5-pro-tts) - [3.8 Flash Lite](https://muapi.ai/hi/playground/gemini-3-8-flash-lite-tts) - [3.8 Flash](https://muapi.ai/hi/playground/gemini-3-8-flash-tts) ## संसाधन - [खेल का मैदान पृष्ठ](https://muapi.ai/hi/playground/gemini-3-8-flash-tts) - [एपीआई संदर्भ](https://muapi.ai/hi/playground/gemini-3-8-flash-tts/api) - [वैश्विक llms.txt](https://muapi.ai/hi/llms.txt)