Gemini 3.1 Flash TTS (Preview)
Gemini 3.1 Flash TTS (Preview) turns text into speech for $0.004 per 1K characters on LLM API.
Pricing
Served by Google AI Studio, the only provider.
| Text to speech | $0.004/ 1K characters | per 1K characters |
|---|
Call Gemini 3.1 Flash TTS (Preview)
POST /v1/audio/speechSet LLMAPI_KEY to your LLM API key.Speech docs
import os
import wave
from openai import OpenAI
client = OpenAI(
base_url="https://api.llmapi.ai/v1",
api_key=os.environ["LLMAPI_KEY"],
)
speech = client.audio.speech.create(
model="gemini-3.1-flash-tts-preview",
voice="Kore",
input="Hello from LLM API",
)
with wave.open("hello.wav", "wb") as f: # raw PCM: 24 kHz, 16-bit, mono
f.setnchannels(1)
f.setsampwidth(2)
f.setframerate(24000)
f.writeframes(speech.content)import fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.llmapi.ai/v1",
apiKey: process.env.LLMAPI_KEY,
});
const speech = await client.audio.speech.create({
model: "gemini-3.1-flash-tts-preview",
voice: "Kore",
input: "Hello from LLM API",
});
// Raw PCM: 24 kHz, 16-bit, mono
fs.writeFileSync("hello.pcm", Buffer.from(await speech.arrayBuffer()));# Raw PCM: 24 kHz, 16-bit, mono
curl https://api.llmapi.ai/v1/audio/speech \
-H "Authorization: Bearer $LLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-tts-preview",
"voice": "Kore",
"input": "Hello from LLM API"
}' \
--fail-with-body --output hello.pcmMore from Google
All Google audio models
Google Chirp 3chirp_3$0.016per minute
Gemini 2.5 Flash Preview TTSgemini-2.5-flash-preview-tts$0.002per 1K characters
Gemini 2.5 Pro Preview TTSgemini-2.5-pro-preview-tts$0.004per 1K characters
Prices synced .