> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiohub.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Call Gemini generateContent

> Gemini API `generateContent` endpoint. Supports text and multimodal content; image generation depends on the selected model and current group.



## OpenAPI

````yaml /openapi/relay.en.json post /v1beta/models/{model}:generateContent
openapi: 3.0.1
info:
  title: AIOHub API
  description: AIOHub public API
  version: 1.0.0
servers:
  - url: https://api.aiohub.org
security:
  - BearerAuth: []
tags:
  - name: List models
  - name: OpenAI Chat
  - name: OpenAI Responses
  - name: Image generation
  - name: OpenAI Images
  - name: Video generation
  - name: Claude Messages
  - name: Gemini API
  - name: OpenAI Embeddings
  - name: Text completions
  - name: OpenAI Audio
  - name: Realtime API
paths:
  /v1beta/models/{model}:generateContent:
    post:
      tags:
        - Gemini API
      summary: Call Gemini generateContent
      description: >-
        Gemini API `generateContent` endpoint. Supports text and multimodal
        content; image generation depends on the selected model and current
        group.
      operationId: geminiRelayV1Beta
      parameters:
        - name: model
          in: path
          description: Model name
          required: true
          example: gemini-2.5-flash
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                      parts:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                generationConfig:
                  type: object
                  properties:
                    responseModalities:
                      type: array
                      items:
                        type: string
                    imageConfig:
                      type: object
                      properties:
                        aspectRatio:
                          type: string
                        imageSize:
                          type: string
                  description: >-
                    Optional generation configuration. Image-related fields
                    apply only when the selected Gemini image model supports
                    them.
              required:
                - contents
            example:
              contents:
                - role: user
                  parts:
                    - text: >-
                        Explain how API gateways route requests in one
                        paragraph.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeminiResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    GeminiResponse:
      type: object
      properties:
        candidates:
          type: array
          items:
            type: object
            properties:
              content:
                type: object
                properties:
                  role:
                    type: string
                  parts:
                    type: array
                    items:
                      type: object
                      properties: {}
              finishReason:
                type: string
              safetyRatings:
                type: array
                items:
                  type: object
                  properties: {}
        usageMetadata:
          type: object
          properties:
            promptTokenCount:
              type: integer
            candidatesTokenCount:
              type: integer
            totalTokenCount:
              type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk-xxx)

````