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

# Nano Banana Image Generation API | Nano Banana, Nano Banana 2, Nano Banana Pro

> Generate images with the Nano Banana API using Nano Banana, Nano Banana 2, Nano Banana 2 Lite, and Nano Banana Pro, including official Gemini model names such as gemini-2.5-flash-image, gemini-3-pro-image-preview, gemini-3.1-flash-image-preview, and gemini-3.1-flash-lite-image.

Use this endpoint when you want the main **Nano Banana API** image generation workflow for **Nano Banana**, **Nano Banana 2**, or **Nano Banana Pro**.

For the full family overview and model comparison, see the [Nano Banana API overview](/api/en/gemini) and the [Nano Banana Models Guide](/grids/en/start/nano-banana-models-guide).

<Note>
  Since Nano Banana image generation is a synchronous response and takes a relatively long time, it is recommended to use the **[https://api.ttapi.org](https://api.ttapi.org)** gateway.
</Note>

## Available Models

| Model                            | Alias                |
| :------------------------------- | :------------------- |
| `gemini-2.5-flash-image`         | `Nano Banana`        |
| `gemini-2.5-flash-image-preview` | `Nano Banana`        |
| `gemini-3-pro-image-preview`     | `Nano Banana Pro`    |
| `gemini-3.1-flash-image-preview` | `Nano Banana 2`      |
| `gemini-3.1-flash-lite-image`    | `Nano Banana 2 Lite` |


## OpenAPI

````yaml openapi/en/gemini.json POST /gemini/image/generate
openapi: 3.1.0
info:
  title: Gemini API DOCS
  version: 1.0.0
  description: >-
    TTAPI Gemini API service, including Nano Banana image generation and Gemini
    video generation.
servers:
  - url: https://api.ttapi.org
security: []
paths:
  /gemini/image/generate:
    post:
      description: >-
        Generate or modify images based on text and image prompts. Note: This is
        a conversational interaction format, not the official original format.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse1'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    GenerateRequest:
      type: object
      properties:
        prompt:
          type: string
          description: Image description for generation or modification
        model:
          type: string
          description: Model version
          default: gemini-3-pro-image-preview
          enum:
            - gemini-2.5-flash-image-preview
            - gemini-2.5-flash-image
            - gemini-3-pro-image-preview
            - gemini-3.1-flash-image-preview
            - gemini-3.1-flash-lite-image
        refer_images:
          type: array
          description: List of reference images
          items:
            type: string
          example:
            - https://cdn.ttapi.io/xxx1.png
            - https://cdn.ttapi.io/xxx2.png
        aspect_ratio:
          type: string
          default: '1:1'
          enum:
            - '1:1'
            - '2:3'
            - '3:2'
            - '3:4'
            - '4:3'
            - '4:5'
            - '5:4'
            - '9:16'
            - '16:9'
            - '21:9'
            - '1:4'
            - '4:1'
            - '1:8'
            - '8:1'
          description: Image aspect ratio, only supported by gemini-3 and above
        image_size:
          type: string
          default: 1K
          enum:
            - 1K
            - 2K
            - 4K
          description: 'Image resolution. **Note: Use uppercase ''K''**'
        google_search:
          type: boolean
          description: Whether to enable Google web search
          default: 'false'
        image_search:
          type: boolean
          description: Whether to enable Google image search
          default: 'false'
        thinking_level:
          type: string
          description: Thinking level
          enum:
            - Minimal
            - High
      required:
        - prompt
        - model
  responses:
    SuccessResponse1:
      description: Request successful
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                description: Task result
                properties:
                  prompt:
                    type: string
                    description: Prompt
                  refer_images:
                    type: array
                    description: Reference images.
                  image_url:
                    type: string
                    description: >-
                      Image URL. Validity: see [Storage and
                      Persistence](/grids/en/faq/storage)
                  quota:
                    type: string
                    description: Quota consumed
            example:
              status: SUCCESS
              message: success
              data:
                prompt: a cute cat
                refer_images: null
                image_url: >-
                  https://cdn.ttapi.io/other/2025-09-10/8b46aa28-4433-455f-bf5c-f5ccea48baf2.png
                quota: 2
            required:
              - status
              - message
              - data
    400Response:
      description: Parameter error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Authorization failed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        You can obtain your API key from the <a
        href='https://dashboard.ttapi.io' target='_blank'>TTAPI Dashboard</a>.

````