gemini-2.5-flash-preview-tts
Run in Apifox
価格: 入力0.55 PTC/100万トークン、出力11 PTC/100万トークン Request
トランスコードされたURLを返却する必要がある場合に使用。
Example: Bearer {{YOUR_API_KEY}}
Body Params application/json
contents
array [object {1}]
required
responseModalities
array [string]
required 使用モデル: gemini-2.5-flash-preview-tts
{
"contents" : [
{
"parts" : [
{
"text" : "Say cheerfully: Have a wonderful day!"
}
]
}
] ,
"generationConfig" : {
"responseModalities" : [
"AUDIO"
] ,
"speechConfig" : {
"voiceConfig" : {
"prebuiltVoiceConfig" : {
"voiceName" : "Kore"
}
}
}
} ,
"model" : "gemini-2.5-flash-preview-tts"
}
Request samples curl --location --request POST 'https://api.302.ai/google/v1/models/gemini-2.5-flash-preview-tts?response_format=url' \
--header 'Authorization: Bearer sk-mfYQzy0XTFfz4P16vRE4gFrKK1Nly4TozsMqbbb9PSiJUvFO' \
--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"
}'
Responses application/json Generate Code
candidates
array [object {3}]
required
candidatesTokenCount
integer
required
candidatesTokensDetails
array [object {2}]
required
promptTokensDetails
array [object {2}]
required
{
"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
}
}
Modified at 2025-06-18 07:06:56