Gemini 3.8 Flash Text to speech
This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.
Endpoint
POST /jobs/createTask
Full URL: https://ai.modelfold.online/v1/jobs/createTask
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Text-to-speech with Gemini 3.8 Flash.
Output: WAV (16-bit PCM, 24 kHz, mono).
Query Task Status
After submitting a task, use the unified query endpoint to check progress and retrieve results:
- Get Task Details — Learn how to query task status and retrieve generation results
TIP
For production use, we recommend using the callBackUrl parameter to receive automatic notifications when generation completes, rather than polling the status endpoint.
Related Resources
- Market Overview — Explore all available models
- File Upload API — Learn how to upload and manage files
- Common API — Check credits and account usage
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model to be used Default:"google/gemini-3-8-flash-tts"。 Allowed values:google/gemini-3-8-flash-tts。 示例:google/gemini-3-8-flash-tts。 |
callBackUrl | string | No | Callback URL for the result |
input | object | Yes | Input parameters for the generation task |
input.temperature | number | No | Sampling temperature, e.g., 1 Default:1。 示例:1。 |
input.speakers | array<object> | Yes | List of speaker configurations. Each speaker uses either voice_name (preset voice) or replica (voice clone); the two are mutually exclusive. If neither is sent, the speaker defaults to Fola. |
input.speakers[].speaker_id | string | Yes | Speaker identifier, e.g., "Speaker 1" or "Speaker 2". Must be in "Speaker N" format. |
input.speakers[].voice_name | string | No | Voice name. Mutually exclusive with replica: send only one of voice_name or replica for the same speaker. Omit this field when using voice cloning. If neither this field nor replica is sent, default is Fola.70 voices grouped by use case: - Tutor: Bodi, Lumi, Sadaltager, Sola, Sulafat, Varo, Zephyr - Commercial Voiceover: Koda, Kore, Nika, Tavi, Zeno - Instructional: Algenib, Despina, Erinome, Kira, Ludo, Mako, Rasalgethi, Rina - Podcast: Alnilam, Brio, Jori, Laomedeia, Rami, Veda - Storyteller: Achird, Enzo, Riko, Sami, Zali, Zubenelgenubi - Digital Assistant: Algieba, Aoede, Autonoe, Callirrhoe, Enceladus, Gero, Iapetus, Neno, Olin, Tari, Umbriel - Call Center: Achernar, Charon, Daro, Fola, Hali, Milo, Puck - Concierge: Arlo, Cleo, Fenrir, Finn, Leda, Lora, Orus - Tech Support: Enya, Jett, Knox, Nyla, Sadachbia, Vindemiatrix - Professional: Cruz, Elio, Gacrux, Pulcherrima, Schedar, Tova, Zuri Default: "Fola"。 Allowed values:Bodi / Lumi / Sadaltager / Sola / Sulafat / Varo / Zephyr / Koda / Kore / Nika / Tavi / Zeno / Algenib / Despina / Erinome / Kira / Ludo / Mako / Rasalgethi / Rina / Alnilam / Brio / Jori / Laomedeia / Rami / Veda / Achird / Enzo / Riko / Sami / Zali / Zubenelgenubi / Algieba / Aoede / Autonoe / Callirrhoe / Enceladus / Gero / Iapetus / Neno / Olin / Tari / Umbriel / Achernar / Charon / Daro / Fola / Hali / Milo / Puck / Arlo / Cleo / Fenrir / Finn / Leda / Lora / Orus / Enya / Jett / Knox / Nyla / Sadachbia / Vindemiatrix / Cruz / Elio / Gacrux / Pulcherrima / Schedar / Tova / Zuri。 示例:Fola。 |
input.speakers[].replica | object | No | Voice clone settings. Gemini 3.8 only. Optional. Mutually exclusive with voice_name — do not send both on the same speaker.When set, this task temporarily clones the speaker from two recordings. The clone is not saved as a reusable voice. You can pass replica for a speaker in both single-speaker and two-speaker requests.Both recordings must be of the same adult, captured with the same microphone in the same room. AI-generated audio is rejected. WAV only. Recommended: 24kHz, mono, 16-bit PCM. Max 10MB per file. Format is detected from file content, not the extension or Content-Type. |
input.speakers[].replica.source_audio_url | string | Yes | URL of the reference recording. The file must be directly downloadable. Record 10–30 seconds of natural speech in a quiet space: no echo, no background music, and only one voice. Record in the language you will generate. |
input.speakers[].replica.consent_audio_url | string | Yes | URL of the consent recording. The file must be directly downloadable. The same person as in the reference recording must read this sentence verbatim: I am the owner of this voice and I consent to Google using this voice to create a synthetic voice model. Other supported language versions of this sentence are also accepted. Trim silence and noise at the start and end. |
input.filler_words | boolean | No | Whether to insert filler words in two-speaker dialogue. Off by default (omit this field); when enabled, the request includes "filler_words": true. Only takes effect when speakers has two speakers (e.g. Speaker 1 and Speaker 2). When two people are speaking, you can turn on this switch. Default:false。 示例:false。 |
input.dialogue_turns | array<object> | Yes | List of dialogue turns, output in sequential order |
input.dialogue_turns[].speaker_id | string | Yes | Corresponding speaker identifier, e.g., "Speaker 1" |
input.dialogue_turns[].text | string | Yes | The speaker's line. May include tone tags wrapped in English angle brackets. Example: Hello there. <laugh> That works.Official insertable tags: <argh>, <breath>, <cackle>, <cheer>, <chuckle>, <chuckles>, <cough>, <cry>, <exhales>, <gasp>, <giggle>, <groan>, <growl>, <grr>, <grunt>, <heavy breath>, <hiss>, <laugh>, <laughter>, <long pause>, <moan>, <pant>, <pff>, <phew>, <scream>, <short pause>, <shout>, <shriek>, <sigh>, <sighs>, <sneeze>, <snicker>, <snort>, <sob>, <throat-clearing>, <tsk>, <whimper>, <whispering>, <whispers>, <yawn>. 示例:Hello there. <laugh> That works.。 |
input.dialogue_turns[].style | string | No | Per-turn speaking style, 3.8 only. Freely describe tone, emotion, and pace; different lines from the same speaker can differ. Example: Speak like a tired night-shift radio host, slow and dry. |
Request Example
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3-8-flash-tts",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"temperature": 1,
"speakers": [
{
"speaker_id": "Speaker 1",
"voice_name": "Fola"
},
{
"speaker_id": "Speaker 2",
"voice_name": "Zephyr"
}
],
"dialogue_turns": [
{
"speaker_id": "Speaker 1",
"style": "Speak like a tired night-shift radio host, slow and dry.",
"text": "Hello there. <laugh> That works."
},
{
"speaker_id": "Speaker 2",
"style": "Bright and curious, slightly faster.",
"text": "Wait, did you hear that? <gasp> I think it actually worked."
}
]
}
}'{
"model": "google/gemini-3-8-flash-tts",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"temperature": 1,
"speakers": [
{
"speaker_id": "Speaker 1",
"voice_name": "Fola"
},
{
"speaker_id": "Speaker 2",
"voice_name": "Zephyr"
}
],
"dialogue_turns": [
{
"speaker_id": "Speaker 1",
"style": "Speak like a tired night-shift radio host, slow and dry.",
"text": "Hello there. <laugh> That works."
},
{
"speaker_id": "Speaker 2",
"style": "Bright and curious, slightly faster.",
"text": "Wait, did you hear that? <gasp> I think it actually worked."
}
]
}
}Response
200 — Request successful
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying). 可选值:200 / 401 / 402 / 404 / 422 / 429 / 455 / 500 / 501 / 505。 示例:200。 |
msg | string | 否 | Response message, error description when failed 示例:success。 |
data | object | 是 | — |
data.taskId | string | 否 | Task ID, can be used with Get Task Details endpoint to query task status |
{
"code": 200,
"msg": "success",
"data": {
"taskId": ""
}
}Callback
musicTaskCompleted
Callback URL: {request.body#/callBackUrl} (the callBackUrl in the request body).
The system sends this callback when the audio task succeeds or fails.
Callback body parameters
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | Unified callback code: 200 for success, 501 for failure. Allowed values:200 / 501。 示例:200。 |
msg | string | 是 | Unified callback message. Allowed values:Playground task completed successfully. / Playground task failed.。 示例:Playground task completed successfully.。 |
data | object | 是 | — |
data.taskId | string | 是 | The unique task identifier. |
data.model | string | 是 | The model used for the task. Allowed values:google/gemini-3-8-flash-tts。 示例:google/gemini-3-8-flash-tts。 |
data.state | string | 是 | Terminal task state. Allowed values:success / fail。 示例:success。 |
data.param | string | 是 | JSON string containing the submitted task parameters. |
data.resultJson | string | 否 | JSON string containing resultUrls and resultObject when successful. Present only when state is success. |
data.failCode | string | 否 | Failure code, a numeric string such as "400" or "500". Present only when state is fail. |
data.failMsg | string | 否 | Failure reason. Present only when state is fail. |
data.costTime | integer | 否 | Processing time in seconds. Present on both success and failure callbacks. |
data.completeTime | integer | 否 | Task completion timestamp. |
data.createTime | integer | 否 | Task creation timestamp. |
data.updateTime | integer | 否 | Use completeTime as the completion time; updateTime may equal createTime. |
data.creditsConsumed | number | 否 | Credits consumed by the task; 0 for failed tasks. |
Task completed successfully
{
"code": 200,
"msg": "Playground task completed successfully.",
"data": {
"taskId": "task_example_music_webhook_001",
"model": "google/gemini-3-8-flash-tts",
"state": "success",
"param": "{\"input\":\"{\\\"temperature\\\":1,\\\"speakers\\\":[{\\\"speaker_id\\\":\\\"Speaker 1\\\",\\\"voice_name\\\":\\\"Fola\\\"},{\\\"speaker_id\\\":\\\"Speaker 2\\\",\\\"voice_name\\\":\\\"Zephyr\\\"}],\\\"dialogue_turns\\\":[{\\\"speaker_id\\\":\\\"Speaker 1\\\",\\\"style\\\":\\\"Speak like a tired night-shift radio host, slow and dry.\\\",\\\"text\\\":\\\"Hello there. <laugh> That works.\\\"},{\\\"speaker_id\\\":\\\"Speaker 2\\\",\\\"style\\\":\\\"Bright and curious, slightly faster.\\\",\\\"text\\\":\\\"Wait, did you hear that? <gasp> I think it actually worked.\\\"}]}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"google/gemini-3-8-flash-tts\"}",
"resultJson": "{\"resultUrls\":[\"https://example.com/generated-audio.wav\"],\"resultObject\":null}",
"costTime": 12,
"completeTime": 1234567890,
"createTime": 1234560000,
"updateTime": 1234567890,
"creditsConsumed": 1.23
}
}Task failed
{
"code": 501,
"msg": "Playground task failed.",
"data": {
"taskId": "task_example_music_webhook_001",
"model": "google/gemini-3-8-flash-tts",
"state": "fail",
"param": "{\"input\":\"{\\\"temperature\\\":1,\\\"speakers\\\":[{\\\"speaker_id\\\":\\\"Speaker 1\\\",\\\"voice_name\\\":\\\"Fola\\\"},{\\\"speaker_id\\\":\\\"Speaker 2\\\",\\\"voice_name\\\":\\\"Zephyr\\\"}],\\\"dialogue_turns\\\":[{\\\"speaker_id\\\":\\\"Speaker 1\\\",\\\"style\\\":\\\"Speak like a tired night-shift radio host, slow and dry.\\\",\\\"text\\\":\\\"Hello there. <laugh> That works.\\\"},{\\\"speaker_id\\\":\\\"Speaker 2\\\",\\\"style\\\":\\\"Bright and curious, slightly faster.\\\",\\\"text\\\":\\\"Wait, did you hear that? <gasp> I think it actually worked.\\\"}]}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"google/gemini-3-8-flash-tts\"}",
"failCode": "400",
"failMsg": "<error detail>",
"costTime": 12,
"creditsConsumed": 0
}
}