语音合成Google
Gemini 3.8 Flash TTS
Google’s Gemini 3.8 Flash TTS: text to speech in thirty voices and many languages, with instructions for style, or in a voice copied from a recording of the speaker.
- 模型 ID
google/gemini-3.8-flash-tts- Endpoint
POST /v1/audio/speech
价格
| 适用于 | Minu | 官方价格 | 相比官方价格 |
|---|---|---|---|
| 所有请求每分钟 | $0.01 | — | — |
语音合成按生成的音频时长计费,每次响应后扣费。未生成音频的请求不收费。
请求示例
官方 OpenAI SDK 可直接使用:将 baseURL 设为 https://api.minu.ai/v1,并使用您的 Minu 密钥。响应即为音频文件。
curl https://api.minu.ai/v1/audio/speech \
-H "Authorization: Bearer $MINU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3.8-flash-tts",
"voice": "alloy",
"input": "Your order has shipped and will arrive on Friday."
}' \
--output speech.mp3import fs from 'node:fs';
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.MINU_API_KEY,
baseURL: 'https://api.minu.ai/v1',
});
const speech = await client.audio.speech.create({
model: 'google/gemini-3.8-flash-tts',
voice: 'alloy',
input: 'Your order has shipped and will arrive on Friday.',
});
await fs.promises.writeFile('speech.mp3', Buffer.from(await speech.arrayBuffer()));import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["MINU_API_KEY"],
base_url="https://api.minu.ai/v1",
)
speech = client.audio.speech.create(
model="google/gemini-3.8-flash-tts",
voice="alloy",
input="Your order has shipped and will arrive on Friday.",
)
speech.write_to_file("speech.mp3")输入参数
发送包含 model、input(文本)和 voice 的 JSON 请求体,voice 为以下之一:alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse。instructions、response_format 和 speed 为可选项。