---
title: "Generate Image (Nanobanana 2)"
method: POST
path: "/api/v1/nanobanana/generate-2"
---

# Generate Image (Nanobanana 2)

`POST /api/v1/nanobanana/generate-2`

## Request body

- object
  - `prompt` string, required — Text prompt for image generation (required). Controls the content and style of the generated image. Maximum length: 20,000 characters.
  - `imageUrls` string[] — Image URLs for image-to-image mode. Use an empty array for pure text-to-image generation. Supports up to 14 reference images.
  - `aspectRatio` '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' — Aspect ratio of the generated image.
  - `resolution` '1K' | '2K' | '4K' — Output resolution quality. Higher values produce larger and sharper images at higher cost.
  - `googleSearch` boolean — Use Google Web Search grounding to generate images based on real-time information.
  - `outputFormat` 'png' | 'jpg' — Output image format.
  - `callBackUrl` string, uri — Optional callback URL for async notifications when the task is completed.

## Response `200`

Request successful

- object
  - `code` integer — Response status code
  - `message` string — Response message
  - `data` object
    - `taskId` string — Task ID for querying task status

---

[API](https://skmtc.dev/nanobananaapi/apis/common-api.md) · [All operations](https://skmtc.dev/nanobananaapi/apis/common-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nanobananaapi/common-api/revisions/83dd71119edc/schema)
