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/startStart Nano Banana image generation
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name of the image generation task |
| prompt | string | Yes | Text prompt for image generation |
| model | enum: nano-banana | nano-banana-pro | nano-banana-2 | nano-banana-2-lite | No | Model 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_images | array<string> | No | Array of input image URLs (for editing and composition modes) |
| aspect_ratio | enum: auto | 16:9 | 1:1 | 9:16 | 4:3 | 3:4 | 2:3 | 3:2 | 4:5 | 5:4 | 21:9 | No | Aspect 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_size | enum: 1K | 2K | 4K | No | Size 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_search | boolean | No | Use Google Web Search grounding to generate images based on real-time information. Only supported by nano-banana-2 model. |
| force_generate | boolean | No | Force generation even if NSFW content is detected. Defaults to true for API users, false for web users |
| webhook_url | string | No | HTTPS 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_token | string | No | Optional 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/startStart Nano Banana image generation
GET
/api/v1/userNanoBanana/allRecordsGet Nano Banana task list
POST
/api/v1/userNanoBanana/batchDetailBatch 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