Skip to content

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) ​

ParameterTypeRequiredDescription
modelstringYesModel 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。
temperaturenumberNoSampling temperature, e.g., 1 Default:1。 minimum: 0. maximum: 2. Example:1。
scenestringNoScene description, e.g., "A quiet, warm room with a fireplace crackling softly." Default:""。 Example:``。
sample_contextstringNoSample context/overall tone, e.g., "Audiobook style narration. Tone is gentle and inviting." Default:""。 Example:``。
speakersarray&lt;object&gt;YesList of speaker configurations
  speakers[].speaker_idstringYesSpeaker identifier, e.g., "Speaker 1" or "Speaker 2"; must be in the "Speaker N" format
  speakers[].voice_namestringYesVoice 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_profilestringNoAudio profile description, e.g., "A warm and soothing narrator" or "A stern and weary gatekeeper"
  speakers[].accentstringYesAccent, 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[].stylestringNoEmotional style, e.g., "Whisper" or "Deadpan" Allowed values:Vocal Smile / Newscaster / Whisper / Empathetic / Promo/Hype / Deadpan。 Example:Vocal Smile。
  speakers[].pacestringNoPace, e.g., "Staccato" or "Natural" Allowed values:Natural / Rapid Fire / The Drift / Staccato。 Example:Natural。
dialogue_turnsarray&lt;object&gt;YesList of dialogue turns, output in sequential order
  dialogue_turns[].speaker_idstringYesCorresponding speaker identifier, e.g., "Speaker 1"
  dialogue_turns[].textstringYesThe 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": {}
}

ModelFold — one API for all the best AI models.