# 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 เครดิตต่อการโทร (บางรุ่นคำนวณต้นทุนแบบไดนามิกตามพารามิเตอร์) ## การใช้งาน API 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": [] } ``` ### ม้วนผม ```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) ``` ## สคีมาอินพุต API ยอมรับพารามิเตอร์อินพุตต่อไปนี้: - **`speakers`** (`array`, _required_): . บัตรประจำตัว - **`speakers[].speaker_id`** (`string`, _required_): . "ลำโพง N" ("ลำโพง 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_): . ลำโพง_id [ตะโกน] [กระซิบ] . - **`dialogue_turns[].speaker_id`** (`string`, _required_): ID ( "ลำโพง 1") . - **`dialogue_turns[].text`** (`string`, _required_): . เข้ากันได้กับ 10,000 . - **`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, เคอร์เซอร์, กำหนดเอง) สามารถเรียกตำแหน่งข้อมูลนี้ได้โดยไม่ต้องเขียนรหัส HTTP: ```bash # ติดตั้ง CLI npm install -g muapi-cli # Authenticate once muapi auth login # เปิดเผยโมเดล MuApi ทั้งหมดเป็นเครื่องมือ MCP ให้กับตัวแทนของคุณ muapi mcp serve ``` เซิร์ฟเวอร์ MCP เปิดเผยเครื่องมือที่รวมการส่ง + โพลสำหรับทุกรุ่น รวมถึง `gemini-3-8-flash-tts` ดู `muapi --help` สำหรับทางลัดเฉพาะหมวดหมู่ (`muapi image create`, `muapi video from-image` ฯลฯ) ## รุ่นที่เกี่ยวข้อง - [3.1 Flash](https://muapi.ai/th/playground/gemini-3-1-flash-tts) - [2.5 Pro](https://muapi.ai/th/playground/gemini-2-5-pro-tts) - [3.8 Flash Lite](https://muapi.ai/th/playground/gemini-3-8-flash-lite-tts) - [3.8 Flash](https://muapi.ai/th/playground/gemini-3-8-flash-tts) ## ทรัพยากร - [หน้าสนามเด็กเล่น](https://muapi.ai/th/playground/gemini-3-8-flash-tts) - [ข้อมูลอ้างอิง API](https://muapi.ai/th/playground/gemini-3-8-flash-tts/api) - [สากล llms.txt](https://muapi.ai/th/llms.txt)