YepAPI
AI Models

Gemini 3.1 Flash TTS

Google's widest-coverage speech model — 70+ languages, 30 voices, and 200+ inline audio tags.

POST/v1/media/queue
$0.2005/1K chars

Overview

Gemini 3.1 Flash TTS is Google's text-to-speech model and a substantial step up from Gemini 2.5 Flash TTS. It covers more than 70 languages with 30 named voices and supports over 200 inline audio tags for directing delivery and emotion mid-sentence — the most expressive control surface of any speech model here.

PropertyValue
Model IDgoogle/gemini-3.1-flash-tts
Aliasgemini-tts
Upstream Modelgoogle/gemini-3.1-flash-tts-preview
CategoryText to Speech
Languages70+ languages
Outputpcm only
Pricing$0.2005 per 1,000 characters

Usage

All media models use the async job queue. Submit a job, then poll for the result.

Step 1: Submit Job

const res = await fetch('https://api.yepapi.com/v1/media/queue', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'google/gemini-3.1-flash-tts',
    prompt: 'Your text to speak goes here.',
    options: { voice: 'Zephyr' },
  }),
});
const { data } = await res.json();
// data.jobId — use this to poll for results
curl -X POST https://api.yepapi.com/v1/media/queue \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "google/gemini-3.1-flash-tts", "prompt": "Your text to speak goes here."}'

Step 2: Poll for Result

const status = await fetch(`https://api.yepapi.com/v1/media/status/${data.jobId}`, {
  headers: { 'x-api-key': 'YOUR_API_KEY' },
});
const { data: job } = await status.json();
// job.status — "pending" | "processing" | "completed" | "failed"
// job.result.audio — { mimeType, base64 } when completed
curl https://api.yepapi.com/v1/media/status/JOB_ID \
  -H "x-api-key: YOUR_API_KEY"

Write the audio to a file:

import { writeFileSync } from 'node:fs';

writeFileSync('speech.pcm', Buffer.from(job.result.audio.base64, 'base64'));

Request Body

ParameterTypeRequiredDescriptionDefault
modelstringYesgoogle/gemini-3.1-flash-tts
promptstringYesThe text to speak (max 50,000 bytes)
options.voicestringNoVoice identifierZephyr
options.outputFormatstringNopcm onlypcm
options.speednumberNoPlayback speed multiplier. Honoured only by models that support it1.0

Voices

Zephyr is used when options.voice is omitted. 30 voices available (10 of 30 shown):

  • Zephyr
  • Puck
  • Charon
  • Kore
  • Fenrir
  • Leda
  • Orus
  • Aoede
  • Callirrhoe
  • Autonoe

Features

  • 70+ languages — the widest coverage on the platform
  • 30 named voices
  • 200+ inline audio tags for directing delivery and emotion
  • Returns raw PCM only (see the note below)
Warning

This model returns raw PCM only — requesting outputFormat: "mp3" is rejected at submit time. job.result.audio.mimeType is audio/pcm, which is headerless: wrap it in a WAV container or feed it to an audio pipeline directly. Every other speech model returns MP3.

Billing

Speech is billed on the length of the input text, in UTF-8 bytes — for English text one byte is one character. The cost is known before synthesis starts, so the balance check at submit time quotes the exact final charge. Jobs have a $0.01 minimum.

Under the Hood

Powered by OpenRouter's unified speech API.

On this page