Nano Banana Images API
POSThttps://api.acedata.cloud/nano-banana/images
POSThttps://api.acedata.cloud/gemini/images

Nano Banana image generation can perform image generation and image editing.

Related Products

Nano Banana - Ace Data Cloud
Nano Banana image generation platform, directly interfaces with this API, high-speed and stable available.

Request Headers

acceptstring
Specify the format of the server response. If not specified, the default format is `application/json`.
Please select
authorizationstring
Bearer token

Request Body

actionstringRequired parameter
Image operation type. If it is `generate`, then generate an image based on the prompt; if it is `edit`, then edit the image based on the prompt and `image_urls`.
modelstring
Models used for generating images. If not specified, the default is `nano-banana`. `nano-banana-2` is an alias for `gemini-3.1-flash-image` (providing professional quality at flash speed), `nano-banana-pro` is an alias for `gemini-3-pro-image`, and `nano-banana` is an alias for `gemini-2.5-flash-image`.
Please select
promptstringRequired parameter
Prompts for generating images.
image_urlsarray
Link to the image that needs to be edited. It can be an accessible http or https URL, or a Base64 encoded image string in the format `data:image/png;base64,iVBORw0KG...`. Each image must not exceed 10MB in size. This parameter is required when `action` is `edit`.
aspect_ratiostring
Aspect ratio for generated images. Supported values are `1:1`, `3:2`, `2:3`, `16:9`, `9:16`, `4:3`, `3:4`, with a default of `1:1`. This parameter is only effective when `action` is `generate`; if `action` is `edit`, the aspect ratio will be determined by the first image in `image_urls`.
resolutionstring
Resolution of the generated image. Supported values are `1K`, `2K`, `4K`, with a default of `1K`. This parameter is only effective when `action` is `generate`; if `action` is `edit`, the resolution will be determined by the first image in `image_urls`. Additionally, this parameter is only valid when `model` is `nano-banana-pro`.
Please select
callback_urlstring
The callback URL to be called after the image generation is completed, which must be accessible from the public network. If this parameter is specified, the interface will immediately return a response, and the generation result will be sent to the callback address once it is ready.
asyncboolean
Whether to process in asynchronous mode. When set to `true`, the interface immediately returns `task_id`, without the need to provide `callback_url`, and then the result can be obtained by polling the corresponding task query interface; if `callback_url` is also provided, the result will be pushed to that callback address.
Please select

Response

Nano Banana Image Generation
Allow Use General Balance

When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.

Shell

Python

JavaScript

Java

Go

PHP

Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.