1. Chat
AboAI
English
  • 中文
  • English
  • Home Page
  • AboAi-API
    • Model
      • Native OpenAI Format
      • Native Gemini Format
    • Chat
      • Native OpenAI Format
        POST
      • Native Gemini Format
        POST
      • Native Claude Format
        POST
      • Responses Request (openai)
        POST
    • Audio
      • Native OpenAI Format TTS
      • Native Gemini Format TTS
    • 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. Chat

Native Gemini Format

POST
/v1beta/models/{model}:generateContent

Gemini Native (Text)#

Call the AboAI API using the Google Gemini native format

Introduction#

The Gemini Native API adopts the request and response formats of Google Gemini, making it suitable for official Google clients (such as the google-generativeai SDK) or scenarios that require direct use of Gemini data structures. This interface complies with the Gemini API specifications and fully supports capabilities 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
Content Generation (Streaming)POST/v1beta/models/{model}:streamGenerateContent?alt=sse

Authentication#

Supports either of the following methods:
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
Parameters can also be passed via 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
curl --location 'https://api.aboai.ai/v1beta/models/gemini-2.5-pro:generateContent?key=undefined' \
--header 'x-goog-api-key: x-goog-api-key:sk-HusFtHu0hUwQU05an5Jf_YQOjD5norZDt5crVbsMN-o' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data '{
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "Introduce artificial intelligence in one sentence."
                }
            ]
        }
    ]
}'
Response Response Example
{
    "candidates": [
        {
            "content": {
                "parts": [
                    {
                        "text": "Response text"
                    }
                ],
                "role": "model"
            },
            "finishReason": "STOP",
            "index": 0,
            "safetyRatings": []
        }
    ],
    "usageMetadata": {
        "promptTokenCount": 10,
        "candidatesTokenCount": 20,
        "totalTokenCount": 30,
        "thoughtsTokenCount": 0,
        "cachedContentTokenCount": 0
    },
    "modelVersion": "gemini-2.5-pro",
    "createTime": "2025-01-01T00:00:00Z"
}
Modified at 2026-06-16 03:06:32
Previous
Native OpenAI Format
Next
Native Claude Format
Built with