Gemini 3.1 Flash Text to speech
Endpoint
POST /audio/generations
Full URL: https://modelfold.ai/v1/audio/generations
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Send model parameters directly in the JSON body. Do not wrap them in input. This request waits for generation to finish and returns data[].url; supported media models also offer async jobs, polling and callbacks. Replace example media URLs with your own publicly accessible files. See API gateway for billing and errors.
Input parameters for the generation task
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model to be used Default:"google/gemini-3-1-flash-tts"。 Allowed values:google/gemini-3-1-flash-tts。 Example:google/gemini-3-1-flash-tts。 |
temperature | number | No | Sampling temperature, e.g., 1 Default:1。 minimum: 0. maximum: 2. Example:1。 |
scene | string | No | Scene description, e.g., "A quiet, warm room with a fireplace crackling softly." Default:""。 Example:``。 |
sample_context | string | No | Sample context/overall tone, e.g., "Audiobook style narration. Tone is gentle and inviting." Default:""。 Example:``。 |
speakers | array<object> | Yes | List of speaker configurations |
speakers[].speaker_id | string | Yes | Speaker identifier, e.g., "Speaker 1" or "Speaker 2"; must be in the "Speaker N" format |
speakers[].voice_name | string | Yes | Voice name, e.g., "Zephyr", "Fenrir", "Puck" Allowed values: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。 Example:Achernar。 |
speakers[].audio_profile | string | No | Audio profile description, e.g., "A warm and soothing narrator" or "A stern and weary gatekeeper" |
speakers[].accent | string | Yes | Accent, e.g., "British (RP)" or "American (Gen)" Allowed values:Neutral / American (Gen) / American (Valley) / American (South) / British (RP) / British (Brixton) / Transatlantic / Australian。 Example:Neutral。 |
speakers[].style | string | No | Emotional style, e.g., "Whisper" or "Deadpan" Allowed values:Vocal Smile / Newscaster / Whisper / Empathetic / Promo/Hype / Deadpan。 Example:Vocal Smile。 |
speakers[].pace | string | No | Pace, e.g., "Staccato" or "Natural" Allowed values:Natural / Rapid Fire / The Drift / Staccato。 Example:Natural。 |
dialogue_turns | array<object> | Yes | List of dialogue turns, output in sequential order |
dialogue_turns[].speaker_id | string | Yes | Corresponding speaker identifier, e.g., "Speaker 1" |
dialogue_turns[].text | string | Yes | The text spoken by the speaker, which may contain tone tags, e.g., "Once upon a time, in a quiet valley hidden away..." maxLength: 10000. |
Request Example
bash
curl -X POST "https://modelfold.ai/v1/audio/generations" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3-1-flash-tts",
"speakers": [
{
"speaker_id": "Speaker 1",
"voice_name": "Achernar",
"accent": "Neutral"
}
],
"dialogue_turns": [
{
"speaker_id": "Speaker 1",
"text": "A paper boat drifting down a rainy street."
}
],
"temperature": 1,
"scene": "example",
"sample_context": "A paper boat drifting down a rainy street."
}'json
{
"model": "google/gemini-3-1-flash-tts",
"speakers": [
{
"speaker_id": "Speaker 1",
"voice_name": "Achernar",
"accent": "Neutral"
}
],
"dialogue_turns": [
{
"speaker_id": "Speaker 1",
"text": "A paper boat drifting down a rainy street."
}
],
"temperature": 1,
"scene": "example",
"sample_context": "A paper boat drifting down a rainy street."
}Response
200 — Generation completed. usage contains actual billing details; result URLs are illustrative.
json
{
"ok": true,
"created": 1792134000,
"data": [
{
"url": "https://modelfold.ai/uploads/outputs/result.mp3"
}
],
"usage": {}
}