docs.bananaapi.io
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
Banana API
Common API
Banana API
Common API
  1. Banana API
  • Generate Image Callbacks (Banana 2.1)
  • Generate Image Callbacks (Banana 2 Lite)
  • Welcome to Banana API
  • Banana API Quickstart
  • Image Generation or Editing Callbacks
  • Generate Image Callbacks (Banana 2)
  • Generate Image (Pro) Callbacks
  • Generate Image (Banana 2.1)
    POST
  • Generate Image (Banana 2 Lite)
    POST
  • Generate or Edit Image
    POST
  • Generate Image (Banana 2)
    POST
  • Generate Image (Pro)
    POST
  • Get Task Details
    GET
  1. Banana API

Generate Image (Banana 2.1)

POST
/api/v1/nanobanana/generate-2-1
Submit a Nano Banana 2.1 image generation or multi-image editing task via POST /api/v1/nanobanana/generate-2-1.

Important Notes#

Query task progress using the returned taskId via Get Task Details, or supply callBackUrl to receive automatic webhook notifications.
prompt supports up to 20,000 characters.
Omit imageUrls (or pass []) for pure text-to-image generation; pass up to 10 reference image URLs (PNG, JPG, WEBP, up to 30 MB each) for image-to-image / multi-reference editing.
Supports 15 aspect ratios (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), 1K / 2K / 4K resolution, and jpg / png output formats.

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200Success
application/json
Request successful
Bodyapplication/json

Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.bananaapi.io/api/v1/nanobanana/generate-2-1' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "prompt": "a happy dog running in the park",
    "imageUrls": [],
    "aspectRatio": "auto",
    "resolution": "1K",
    "googleSearch": false,
    "outputFormat": "jpg",
    "callBackUrl": "https://example-callback.com"
}'
Response Response Example
{
    "code": 200,
    "message": "success",
    "data": {
        "taskId": "task_12345678"
    }
}
Modified at 2026-12-05 02:14:50
Previous
Generate Image (Pro) Callbacks
Next
Generate Image (Banana 2 Lite)
Built with