# 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` - **모델 ID**: `gemini-3-8-flash-tts` - **카테고리**: AI 오디오 - **변형**: 3.8 Flash - **패밀리**: gemini-tts - **비용**: 호출당 0.015 크레딧(일부 모델은 매개변수에 따라 동적으로 비용을 계산함) ## API 사용법 Muapi는 **제출 후 폴링(Submit-then-poll)** 패턴을 사용합니다. 즉, 작업을 제출하고 `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 ```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`, _필수_): . ID . - **`speakers[].speaker_id`** (`string`, _필수_): . "스피커 N"("스피커 1"). - **`speakers[].voice_name`** (`string`, _필수_): 쌍둥이자리. - 옵션: `"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 natural-language description of the persona, e.g. "A warm and soothing narrator". - **`speakers[].accent`** (`string`, _필수_): . - 기본값: `"Neutral"` - 옵션: `"Neutral"`, `"American (Gen)"`, `"American (Valley)"`, `"American (South)"`, `"British (RP)"`, `"British (Brixton)"`, `"Transatlantic"`, `"Australian"` - **`speakers[].style`** (`string`, _필수_): . - 기본값: `"Empathetic"` - 옵션: `"Vocal Smile"`, `"Newscaster"`, `"Whisper"`, `"Empathetic"`, `"Promo/Hype"`, `"Deadpan"` - **`speakers[].pace`** (`string`, _필수_): . - 기본값: `"Natural"` - 옵션: `"Natural"`, `"Rapid Fire"`, `"The Drift"`, `"Staccato"` - **`dialogue_turns`** (`array`, _필수_): . 스피커_ID . [소리친다] [속삭인다] . - **`dialogue_turns[].speaker_id`** (`string`, _필수_): ID ( "발표자 1" ) . - **`dialogue_turns[].text`** (`string`, _필수_): . 와 호환됩니다. 10000 . - **`scene`** (`string`, _선택사항_): Optional scene description that sets the acoustic setting, e.g. "A quiet, warm room with a fireplace crackling softly." - 기본값: `""` - **`sample_context`** (`string`, _선택사항_): Optional overall tone/style, e.g. "Audiobook style narration. Tone is gentle and inviting." - 기본값: `""` - **`temperature`** (`number`, _선택사항_): (0-2) . , . - 기본값: `1` - 범위: `0` to `2` ## 출력 스키마 폴링 엔드포인트는 다음 필드를 반환합니다. - **`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 감지 플래그입니다. ## 웹훅(선택사항) 제출 URL에 `?webhook=https://your-server/path`를 추가하세요. 작업이 최종 상태에 도달하면 Muapi가 해당 URL로 폴링 응답과 동일한 페이로드를 POST 전송하므로 별도의 폴링이 필요하지 않습니다. ## 에이전트 연동 Muapi는 MCP 서버와 CLI를 제공하므로 AI 에이전트(Claude Code, Cursor, 커스텀 에이전트)가 복잡한 HTTP 코드 없이도 이 엔드포인트를 호출할 수 있습니다. ```bash # CLI 설치 npm install -g muapi-cli # 1회 인증 muapi auth login # 모든 Muapi 모델을 에이전트에 MCP 도구로 제공합니다. muapi mcp serve ``` MCP 서버는 `gemini-3-8-flash-tts`을 포함하여 모든 모델에 대해 제출 + 폴링을 래핑하는 도구를 노출합니다. 카테고리별 단축키(`muapi image generate`, `muapi video from-image` 등)는 `muapi --help`를 참조하세요. ## 관련 모델 - [3.1 Flash](https://muapi.ai/ko/playground/gemini-3-1-flash-tts) - [2.5 Pro](https://muapi.ai/ko/playground/gemini-2-5-pro-tts) - [3.8 Flash Lite](https://muapi.ai/ko/playground/gemini-3-8-flash-lite-tts) - [3.8 Flash](https://muapi.ai/ko/playground/gemini-3-8-flash-tts) ## 자원 - [플레이그라운드 페이지](https://muapi.ai/ko/playground/gemini-3-8-flash-tts) - [API 참조](https://muapi.ai/ko/playground/gemini-3-8-flash-tts/api) - [전역 llms.txt](https://muapi.ai/ko/llms.txt)