# 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` - **Категория**: AI Аудио - **Вариант**: 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-адреса результатов попадают в массив `outputs`. **Пример ответа при `завершении`:** ```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_): . идентификатор_динамика . [кричит] [шепотом] . - **`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`): Сообщение об ошибке, если `status` имеет значение `failed`. - **`created_at`** (`string`): Временная метка ISO-8601, когда был создан запрос. - **`has_nsfw_contents`** (`array of boolean`): Флаги обнаружения NSFW для каждого выхода. ## Вебхуки (необязательно) Добавьте `?webhook=https://your-server/path` к URL-адресу отправки. Когда задание достигнет конечного состояния, MuApi отправит POST ту же форму, что и ответ на опрос вашего URL-адреса — опрос не требуется. ## Интеграция агентов MuApi предоставляет сервер MCP и интерфейс командной строки, поэтому агенты (Claude Code, Cursor, Custom) могут вызывать эту конечную точку без написания HTTP-кода: ```bash # Установить CLI npm install -g muapi-cli # Однократная аутентификация muapi auth login # Предоставьте все модели MuApi как инструменты MCP вашему агенту. muapi mcp serve ``` Сервер MCP предоставляет инструменты, которые объединяют отправку и опрос для каждой модели, включая `gemini-3-8-flash-tts`. См. «muapi --help» для получения информации о ярлыках для конкретных категорий («создание изображения muapi», «видео muapi из изображения» и т. д.). ## Похожие модели - [3.1 Flash](https://muapi.ai/ru/playground/gemini-3-1-flash-tts) - [2.5 Pro](https://muapi.ai/ru/playground/gemini-2-5-pro-tts) - [3.8 Flash Lite](https://muapi.ai/ru/playground/gemini-3-8-flash-lite-tts) - [3.8 Flash](https://muapi.ai/ru/playground/gemini-3-8-flash-tts) ## Ресурсы - [Страница игровой площадки](https://muapi.ai/ru/playground/gemini-3-8-flash-tts) - [Справочник по API](https://muapi.ai/ru/playground/gemini-3-8-flash-tts/api) - [Глобальный файл llms.txt](https://muapi.ai/ru/llms.txt)