Skip to main content
POST
Nano Banana image generation

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required

The prompt which used to generate the images

Example:

"A fluffy orange cat running through a sunny meadow"

action
enum<string>
required

Action type: edit (modify existing images) or generate (create new images)

Available options:
edit,
generate
Example:

"generate"

num_images
number
default:1

only support generate 1 image, default is 1

image_urls
string<uri>[]

Link to the picture that needs to be edited. It can be a accessible http or https url, The image size should not exceed 10MB for each. If the action is edit, this parameter is required.

Example:
aspect_ratio
enum<string>

The aspect ratio of the image, nano-banana-2 supports all aspect ratios, other models only support 21:9, 1:1, 4:3, 3:2, 2:3, 5:4, 4:5, 3:4, 16:9, 9:16

Available options:
21:9,
1:1,
4:3,
3:2,
2:3,
5:4,
4:5,
3:4,
16:9,
9:16,
1:4,
4:1,
1:8,
8:1
Example:

"1:1"

model
enum<string>
default:nano-banana-fast

The model of the image, default is NanoBananaFast

Available options:
nano-banana-fast,
nano-banana-pro,
nano-banana-2,
nano-banana-2-lite
Example:

"nano-banana-fast"

resolution
enum<string>

The resolution of the image, only valid when model is nano-banana-pro or nano-banana-2

Available options:
1K,
2K,
4K
Example:

"1K"

Response

201 - application/json
taskId
string
required

task id, used to get task result later