{
"contents": [
{
"parts": [
{
"text": "Say cheerfully: Have a wonderful day!"
}
]
}
],
"generationConfig": {
"responseModalities": [
"AUDIO"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
},
"model": "gemini-2.5-flash-preview-tts"
}
curl --location --request POST 'https://api.302.ai/google/v1/models/gemini-2.5-flash-preview-tts?response_format=url' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"parts": [
{
"text": "Say cheerfully: Have a wonderful day!"
}
]
}
],
"generationConfig": {
"responseModalities": [
"AUDIO"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
},
"model": "gemini-2.5-flash-preview-tts"
}'
{
"candidates": [
{
"content": {
"parts": [
{
"inlineData": {
"data": "https://file.302.ai/gpt/imgs/20250616/75412091b9ef451a99eb70c08f387381.wav",
"mimeType": "audio/L16;codec=pcm;rate=24000"
}
}
],
"role": "model"
},
"finishReason": "STOP",
"index": 0
}
],
"modelVersion": "gemini-2.5-flash-preview-tts",
"responseId": "TPBPaOzJEdaY1MkPy5fzkQ0",
"usageMetadata": {
"candidatesTokenCount": 48,
"candidatesTokensDetails": [
{
"modality": "AUDIO",
"tokenCount": 48
}
],
"promptTokenCount": 8,
"promptTokensDetails": [
{
"modality": "TEXT",
"tokenCount": 8
}
],
"totalTokenCount": 56
}
}