> ## 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 图片(Nano Banana)

> Gemini 图片生成。

Nano Banana系列支持OpenAI Dall-E格式（详见链接 [图片生成OpenAI DALL-E格式](#tag/%E5%9B%BE%E7%89%87%E7%94%9F%E6%88%90OpenAI%20DALL-E%E6%A0%BC%E5%BC%8F)）。

Gemini 图片生成兼容接口。`contents[].parts` 中放文本或图片输入，`generationConfig.responseModalities` 通常传 `IMAGE`，图片尺寸通过 `generationConfig.imageConfig.imageSize` 控制。



## OpenAPI

````yaml api-reference/cn/openapi.json POST /v1beta/models/{model}:generateContent
openapi: 3.0.0
info:
  title: 出海营 API 参考文档
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.aiid.edu.kg
security:
  - BearerAuth: []
tags:
  - name: OpenAI格式(Chat)
  - name: OpenAI格式(Responses)
  - name: 图片生成Gemini格式
  - name: 图片生成OpenAI DALL-E格式
  - name: 获取模型列表
  - name: 视频生成HappyHorse与Wan
  - name: 视频生成Kling格式
  - name: 视频生成Omni与Veo格式
  - name: 视频生成Seedance格式
  - name: 视频生成Sora兼容格式
  - name: 视频生成Vidu格式
  - name: 音乐生成任务格式
paths:
  /v1beta/models/{model}:generateContent:
    post:
      tags:
        - 图片生成Gemini格式
      summary: Gemini 图片(Nano Banana)
      description: >-
        Gemini 图片生成。


        Nano Banana系列支持OpenAI Dall-E格式（详见链接 [图片生成OpenAI
        DALL-E格式](#tag/%E5%9B%BE%E7%89%87%E7%94%9F%E6%88%90OpenAI%20DALL-E%E6%A0%BC%E5%BC%8F)）。


        Gemini 图片生成兼容接口。`contents[].parts`
        中放文本或图片输入，`generationConfig.responseModalities` 通常传 `IMAGE`，图片尺寸通过
        `generationConfig.imageConfig.imageSize` 控制。
      operationId: geminiRelayV1Beta
      parameters:
        - name: model
          in: path
          description: 模型名称
          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: 消息角色，常见值为 `user` 或 `model`。
                      parts:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                              description: 文本输入内容。
                            inlineData:
                              type: object
                              description: 内联二进制内容对象，适用于 base64 图片等输入。
                              properties:
                                mimeType:
                                  type: string
                                  description: 内联内容 MIME 类型，例如 `image/png`。
                                data:
                                  type: string
                                  description: Base64 编码后的二进制数据内容。
                        description: 消息片段数组；文本、图片等输入都放在这里。
                  description: 必填。Gemini 输入内容数组，通常至少包含一条 user 消息。
                generationConfig:
                  type: object
                  properties:
                    responseModalities:
                      type: array
                      items:
                        type: string
                      description: 响应模式列表；图片生成通常传 `IMAGE`。
                    imageConfig:
                      type: object
                      properties:
                        aspectRatio:
                          type: string
                          description: 宽高比，例如 `16:9`、`1:1`、`9:16`。
                        imageSize:
                          type: string
                          description: 输出分辨率等级，例如 `1K`、`2K`、`4K`。
                      description: 图片生成配置对象。
                  required:
                    - responseModalities
                  description: 生成配置对象。
              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: 成功
          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: |-
        使用 Bearer Token 认证。
        格式: `Authorization: Bearer sk-xxxxxx`

````