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

# Gemini Images (Nano Banana)

> Gemini image generation.

Nano Banana series supports the OpenAI Dall-E format (see [Image Generation OpenAI DALL-E Format](#tag/%E5%9B%BE%E7%89%87%E7%94%9F%E6%88%90OpenAI%20DALL-E%E6%A0%BC%E5%BC%8F)).

Gemini image generation compatible API. Put text or image inputs in `contents[].parts`, `generationConfig.responseModalities` usually pass `IMAGE`, and control the image size through `generationConfig.imageConfig.imageSize`.



## OpenAPI

````yaml api-reference/en/openapi.json POST /v1beta/models/{model}:generateContent
openapi: 3.0.0
info:
  title: Overseas Expansion Camp API Reference Documentation
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.aiid.edu.kg
security:
  - BearerAuth: []
tags:
  - name: OpenAI format (Chat)
  - name: OpenAI Format (Responses)
  - name: Gemini Format for Image Generation
  - name: Image generationOpenAI DALL-E format
  - name: List models
  - name: Video generationHappyHorse and Wan
  - name: Video generation Kling format
  - name: Video generation Omni and Veo formats
  - name: Video generation Seedance
  - name: Video generation Sora compatible formats
  - name: Video generation Vidu
  - name: Music generation task format
paths:
  /v1beta/models/{model}:generateContent:
    post:
      tags:
        - Gemini Format for Image Generation
      summary: Gemini Images (Nano Banana)
      description: >-
        Gemini image generation.


        Nano Banana series supports the OpenAI Dall-E format (see [Image
        Generation OpenAI DALL-E
        Format](#tag/%E5%9B%BE%E7%89%87%E7%94%9F%E6%88%90OpenAI%20DALL-E%E6%A0%BC%E5%BC%8F)).


        Gemini image generation compatible API. Put text or image inputs in
        `contents[].parts`, `generationConfig.responseModalities` usually pass
        `IMAGE`, and control the image size through
        `generationConfig.imageConfig.imageSize`.
      operationId: geminiRelayV1Beta
      parameters:
        - name: model
          in: path
          description: Model Name
          required: true
          example: gemini-3-pro-image-preview
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        description: Message role. Common values are `user` or `model`.
                      parts:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                              description: Text input content.
                            inlineData:
                              type: object
                              description: >-
                                An inline binary content object for inputs such
                                as base64 images.
                              properties:
                                mimeType:
                                  type: string
                                  description: >-
                                    The MIME type of the inline content, for
                                    example `image/png`.
                                data:
                                  type: string
                                  description: >-
                                    The binary data content after Base64
                                    encoding.
                        description: >-
                          Array of message segments; text, images, and other
                          inputs are placed here.
                  description: >-
                    Required. Array of Gemini input content, typically
                    containing at least one user message.
                generationConfig:
                  type: object
                  properties:
                    responseModalities:
                      type: array
                      items:
                        type: string
                      description: >-
                        List of response modes; image generation usually passes
                        `IMAGE`.
                    imageConfig:
                      type: object
                      properties:
                        aspectRatio:
                          type: string
                          description: Aspect ratio, for example `16:9`, `1:1`, and `9:16`.
                        imageSize:
                          type: string
                          description: >-
                            Output resolution level, for example `1K`, `2K`, and
                            `4K`.
                      description: Image generation configuration object.
                  required:
                    - responseModalities
                  description: Generate the configuration object.
              required:
                - contents
                - generationConfig
            example:
              contents:
                - role: user
                  parts:
                    - text: draw a cat
              generationConfig:
                responseModalities:
                  - TEXT
                  - IMAGE
                imageConfig:
                  aspectRatio: '16:9'
                  imageSize: 4K
      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: |-
        Use Bearer Token authentication.
        Format: `Authorization: Bearer sk-xxxxxx`

````