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

# Nano Banana

> 谷歌 Gemini 2.5 Flash 图像生成模型，速度快、成本低，支持文生图与图生图



## OpenAPI

````yaml /zh/openapi/images/nano-banana.yaml POST /v1/images/generate
openapi: 3.1.0
info:
  title: Nano Banana
  version: '1.0'
  description: 谷歌 Gemini 2.5 Flash 图像生成模型，速度快、成本低，支持文生图与图生图。
servers:
  - url: https://openapi.imini.ai/imini/router
security:
  - ApiKeyAuth: []
paths:
  /v1/images/generate:
    post:
      summary: Nano Banana
      description: |
        提交异步的图像生成任务，后续需通过轮询接口查询结果。
        > 模型 ID：`google/nano-banana` · 底层：Gemini 2.5 Flash Image
      operationId: generateNanoBanana
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  description: 固定值 `google/nano-banana`
                prompt:
                  type: string
                  description: 提示词，不超过 **6000** 字符。支持中英文，推荐使用细节丰富的描述以获得更好的生成效果。
                  example: >-
                    An orange cat napping under a cherry blossom tree,
                    watercolor style, soft lighting
                images:
                  type: array
                  description: 参考图列表。**不传或传空数组**则为文生图模式；传入图像则进入图生图/风格参考模式。最多 **3** 张。
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        description: >-
                          参考图地址，支持两种形式： **1)** 公网可访问的 URL（以 `http://` 或
                          `https://` 开头）； **2)** Data URI 格式的 base64 编码（以
                          `data:image/` 开头，例如
                          `data:image/png;base64,iVBORw0KGgo...`），支持的格式：`png` /
                          `jpg` / `webp`，解码后大小不超过 **10MB**。
                      reference_type:
                        type: string
                        description: |-
                          参考类型：
                          - `asset` — 内容参考
                          - `style` — 风格参考
                        default: asset
                        enum:
                          - asset
                          - style
                  maxItems: 3
                aspect_ratio:
                  type: string
                  description: >-
                    输出宽高比，可选值：


                    `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9`
                    `21:9`


                    > 传入参考图时若不指定该参数，模型会自动识别参考图比例并以此作为输出比例。
                  default: '1:1'
                  enum:
                    - '1:1'
                    - '2:3'
                    - '3:2'
                    - '3:4'
                    - '4:3'
                    - '4:5'
                    - '5:4'
                    - '9:16'
                    - '16:9'
                    - '21:9'
                resolution:
                  type: string
                  description: 输出质量档位，当前仅支持 `1K`，传入其他值将被降级处理。
                  default: 1K
                  enum:
                    - 1K
            examples:
              Text to Image:
                summary: Text to Image
                value:
                  model: google/nano-banana
                  prompt: >-
                    A cute shiba inu in a spacesuit standing on the moon, 3D
                    cartoon style
                  aspect_ratio: '1:1'
                  resolution: 1K
              Image Edit:
                summary: Image Edit
                value:
                  model: google/nano-banana
                  prompt: >-
                    A cute shiba inu in a spacesuit standing on the moon, 3D
                    cartoon style
                  images:
                    - url: https://example.com/input.jpg
                      reference_type: asset
                  aspect_ratio: '16:9'
                  resolution: 1K
              Image Edit (base64):
                summary: Image Edit (base64)
                value:
                  model: google/nano-banana
                  prompt: >-
                    A cute shiba inu in a spacesuit standing on the moon, 3D
                    cartoon style
                  images:
                    - url: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
                      reference_type: asset
                  aspect_ratio: '16:9'
                  resolution: 1K
      responses:
        '200':
          description: 提交成功（异步模式）
          content:
            application/json:
              schema:
                oneOf:
                  - title: Submit Success (Pending)
                    type: object
                    properties:
                      task_id:
                        type: string
                        description: 任务唯一 ID，用于后续轮询查询
                        example: task_2041350318103396352
                      model:
                        type: string
                        description: 本次任务使用的模型 ID
                        example: google/nano-banana
                      created_at:
                        type: string
                        description: 任务创建时间
                        example: '2026-04-07T03:00:17.062Z'
                      request_id:
                        type: string
                        description: 请求唯一 ID
                        example: 285f20ce-8158-401b-945c-7bc6a7ef6ead
        '400':
          description: Validation Error (e.g. invalid parameter, invalid prompt)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Error code, e.g., INVALID_PROMPT
                        example: INVALID_PROMPT
                      message:
                        type: string
                        description: Error message details
                        example: Prompt contains disallowed content
                      status:
                        type: integer
                        description: HTTP status code
                        example: 400
                      request_id:
                        type: string
                        description: Unique request identifier
                        example: req_abc123
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >
        在请求 Header 中传入 `Authorization: Bearer <YOUR_API_KEY>`。前往 [API Keys
        管理页](https://imini.ai/zh/api-keys) 创建和管理 API Key。

````