# 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` - **معرف النموذج**: `gemini-3-8-flash-tts` - **الفئة**: صوت الذكاء الاصطناعي - **البديل**: 3.8 Flash - **العائلة**: gemini-tts - **التكلفة**: 0.015 أرصدة لكل مكالمة (تحسب بعض النماذج التكلفة ديناميكيًا استنادًا إلى المعلمات) ## استخدام واجهة برمجة التطبيقات يستخدم MuApi نمط **إرسال ثم استطلاع**: أرسل وظيفة، واحصل على `request_id`، ثم قم باستقصاء نقطة نهاية التنبؤات حتى ``الحالة`` مكتملة. اختياريًا، قم بتمرير `?webhook=YOUR_URL` في استدعاء الإرسال لتلقي رد اتصال POST عند انتهاء المهمة (تخطي الاستقصاء). **المصادقة**: أرسل مفتاح 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 ثواني حتى النهاية. عند "الاكتمال"، تكون عناوين URL للنتائج موجودة في مصفوفة "المخرجات". **مثال للرد عند `الاكتمال`:** ```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`): عناوين URL للصور/مقاطع الفيديو/الصوت التي تم إنشاؤها. فارغ حتى تصبح "الحالة" "مكتملة". - **`urls.get`** (`string`): الارتباط الذاتي لإعادة جلب هذا التنبؤ. - **`error`** (`string` | `null`): رسالة خطأ إذا كانت "الحالة" هي "فشل". - **`created_at`** (`string`): الطابع الزمني ISO-8601 لتاريخ إنشاء الطلب. - **`has_nsfw_contents`** (`array of boolean`): أعلام الكشف عن NSFW لكل إخراج. ## خطافات الويب (اختياري) ألحق `?webhook=https://your-server/path` بعنوان URL للإرسال. عندما تصل المهمة إلى حالة طرفية، سيقوم MuApi بنشر نفس شكل استجابة الاستقصاء لعنوان URL الخاص بك - لا حاجة إلى الاستقصاء. ## تكامل الوكيل يقوم MuApi بشحن خادم MCP وCLI حتى يتمكن الوكلاء (Claude Code، Cursor، custom) من استدعاء نقطة النهاية هذه دون كتابة كود 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 generator`، `muapi video from-image`، وما إلى ذلك). ## نماذج ذات صلة - [3.1 Flash](https://muapi.ai/ar/playground/gemini-3-1-flash-tts) - [2.5 Pro](https://muapi.ai/ar/playground/gemini-2-5-pro-tts) - [3.8 Flash Lite](https://muapi.ai/ar/playground/gemini-3-8-flash-lite-tts) - [3.8 Flash](https://muapi.ai/ar/playground/gemini-3-8-flash-tts) ## الموارد - [صفحة الملعب](https://muapi.ai/ar/playground/gemini-3-8-flash-tts) - [مرجع واجهة برمجة التطبيقات](https://muapi.ai/ar/playground/gemini-3-8-flash-tts/api) - [العالمية llms.txt](https://muapi.ai/ar/llms.txt)