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

# Nano Banana 2

> Generate images using the Nano Banana 2 model (asynchronously), unifying text-to-image and image editing, with support for Google Search enhancement

Generate images using [Google DeepMind](https://deepmind.google)'s Nano Banana 2 (Gemini 2.0 Flash) model.

**Key Features:**

* **Unified Generation & Editing** - Text-to-image and image editing in a single endpoint
* **Google Search Enhancement** - Generate imagery based on real-time data with Google Search integration
* **Multi-Image Input** - Support up to 14 input images for editing and reference
* **Flexible Resolution** - Support 1K, 2K, and 4K output resolutions
* **Multiple Aspect Ratios** - Wide range of aspect ratios from 1:1 to 21:9


## OpenAPI

````yaml /en/openapi.yaml POST /generate/k/nano-banana-2
openapi: 3.0.0
info:
  contact:
    email: support@sinancode.com
    name: API Support
    url: https://sinancode.com/support
  description: AI Model Task Scheduling Platform API
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  termsOfService: https://sinancode.com/terms-of-service
  title: TikTomato API
  version: '1.0'
servers:
  - url: https://api.sinancode.com/v1
    description: Production server
security: []
paths:
  /generate/k/nano-banana-2:
    post:
      tags:
        - public
      summary: Nano Banana 2 Image Generation
      description: >-
        Generate images using the Nano Banana 2 model (asynchronously), unifying
        text-to-image and image editing, with support for Google Search
        enhancement
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ka.CreateNanoBanana2TaskRequest'
        description: Task parameters
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dto.CreateTaskResponse'
        '400':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apierror.ErrorResponse'
      security:
        - AccessToken: []
components:
  schemas:
    ka.CreateNanoBanana2TaskRequest:
      properties:
        aspect_ratio:
          default: auto
          description: AspectRatio Image aspect ratio (optional, default is auto)
          enum:
            - '1:1'
            - '1:4'
            - '1:8'
            - '2:3'
            - '3:2'
            - '3:4'
            - '4:1'
            - '4:3'
            - '4:5'
            - '5:4'
            - '8:1'
            - '9:16'
            - '16:9'
            - '21:9'
            - auto
          example: auto
          type: string
        google_search:
          default: false
          description: >-
            GoogleSearch Whether to use Google Search enhancement (optional,
            default is false)
          example: false
          type: boolean
        image_input:
          description: >-
            ImageInput List of input images (optional, supports up to 14 images,
            each up to 30MB)
          example:
            - ''
          items:
            type: string
          maxItems: 14
          type: array
        output_format:
          default: jpg
          description: OutputFormat Output image format (optional, default is jpg)
          enum:
            - jpg
            - png
          example: jpg
          type: string
        prompt:
          description: >-
            Prompt Text description for image generation (required, maximum
            20000 characters)
          example: A beautiful landscape with mountains and a lake at sunset
          maxLength: 20000
          minLength: 1
          type: string
        resolution:
          default: 1K
          description: Resolution Image resolution (optional, default is 1K)
          enum:
            - 1K
            - 2K
            - 4K
          example: 1K
          type: string
      required:
        - prompt
      type: object
    dto.CreateTaskResponse:
      properties:
        task_id:
          description: Task ID
          example: 01234567-89ab-cdef-0123-456789abcdef
          type: string
      required:
        - task_id
      type: object
    apierror.ErrorResponse:
      properties:
        error_code:
          description: Machine-readable error code (e.g., TASK.INVALID_PARAMS)
          type: string
        message:
          description: User-friendly error message
          type: string
      type: object
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Please use your API Token for authentication

````