API

Nano Banana 2

image

Nano Banana 2 API combines real-time world knowledge with advanced reasoning to deliver stronger prompt understanding and more accurate visual results. Generate consistent multi-subject images in native 4K, support flexible aspect ratios, and create polished global typography across complex compositions. Integrate Nano Banana 2 API to build smarter, high-quality image workflows at scale.

Authorizations

Bearerstringheaderrequired

API key to authorize requests

Body

application/json
modelstringrequired
nano-banana-2
input.promptstringrequired

Describe the image to create, or the changes to make to your reference images. Whitespace is trimmed.

Maximum length: 5,000 characters

input.imagesstring[]optional

Optional reference images. Use publicly accessible HTTPS URLs or data:image/* base64 URIs. Omit for text-to-image.

Maximum items: 14

input.aspect_ratiostringoptional

Output width-to-height ratio. Auto lets the model choose.

Default: auto

auto1:12:33:23:44:34:55:49:1616:921:91:44:11:88:1
input.resolutionstringoptional

Output resolution tier; values are case-insensitive. Omit or leave empty to use the default.

Default: 2k

1k2k4k

Response

Successful response

task_idstringrequired
statusstringrequired
Available options: waiting, succeed, failed, processing