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

# gemini-nano-banana-2.1

> Google's efficient image generation and conversational editing model with 1K–4K output, multi-image fusion, character consistency, accurate text, and search grounding.



## OpenAPI

````yaml /openapi/image/gemini-nano-banana-2-1.yaml post /images/generations
openapi: 3.0.3
info:
  title: gemini-nano-banana-2.1
  version: 1.0.0
  description: >-
    Google's efficient image generation and conversational editing model with
    1K–4K output, multi-image fusion, character consistency, accurate text, and
    search grounding.
  x-linkmodel-sort-weight: 99202610069
servers:
  - url: https://api.linkmodel.ai/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Google
  - name: image
paths:
  /images/generations:
    post:
      tags:
        - Google
        - image
      summary: gemini-nano-banana-2.1
      description: >
        Google's efficient image generation and conversational editing model
        with 1K–4K output, multi-image fusion, character consistency, accurate
        text, and search grounding.


        |   |   |

        | --- | --- |

        | **Provider** | Google |

        | **Tasks** | text-to-image · image-to-image |

        | **Starting from** | 0.1125 USD / token · <a
        href="https://linkmodel.ai/en/models/gemini-nano-banana-2.1"
        target="_blank" rel="noopener">Pricing details</a> |


        ## Task lifecycle


        This endpoint creates an asynchronous task. Poll `GET
        /images/generations/{task_id}` with the returned `task_id` until the
        task reaches a terminal state.


        If the POST request times out or its result is uncertain, do not blindly
        retry it. The original request may already have created another task and
        billing order.


        Completed asset URLs are dynamically signed. Download or copy assets
        that must be retained instead of treating the URLs as permanent
        identifiers.
      operationId: gemini-nano-banana-2-1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - gemini-nano-banana-2.1
                  description: 'Must be one of: gemini-nano-banana-2.1.'
                prompt:
                  type: string
                  minLength: 1
                  description: Length must be at least 1.
                images:
                  type: array
                  maxItems: 14
                  items:
                    type: string
                  description: Maximum 14 items.
                image_is_base64:
                  type: array
                  maxItems: 14
                  items:
                    type: boolean
                    enum:
                      - false
                      - true
                  description: One flag per reference image; omit for URLs.
                size:
                  type: string
                  enum:
                    - '16:9'
                    - 16x9
                    - '1:1'
                    - '1:4'
                    - '1:8'
                    - 1x1
                    - 1x4
                    - 1x8
                    - '21:9'
                    - 21x9
                    - '2:3'
                    - 2x3
                    - '3:2'
                    - '3:4'
                    - 3x2
                    - 3x4
                    - '4:1'
                    - '4:3'
                    - '4:5'
                    - 4x1
                    - 4x3
                    - 4x5
                    - '5:4'
                    - 5x4
                    - '8:1'
                    - 8x1
                    - '9:16'
                    - '9:21'
                    - 9x16
                    - 9x21
                  description: >-
                    The five additional ratios require the updated Vertex
                    provider.
                quality:
                  type: string
                  enum:
                    - 1K
                    - 2K
                    - 4K
                  default: 1K
                  description: >-
                    Resolution affects upstream token usage; billing remains per
                    token. Defaults to `1K`.
                max_images:
                  type: integer
                  default: 1
                  minimum: 1
                  maximum: 1
                  description: Must be between 1 and 1. Defaults to `1`.
                output_format:
                  type: string
                  enum:
                    - jpeg
                    - png
                  description: 'Must be one of: jpeg, png.'
                output_compression:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: >-
                    Use with output_format=jpeg; PNG does not accept
                    compression.
                extends.response_modalities:
                  type: array
                  minItems: 1
                  maxItems: 2
                  items:
                    type: string
                    enum:
                      - IMAGE
                      - TEXT
                  description: >-
                    Requires updated code. Use [IMAGE] or [TEXT,IMAGE]; image
                    tasks require IMAGE.
                extends.thinking_level:
                  type: string
                  enum:
                    - HIGH
                    - MEDIUM
                    - MINIMAL
                  description: >-
                    Requires updated code. Omit to retain upstream default; LOW
                    is unsupported.
                videos:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                  description: >-
                    可选视频 URL 字符串数组；HTTPS/gs URI，最多 10 个，最多一个 YouTube 链接。按 URL
                    路径后缀推断 MIME；无后缀链接请使用旧 extends 视频格式显式指定 MIME。不可与旧视频字段混用。.
                extends.video_url:
                  type: string
                  description: >-
                    Requires updated code. HTTPS or gs URI; omitted
                    video_mime_type defaults to video/mp4.
                extends.video_mime_type:
                  type: string
                  enum:
                    - video/3gpp
                    - video/avi
                    - video/mp4
                    - video/mpeg
                    - video/mpg
                    - video/quicktime
                    - video/webm
                    - video/wmv
                    - video/x-flv
                  description: Requires updated code; only used with extends.video_url.
                extends.videos:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                  description: >-
                    Requires updated code. Each item: {url,mime_type}; at most
                    one YouTube video. Item and URL safety validation is
                    enforced by code.
              required:
                - model
      responses:
        '200':
          description: >-
            Business response. `code=0` means the task was accepted; validation
            failures can return HTTP 200 with `code=400`.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    required:
                      - code
                      - data
                      - msg
                    properties:
                      code:
                        type: integer
                        enum:
                          - 0
                        example: 0
                      data:
                        type: object
                        required:
                          - task_id
                        properties:
                          task_id:
                            type: string
                            description: Use this id to poll task status.
                            example: aurora_abc123
                          order_id:
                            type: string
                            description: Billing order id.
                            example: 019da9cf-d1db-78e1-ac23-526774d01193
                          status:
                            type: string
                            example: Processing
                          price:
                            type: number
                            description: Charged amount in the model's pricing currency.
                            example: 0.074
                      msg:
                        type: string
                        example: success
                      request_id:
                        type: string
                        format: uuid
                        example: 250b66dd-e1fb-4bb6-b5f6-c668efadc35d
                  - type: object
                    required:
                      - code
                      - msg
                    properties:
                      code:
                        type: integer
                        enum:
                          - 400
                        example: 400
                      data:
                        type: object
                        example: {}
                      msg:
                        type: string
                        example: model is required
                      request_id:
                        type: string
                        format: uuid
                        example: 96be7a7d-3e81-4916-a6b8-19b32773a693
        '400':
          description: >-
            Malformed HTTP request rejected by the Gateway. Model and parameter
            validation may instead use HTTP 200 with business `code=400`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  msg:
                    type: string
                    example: task_id is required
                  request_id:
                    type: string
                    format: uuid
                    example: 96be7a7d-3e81-4916-a6b8-19b32773a693
        '401':
          description: Unauthorized — missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 401
                  data:
                    type: object
                    example: {}
                  msg:
                    type: string
                    example: invalid api key
                  request_id:
                    type: string
                    format: uuid
                    example: bff4c295-c7da-4507-9708-4627cb6373ba
        '500':
          description: Internal error — task creation failed (e.g. insufficient balance).
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    example: 500
                  msg:
                    type: string
                    example: >-
                      create task failed: billing: code=100601: insufficient
                      balance
                  request_id:
                    type: string
                    format: uuid
                    example: 3409f6fb-fa9a-4534-b530-195b5f6f4e32
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.