1. Audio
AboAI
English
  • 中文
  • English
  • Home Page
  • AboAi-API
    • Model
      • Native OpenAI Format
      • Native Gemini Format
    • Chat
      • Native OpenAI Format
      • Native Gemini Format
      • Native Claude Format
      • Responses Request (openai)
    • Audio
      • Native OpenAI Format TTS
        POST
      • Native Gemini Format TTS
        POST
    • Images
      • Native OpenAI Format Image Generation
      • Native Gemini Format Image Generation
      • Native OpenAI Format Image Editing (JSON)
      • Native OpenAI Format Image Editing (Multipart)
    • Video
      • Seedance2.0 format
        • Create Video Generation Task
        • Query Video Generation Task Status
    • Vector
      • Embeddings
        • Create Embedding
    • Translation
      • Speech Translation
  • AI application
    • AboAI API Integration with Claude Code
    • AboAI API Integration with Cursor
    • AboAI API Integration with Codex-cli
    • AboAI API Integration with Codex Desktop
    • AboAI API Integration with Hermes Agent
  1. Audio

Native Gemini Format TTS

POST
/v1beta/models/{model}:generateContent

Native Gemini (Speech)#

Call AboAI API using the native Google Gemini format

Introduction#

The Gemini Native API adopts the request and response format of Google Gemini. It is suitable for official Google clients (such as the google-generativeai SDK) or scenarios that require direct utilization of Gemini data structures. This interface complies with the Gemini API specifications and fully supports features like Thinking mode, multimodal input, tool calling, Google Search (Grounding), and image generation.

API Endpoints#

FeatureMethodPath
Content Generation (Non-streaming)POST/v1beta/models/{model}:generateContent

Authentication#

Either of the following methods is supported:
Header ParameterTypeDescription
AuthorizationstringBearer Token: Bearer sk-xxxxxxxxxx (Recommended, consistent with other AboAI endpoints)
x-goog-api-keystringGoogle-style API Key: x-goog-api-key: sk-xxxxxxxxxx
Alternatively, parameters can be passed in the URL: ?key=sk-xxxxxxxxxx.

Request

Path Params

Query Params

Header Params

Body Params application/json

Examples

Responses

🟢200
application/json
Bodyapplication/json

Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.aboai.ai/v1beta/models/gemini-2.5-pro-tts:generateContent?key=undefined' \
--header 'x-goog-api-key;' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data '{
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "Read aloud: Hello World"
                }
            ]
        }
    ],
    "generationConfig": {
        "responseModalities": [
            "AUDIO"
        ],
        "speechConfig": {
            "voiceConfig": {
                "prebuiltVoiceConfig": {
                    "voiceName": "Kore"
                }
            },
            "languageCode": "cmn-CN"
        },
        "maxOutputTokens": 4096
    }
}'
Response Response Example
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "inlineData": {
              "data": "",
              "mimeType": "audio/L16;codec=pcm;rate=24000"
            }
          }
        ],
        "role": "model"
      },
      "index": 0,
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {
    "promptTokenCount": integer,
    "candidatesTokenCount": integer,
    "totalTokenCount": integer,
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": integer
      }
    ],
    "candidatesTokensDetails": [
      {
        "modality": "AUDIO",
        "tokenCount": integer
      }
    ]
  },
  "modelVersion": "gemini-2.5-pro-tts",
  "responseId": "MnjYaaqvHvnasbwP2J33iAQ"
}
Modified at 2026-06-16 04:10:01
Previous
Native OpenAI Format TTS
Next
Native OpenAI Format Image Generation
Built with