Skip to main content
POST
Nano Banana 2

Authorizations

x-api-key
string
header
required

Query Parameters

webhookUrl
string

Your Webhook URL, if specified, the result of the generation will be POSTed to this URL.

demoMode
enum<string>

This parameter is for your tests on development, if not set, the generation will actually be submitted and deducted from your balance (suited for production).

if set, a dummy generation will be submitted without deducting from your balance (suited for development) - when set to 'failure', the dummy generation will be 'failed' after a few seconds, if set to 'success', the dummy generation will be 'completed' after a few seconds.

The dummy generation will be available for only 5 minutes to query from 'Get Generation by ID' endpoint, and the result webhook (if webhook is set), will be sent only a few seconds after submitting the dummy generation.

Note 1: in all scenarios, if the initial validation fails, the submit request itself will directly return the validation error.

Note 2: dummy input file isn't supported yet, meaning if you want to test a generation that has input files, you need to supply an actual file (URL or upload via /upload endpoint), this is because some validations happen on input files.

Available options:
failure,
success

Body

application/json
prompt
string
required
Required string length: 10 - 5000
Example:

"<your-prompt>"

quality
enum<string>
required
Available options:
2K,
4K
aspectRatio
enum<string>
required

When no input image provided, aspect ratio cannot be auto

Available options:
auto,
21:9,
1:1,
4:3,
3:2,
2:3,
5:4,
4:5,
3:4,
16:9,
9:16
images
string[]

An array of image names or download URLs - if you don't have a download URL, you can upload the file and get the file name from the /upload endpoint.

Maximum array length: 14
Minimum string length: 1

Response

Response for status 200

genId
string
required
Last modified on August 2, 2026