{ "model_id": "google/gemini-3.8-flash-tts", "provider_id": "google", "name": "Gemini 3.8 Flash TTS", "description": "Gemini 3.8 Flash TTS is Google's flagship text-to-speech model for expressive, natural speech generation.", "task": "Text-to-Speech", "tags": [], "context_length": 8192, "max_output_tokens": 16384, "schema_version": "1.0.0", "pricing": { "Input text tokens (per 1M)": 0.5, "Cached input tokens (per 1M)": 0.125, "output_audio_tokens": 9 }, "examples": [ { "name": "Simple Text-to-Speech", "description": "Convert text to speech with the default voice", "input": { "text": "Hello, welcome to Cloudflare AI Gateway!" }, "output": { "audio": "https://examples.aig.cloudflare.com/google/gemini-3.8-flash-tts/simple-text-to-speech.wav" }, "raw_response": { "audio": "https://examples.aig.cloudflare.com/google/gemini-3.8-flash-tts/simple-text-to-speech.wav", "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'google/gemini-3.8-flash-tts',\n { text: 'Hello, welcome to Cloudflare AI Gateway!' },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"google/gemini-3.8-flash-tts\",\n \"input\": {\n \"text\": \"Hello, welcome to Cloudflare AI Gateway!\"\n }\n}'" } ] }, { "name": "Expressive Pause", "description": "Generate expressive speech with an inline vocal pause", "input": { "text": "Welcome to the future of voice. Let us build something remarkable together.", "voice": "Puck" }, "output": { "audio": "https://examples.aig.cloudflare.com/google/gemini-3.8-flash-tts/expressive-pause.wav" }, "raw_response": { "audio": "https://examples.aig.cloudflare.com/google/gemini-3.8-flash-tts/expressive-pause.wav", "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'google/gemini-3.8-flash-tts',\n {\n text: 'Welcome to the future of voice. Let us build something remarkable together.',\n voice: 'Puck',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"google/gemini-3.8-flash-tts\",\n \"input\": {\n \"text\": \"Welcome to the future of voice. Let us build something remarkable together.\",\n \"voice\": \"Puck\"\n }\n}'" } ] }, { "name": "Narrated Passage", "description": "Generate a longer narrated passage with a different voice", "input": { "text": "At sunrise, the research team opened the observatory and watched the first light move across the valley. Every sensor came online in sequence, and the quiet room filled with the soft rhythm of discovery.", "voice": "Charon" }, "output": { "audio": "https://examples.aig.cloudflare.com/google/gemini-3.8-flash-tts/narrated-passage.wav" }, "raw_response": { "audio": "https://examples.aig.cloudflare.com/google/gemini-3.8-flash-tts/narrated-passage.wav", "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'google/gemini-3.8-flash-tts',\n {\n text: 'At sunrise, the research team opened the observatory and watched the first light move across the valley. Every sensor came online in sequence, and the quiet room filled with the soft rhythm of discovery.',\n voice: 'Charon',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"google/gemini-3.8-flash-tts\",\n \"input\": {\n \"text\": \"At sunrise, the research team opened the observatory and watched the first light move across the valley. Every sensor came online in sequence, and the quiet room filled with the soft rhythm of discovery.\",\n \"voice\": \"Charon\"\n }\n}'" } ] }, { "name": "French Greeting", "description": "Generate speech from a French greeting using a distinct voice", "input": { "text": "Bonjour et bienvenue. Nous sommes ravis de vous accompagner aujourd'hui.", "voice": "Kore" }, "output": { "audio": "https://examples.aig.cloudflare.com/google/gemini-3.8-flash-tts/french-greeting.wav" }, "raw_response": { "audio": "https://examples.aig.cloudflare.com/google/gemini-3.8-flash-tts/french-greeting.wav", "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'google/gemini-3.8-flash-tts',\n {\n text: \"Bonjour et bienvenue. Nous sommes ravis de vous accompagner aujourd'hui.\",\n voice: 'Kore',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"google/gemini-3.8-flash-tts\",\n \"input\": {\n \"text\": \"Bonjour et bienvenue. Nous sommes ravis de vous accompagner aujourd'\\''hui.\",\n \"voice\": \"Kore\"\n }\n}'" } ] } ], "default_example": null, "code_snippets": [], "supports_async": false, "zdr": false, "zdr_comment": null, "external_info": "https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash-tts", "terms": null, "cover_image_url": null, "metadata": {}, "request_formats": null, "providers": null, "provider_details": [ { "id": "google-ai-studio", "pricing": { "input_text_tokens": 0.5, "input_cached_tokens": 0.125, "output_audio_tokens": 9 } } ], "banner": null, "created_at": "2026-10-06 18:41:47", "schema": { "input": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "text": { "type": "string", "maxLength": 10000, "description": "The text to convert to speech. Maximum 10,000 characters." }, "voice": { "description": "The voice to use for speech synthesis", "type": "string", "enum": [ "Zephyr", "Puck", "Charon", "Kore", "Fenrir", "Leda", "Orus", "Aoede", "Callirrhoe", "Autonoe", "Enceladus", "Iapetus", "Umbriel", "Algieba", "Despina", "Erinome", "Algenib", "Rasalgethi", "Laomedeia", "Achernar", "Alnilam", "Schedar", "Gacrux", "Pulcherrima", "Achird", "Zubenelgenubi", "Vindemiatrix", "Sadachbia", "Sadaltager", "Sulafat" ] }, "temperature": { "description": "Controls randomness in generation (0-2)", "type": "number", "minimum": 0, "maximum": 2 }, "topP": { "description": "Nucleus sampling threshold (0-1). Tokens with cumulative probability up to topP are considered", "type": "number", "minimum": 0, "maximum": 1 }, "topK": { "description": "Only sample from the top K tokens. Smaller K = more focused, larger K = more diverse", "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "maxOutputTokens": { "description": "Maximum number of tokens to generate", "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "stopSequences": { "description": "Sequences where the model will stop generating further tokens", "type": "array", "items": { "type": "string" } } }, "required": [ "text" ], "additionalProperties": false }, "output": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "audio": { "type": "string", "description": "Base64-encoded audio data (WAV format)" } }, "required": [ "audio" ], "additionalProperties": false } } }