Theme
TTS Text-to-Speech
POST
https://www.kkiai.com/v1beta/models/gemini-2.5-flash-preview-tts:generateContent
Official documentation: https://ai.google.dev/gemini-api/docs/image-generation?hl=zh-cn#gemini-image-editing
Request Parameters
Authorization
Add the Authorization parameter to the Header, with its value being the Token concatenated after Bearer
Example: Authorization: Bearer ********************
Query Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
key | string | Required | {{YOUR_API_KEY}} |
Header Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
Content-Type | string | Required | application/json |
Body Parameters (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
contents | array[object] | Required | |
└ parts | array[object] | Optional | |
generationConfig | object | Required | |
└ responseModalities | array[string] | Required | |
└ imageConfig | object | Required |
Request Example
json
{
"contents": [
{
"parts": [
{
"text": "Hello! This is a text-to-speech example generated by Gemini."
}
]
}
],
"generationConfig": {
"responseModalities": [
"AUDIO"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
},
"model": "gemini-2.5-flash-preview-tts"
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/v1beta/models/gemini-2.5-flash-preview-tts:generateContent' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"contents": [
{
"parts": [
{
"text": "Hello! This is a text-to-speech example generated by Gemini."
}
]
}
],
"generationConfig": {
"responseModalities": [
"AUDIO"
],
"speechConfig": {
"voiceConfig": {
"prebuiltVoiceConfig": {
"voiceName": "Kore"
}
}
}
},
"model": "gemini-2.5-flash-preview-tts"
}'Response
🟢 200 Success
Response Example
json
{}