1. Images
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
      • Native Gemini Format TTS
    • Images
      • Native OpenAI Format Image Generation
        POST
      • Native Gemini Format Image Generation
        POST
      • Native OpenAI Format Image Editing (JSON)
        POST
      • Native OpenAI Format Image Editing (Multipart)
        POST
    • 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. Images

Native Gemini Format Image Generation

POST
/v1beta/models/{model}:generateContent

Gemini Native (Image)#

Invoke the AboAI API using the Google Gemini native format

Introduction#

The Gemini Native API utilizes Google Gemini's request and response formats, 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 features such as 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#

Supports either of the following methods:
Header ParameterTypeDescription
AuthorizationstringBearer Token: Bearer sk-xxxxxxxxxx (Recommended, consistent with other AboAI interfaces)
x-goog-api-keystringGoogle-style API Key: x-goog-api-key: sk-xxxxxxxxxx
You can also pass the parameter via the URL: ?key=sk-xxxxxxxxxx.

Request

Authorization
API Key
Add parameter in header
x-goog-api-key
Example:
x-goog-api-key: ********************
or
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-flash-image:generateContent?key=undefined' \
--header 'Authorization;' \
--header 'x-goog-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "Generate a picture of a cute cartoon cat"
                }
            ]
        }
    ],
    "generationConfig": {
        "responseModalities": [
            "TEXT",
            "IMAGE"
        ],
        "imageConfig": {
            "imageSize": "1k",
            "aspectRatio": "16:9"
        },
        "maxOutputTokens": 4096
    }
}'
Response Response Example
{
  "candidates": [
    {
      "content": {
        "parts": [
          {
            "text": "Response text\n"
          },
          {
            "inlineData": {
              "data": "",
              "mimeType": "image/png"
            }
          }
        ],
        "role": "model"
      },
      "index": 0,
      "finishReason": "STOP"
    }
  ],
  "usageMetadata": {
    "promptTokenCount": integer,
    "candidatesTokenCount": integer,
    "totalTokenCount": integer,
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": integer
      }
    ],
    "candidatesTokensDetails": [
      {
        "modality": "IMAGE",
        "tokenCount": integer
      },
      {
        "modality": "TEXT",
        "tokenCount": integer
      }
    ]
  },
  "modelVersion": "gemini-2.5-flash-image",
  "responseId": "sXvYaYm-IqjZ8eEP6fv1oAI"
}
Modified at 2026-06-17 02:36:56
Previous
Native OpenAI Format Image Generation
Next
Native OpenAI Format Image Editing (JSON)
Built with