curl --request POST \
--url https://api.modellix.ai/api/v1/google/gemini-3.1-flash-tts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, welcome to Modellix!",
"speakers": [
{
"speaker": "Narrator",
"voice": "Kore"
}
]
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-gemini-tts-001",
"model_id": "google/gemini-3.1-flash-tts",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-gemini-tts-001"
}
}
}{
"code": 400,
"message": "Invalid parameters: parameter 'text' is required"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Gemini 3.1 Flash TTS
[Core Function] Gemini 3.1 Flash TTS is Google’s low-latency, controllable text-to-speech model. [Strengths] Single-speaker and two-speaker dialogue, 30 prebuilt voices, 70+ languages via language_code, and expressive delivery through style prompts plus inline audio tags such as [whispers], [slow], [fast], and [laughs]. Output is WAV (24 kHz mono PCM). [Best For] Voiceovers, virtual presenters, audiobook narration, multilingual speech, podcast-style scripts, and two-person dialogue. [Limitations] Do NOT use for lip-syncing existing video, music or sound-effect generation, image or audio inputs, MP3/OGG export, or API-level speed, volume, encoding, or sample-rate controls. Combined prompt and text must stay within 8,000 bytes. [Routing] Route here for controllable Gemini TTS from text only; for video with native audio use Veo; for talking-head lip sync from a portrait plus audio use Kling Avatar or SkyReels avatar models.
curl --request POST \
--url https://api.modellix.ai/api/v1/google/gemini-3.1-flash-tts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, welcome to Modellix!",
"speakers": [
{
"speaker": "Narrator",
"voice": "Kore"
}
]
}
'{
"code": 0,
"message": "success",
"data": {
"status": "pending",
"task_id": "task-gemini-tts-001",
"model_id": "google/gemini-3.1-flash-tts",
"get_result": {
"method": "GET",
"url": "https://api.modellix.ai/api/v1/tasks/task-gemini-tts-001"
}
}
}{
"code": 400,
"message": "Invalid parameters: parameter 'text' is required"
}{
"code": 401,
"message": "Authentication failed: invalid API key"
}{
"code": 429,
"message": "Rate limit exceeded: 100 requests per minute, retry after 60 seconds"
}{
"code": 500,
"message": "Internal server error"
}Authorizations
Modellix API Key. Format: Bearer <your_api_key>
Body
Gemini 3.1 Flash TTS request. Always pass voice through speakers (1-2 items), even for single-speaker synthesis. When prompt is set, style and script are combined as "{prompt}: {text}". Byte limits apply to UTF-8 length (multibyte characters count toward the limit).
Script to be spoken. Required. Max 8,000 bytes when used alone; if prompt is set, combined "{prompt}: {text}" must not exceed 8,000 bytes. When prompt is set, put only the spoken script here (do not repeat style instructions such as "Say cheerfully:" in text). May include inline audio tags such as [whispers], [slow], [fast], [laughs], and [short pause] to steer delivery.
1 - 8000"Hello, welcome to Modellix!"
Speaker configuration. Required. Length 1 (single voice) or 2 (dialogue). Voice is always set here; there is no top-level voice field.
1 - 2 elementsShow child attributes
Show child attributes
Optional director or style instruction (tone, pace, emotion, scene). Max 4,000 bytes. Merged with text as "{prompt}: {text}". Combined prompt + ": " + text must not exceed 8,000 bytes. If you omit prompt, you may embed direction in text using Google's single-field pattern (e.g. "Say cheerfully: ...") or audio tags.
4000"Friendly and warm tone"
Optional BCP-47 language and accent code. Examples: en-us, en-in, cmn-cn, ja-jp, ko-kr, fr-fr.
^[a-z]{2,3}(-[a-z0-9]+)*$"en-us"
Response
Task submitted successfully. Poll GET /api/v1/tasks/{task_id} until the task completes; synthesized audio is returned on the task result.
Response code, 0 indicates success
0
Response message
"success"
Task submission details. Poll GET /api/v1/tasks/{task_id} until status is success; audio appears in result.resources with type audio and format wav.
Show child attributes
Show child attributes