# 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. ## نمای کلی - **نقطه پایانی**: `POST https://api.muapi.ai/api/v1/gemini-3-8-flash-tts` - **مدل‌ها ID**: `gemini-3-8-flash-tts` - **دسته‌بندی**: AI صدا - **نسخه مدل**: 3.8 Flash - **خانواده مدل**: gemini-tts - **هزینه**: 0.015 credits(مدل‌ها) ## API MuApi ****:, `request_id`,, `status` `completed`。 `?webhook=YOUR_URL`, POST ()。 ****: `x-api-key` MuApi 。 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 ``` `status` :`queued`、`pending`、`processing`、`completed`、`failed`、`cancelled`。 2–5 ,。 `completed` ,نتیجه URL `outputs` 。 **`completed` :** ```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 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) API : - **`speakers`** (`array`, __): تنظیم پارامتر List of speaker voice configurations. Each dialogue turn references a speaker by its ID. جهت هدایت دقیق فرآیند تولید مدل. - **`speakers[].speaker_id`** (`string`, __): تنظیم پارامتر Speaker identifier. Must be in "Speaker N" format (e.g. "Speaker 1"). جهت هدایت دقیق فرآیند تولید مدل. - **`speakers[].voice_name`** (`string`, __): تنظیم پارامتر Prebuilt Gemini voice name. جهت هدایت دقیق فرآیند تولید مدل. - گزینه‌ها: `"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`, __): اختیاری natural-language description of the persona, e.g. "A warm and soothing narrator". - **`speakers[].accent`** (`string`, __): تنظیم پارامتر Speaking accent. جهت هدایت دقیق فرآیند تولید مدل. - پیش‌فرض: `"Neutral"` - گزینه‌ها: `"Neutral"`, `"American (Gen)"`, `"American (Valley)"`, `"American (South)"`, `"British (RP)"`, `"British (Brixton)"`, `"Transatlantic"`, `"Australian"` - **`speakers[].style`** (`string`, __): تنظیم پارامتر Emotional delivery style. جهت هدایت دقیق فرآیند تولید مدل. - پیش‌فرض: `"Empathetic"` - گزینه‌ها: `"Vocal Smile"`, `"Newscaster"`, `"Whisper"`, `"Empathetic"`, `"Promo/Hype"`, `"Deadpan"` - **`speakers[].pace`** (`string`, __): تنظیم پارامتر Speaking pace. جهت هدایت دقیق فرآیند تولید مدل. - پیش‌فرض: `"Natural"` - گزینه‌ها: `"Natural"`, `"Rapid Fire"`, `"The Drift"`, `"Staccato"` - **`dialogue_turns`** (`array`, __): تنظیم پارامتر Ordered list of dialogue lines. Each turn's speaker_id must match a speaker defined above. Text may include tone tags like [shouting] or [whispers]. جهت هدایت دقیق فرآیند تولید مدل. - **`dialogue_turns[].speaker_id`** (`string`, __): تنظیم پارامتر ID of the speaker delivering this line (e.g. "Speaker 1"). جهت هدایت دقیق فرآیند تولید مدل. - **`dialogue_turns[].text`** (`string`, __): تنظیم پارامتر The line to speak. Supports inline tone tags. Max 10000 characters. جهت هدایت دقیق فرآیند تولید مدل. - **`scene`** (`string`, __): اختیاری scene description that sets the acoustic setting, e.g. "A quiet, warm room with a fireplace crackling softly." - پیش‌فرض: `""` - **`sample_context`** (`string`, __): اختیاری overall tone/style, e.g. "Audiobook style narration. Tone is gentle and inviting." - پیش‌فرض: `""` - **`temperature`** (`number`, __): دمای تصادفی بودن خروجی؛ مقادیر بالاتر خروجی متنوع‌تر و مقادیر کمتر نتایج دقیق‌تری می‌دهند. - پیش‌فرض: `1` - بازه مجاز: `0` to `2` ## طرح خروجی (Output Schema) : - **`id`** (`string`): ID。 - **`status`** (`string`): :`queued`、`pending`、`processing`、`completed`、`failed`、`cancelled`。 - **`outputs`** (`array`): تصویر、ویدیوصدا URL。`status` `completed` 。 - **`urls.get`** (`string`): نتیجه。 - **`error`** (`string` | `null`): `status` `failed` 。 - **`created_at`** (`string`): ISO-8601 。 - **`has_nsfw_contents`** (`array of boolean`): NSFW 。 ## Webhook() URL `?webhook=https://your-server/path`。,MuApi POST URL,。 ## Agent MuApi MCP CLI, Agent(Claude Code、Cursor Agent) HTTP : ```bash # CLI npm install -g muapi-cli # muapi auth login # MuApi مدل‌ها MCP 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/fa/playground/gemini-3-1-flash-tts) - [2.5 Pro](https://muapi.ai/fa/playground/gemini-2-5-pro-tts) - [3.8 Flash Lite](https://muapi.ai/fa/playground/gemini-3-8-flash-lite-tts) - [3.8 Flash](https://muapi.ai/fa/playground/gemini-3-8-flash-tts) ## منابع و مستندات - [زمین بازی](https://muapi.ai/fa/playground/gemini-3-8-flash-tts) - [API ](https://muapi.ai/fa/playground/gemini-3-8-flash-tts/api) - [ llms.txt](https://muapi.ai/fa/llms.txt)