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

# Nano Banana 2.1 Image Edit

> Edit one image with Nano Banana 2.1 using text instructions and reference images.

<Tip>
  1. Submit the request with `VIDGO_API_KEY`. A `task_id` is returned. Keep it until the task reaches `finished` or `failed`.
  2. Use [Query Task Status](/api-manual/task-management/status) to retrieve the result. If you provide a `callback_url`, Vidgo sends the result to your [webhook](/api-manual/task-management/webhooks) when the task finishes or fails.
</Tip>

# Nano Banana 2.1 Image Edit

## Usage Guide

Edit one image with Nano Banana 2.1 using text instructions and reference images.

* Set `model` to `google/nano-banana-2.1/edit`.
* Place `model` and optional `callback_url` at the request root; place workflow parameters inside `input`.
* Each request produces one image.
* For prompt-only generation, use [Text to Image](/api-manual/image-series/nano-banana-2-1-text-to-image) with `model=google/nano-banana-2.1/text-to-image`.

## Parameter Details

* `prompt` is required. Supply non-blank text of up to 20,000 characters.
* `image_urls` is required and accepts 1 to 10 reference image URLs. Use publicly accessible HTTP(S) URLs in the same order as the references in your prompt.
* `size` defaults to `auto`. `auto` follows the reference image aspect ratio.

## Developer Notes

* Submission is asynchronous. Use the task status endpoint or a completion webhook to retrieve the final image.
* Billing is per output image and depends on `resolution`. Text-to-image and editing use the same rate at each tier.
* Credits are deducted on submission and refunded if the task fails.

## Optional parameters

* `size` (string): Output aspect ratio. auto follows the reference image. Accepted values: `auto`, `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`. Default: `auto`.
* `resolution` (string): Output resolution tier. Accepted values: `1K`, `2K`, `4K`. Default: `1K`.


## OpenAPI

````yaml api-manual/image-series/nano-banana-2-1-edit.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Nano Banana 2.1 Image Edit
  description: >-
    Edit one image with Nano Banana 2.1 using text instructions and reference
    images.
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Nano Banana 2.1 Image Edit
      summary: Submit Nano Banana 2.1 Image Edit Task
      operationId: submitNanoBanana21ImageEditTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              reference-edit:
                summary: Edit with reference images
                value:
                  model: google/nano-banana-2.1/edit
                  input:
                    prompt: >-
                      Preserve the product and replace the background with a
                      warm modern studio.
                    image_urls:
                      - https://cdn.vidgo.ai/temp/reference-product.png
                    size: auto
                    resolution: 1K
      responses:
        '200':
          description: >-
            Task submission result. A task ID identifies asynchronous work;
            generation may still be running.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          example: google/nano-banana-2.1/edit
        callback_url:
          type: string
          format: uri
          description: Optional webhook URL for completion or failure notifications.
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
            - image_urls
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 20000
              pattern: \S
              description: |-
                Text instructions describing the edit.

                Include at least one non-whitespace character.
            size:
              type: string
              description: |-
                Output aspect ratio.

                auto follows the reference image.
              enum:
                - auto
                - '1:1'
                - '2:3'
                - '3:2'
                - '3:4'
                - '4:3'
                - '4:5'
                - '5:4'
                - '9:16'
                - '16:9'
                - '21:9'
              default: auto
            resolution:
              type: string
              enum:
                - 1K
                - 2K
                - 4K
              default: 1K
              description: Output resolution tier.
            image_urls:
              type: array
              minItems: 1
              maxItems: 10
              items:
                type: string
                format: uri
                pattern: ^https?://
              description: Required reference images for editing, in prompt order.
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-example-001
            status:
              type: string
              example: running
            created_time:
              type: string
              format: date-time
              example: '2026-10-09T10:30:00'
    ErrorResponse:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: integer
          example: 400
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use `Authorization: Bearer VIDGO_API_KEY`.'

````

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