Application Process
To use the Nano Banana Images API, first obtain your API Token from the Ace Data Cloud Console for future reference.
If you are not logged in or registered, you will be automatically redirected to the login page to invite you to register and log in, and after completion, you will be automatically returned to the current page.
One API Token can call all services on the platform without needing to apply separately for each service. The first application will grant a free quota for a trial experience; when the quota is insufficient, you can recharge the general balance in the console.
📘 Complete Documentation: Nano Banana Images API →
Interface Overview
- Base URL:
https://api.acedata.cloud - Endpoint:
POST /nano-banana/images - Authentication Method: Include
authorization: Bearer {token}in the HTTP Header - Request Headers:
accept: application/jsoncontent-type: application/json
- Actions:
generate: Generate images based on text promptsedit: Edit based on given images
- Models (optional):
nano-banana(default): Based on Gemini 2.5 Flash Image, fast speed, low costnano-banana-2-lite: Based on Gemini 3.1 Flash Lite Image, supports only 1K, fast generation speednano-banana-2: Based on Gemini 3.1 Flash Image Preview, Pro-level quality + Flash speednano-banana-pro: Based on Gemini 3 Pro Image Preview, highest qualitynano-banana:official,nano-banana-2-lite:official,nano-banana-2:official,nano-banana-pro:official: Official channel versions of the corresponding models, better image quality and stability, different billing
- Asynchronous Callback: Optional, receive task completion notifications and results via
callback_url - Number of Images: Optional, specify 1–4 images via
count, default is 1; if some fail, only successful images will be returned and billed
Quick Start: Generate Image (action=generate)
Minimum Required Parameters: action, prompt
When you only want to generate an image based on a prompt, set action to generate and provide a clear prompt.
Request Example (cURL)
Request Example (Python)
Successful Response Example
Field Explanation
success: Whether the request was successful.task_id: Task ID.trace_id: Link tracking ID, useful for troubleshooting.count: The number of images requested for generation or editing, supports 1–4, default is 1. If some fail,dataonly contains successful images.data[]: Result list.prompt: The prompt used for generation (echo).image_url: Direct URL of the generated image.
Note: Onlyactionandpromptare required to generate an image at/nano-banana/images
Edit Image (action=edit)
When you want to edit based on an existing image, set action to edit, and pass the list of image URLs to be edited through image_urls (1 or more), while also providing a prompt describing the editing goal.
For example, if we provide a photo of a person and a photo of a shirt, we can have the person wear that shirt by passing the image URLs and specifying the action as edit. The URLs can be HTTP URLs, publicly accessible links using https or http protocols, or Base64 encoded images, such as data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAVGCAMAAAA6u2FyAAADAFBMVEXq6uwdHCEeHyMdHS....
Request Example (cURL)
Request Example (Python)
Example of Successful Return
Field Description
image_urls[]: List of image URLs to be edited (must be publicly accessible). Multiple images can be sent, and the service will combine these materials with thepromptto complete the editing.- Other fields are the same as the “Generate Image” return.
Asynchronous Callback (Optional, Recommended)
Generation or editing may take some time. To avoid long connections occupying resources, it is recommended to use Webhook Callback viacallback_url:
- Add
callback_urlin the request body, for example, your server’s Webhook address (must be publicly accessible and support POST JSON). - The API will immediately return a response containing the
task_id(or basic results). - When the task is completed, the platform will send the complete JSON to the
callback_urlviaPOST. You can associate the request with the result using thetask_id.
Error Handling
When the call fails, a standard error format and trace ID will be returned. Common errors are as follows:- 400
token_mismatched: The request is invalid or parameters are incorrect. - 400
api_not_implemented: The interface is not implemented (please contact support). - 401
invalid_token: Authentication failed or token is missing. - 429
too_many_requests: Request frequency limit exceeded. - 500
api_error: Server exception.
Error Response Example
Parameter Correspondence and Notes
- Required:
action,prompt - Editing Specific:
image_urls(array, at least 1 item) - Optional:
model(defaultnano-banana, optionalnano-banana-2-lite,nano-banana-2,nano-banana-pro, or corresponding:officialofficial channel version),aspect_ratio(width-to-height ratio, such as1:1,16:9),resolution(resolution, such as1K,2K,4K;nano-banana-2-liteonly supports1K),callback_url(for asynchronous callback) - Headers: Must provide
authorization: Bearer {token};acceptis recommended to be set toapplication/json - Image Accessibility:
image_urlsmust be direct links that are publicly accessible (HTTP/HTTPS), HTTPS is recommended - Idempotency and Tracking: Retain
task_idandtrace_idfor troubleshooting and result association.

