Developer Docs/Nano Banana API

Nano Banana API

Build Nano Banana integrations with A2E. Review authentication, request parameters, task creation, status, and result endpoints.

Overview

Image generation powered by Google Gemini's image model. Accepts text-only prompts or text combined with up to four reference images for high-fidelity, semantically-aware output.

Primary Endpoint

POST/api/v1/userNanoBanana/start

Start Nano Banana image generation

Request Parameters

NameTypeRequiredDescription
namestringYesName of the image generation task
promptstringYesText prompt for image generation
modelenum: nano-banana | nano-banana-pro | nano-banana-2 | nano-banana-2-liteNoModel to use for generation. Options: nano-banana (no resolution control, auto edit mode with images), nano-banana-pro (with resolution control), nano-banana-2 (with resolution control), nano-banana-2-lite (1K only)
input_imagesarray<string>NoArray of input image URLs (for editing and composition modes)
aspect_ratioenum: auto | 16:9 | 1:1 | 9:16 | 4:3 | 3:4 | 2:3 | 3:2 | 4:5 | 5:4 | 21:9NoAspect ratio of the generated image. Options: auto, 16:9, 1:1, 9:16, 4:3, 3:4, 2:3, 3:2, 4:5, 5:4, 21:9
image_sizeenum: 1K | 2K | 4KNoSize of the generated image. Options: 1K, 2K, 4K. Note: supported by nano-banana-pro and nano-banana-2 models; nano-banana-2-lite is always forced to 1K.
google_searchbooleanNoUse Google Web Search grounding to generate images based on real-time information. Only supported by nano-banana-2 model.
force_generatebooleanNoForce generation even if NSFW content is detected. Defaults to true for API users, false for web users
webhook_urlstringNoHTTPS URL to receive task.completed / task.failed notifications. Best-effort delivery, single attempt, no retries; clients should treat the detail API as the source of truth.
webhook_tokenstringNoOptional plaintext token returned in the X-A2e-Webhook-Token header so receivers can verify the request originated from a2e.

Request Example

curl -X POST "https://www.a2e.com.cn/api/v1/userNanoBanana/start" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Beautiful Landscape",
  "prompt": "A serene mountain landscape at sunset with a crystal clear lake",
  "model": "nano-banana-pro",
  "input_images": [
    "https://example.com/image1.jpg"
  ],
  "aspect_ratio": "auto",
  "image_size": "1K",
  "google_search": false,
  "force_generate": true,
  "webhook_url": "https://your-server.example.com/a2e/webhook",
  "webhook_token": "a-shared-secret"
}'

Related Endpoints

POST/api/v1/userNanoBanana/start

Start Nano Banana image generation

GET/api/v1/userNanoBanana/allRecords

Get Nano Banana task list

POST/api/v1/userNanoBanana/batchDetail

Batch query task details

GET/api/v1/userNanoBanana/detail/{id}

Get task details

DELETE/api/v1/userNanoBanana/delete/{id}

Delete task

Responses

200

Nano Banana task started successfully or NSFW content detected

400

Bad Request - Invalid parameters

401

Unauthorized - Invalid or missing bearer token