Skip to main content
POST
gemini-nano-banana-2.1

Authorizations

Authorization
string
header
required

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

Body

application/json
model
enum<string>
required

Must be one of: gemini-nano-banana-2.1.

Available options:
gemini-nano-banana-2.1
prompt
string

Length must be at least 1.

Minimum string length: 1
images
string[]

Maximum 14 items.

Maximum array length: 14
image_is_base64
enum<boolean>[]

One flag per reference image; omit for URLs.

Maximum array length: 14
Available options:
false,
true
size
enum<string>

Width x height ratio, for example 21x9 or 9x16.

Available options:
16x9,
1x1,
1x4,
1x8,
21x9,
2x3,
3x2,
3x4,
4x1,
4x3,
4x5,
5x4,
8x1,
9x16
quality
enum<string>
default:1K

Resolution affects upstream token usage; billing remains per token. Defaults to 1K.

Available options:
1K,
2K,
4K
max_images
integer
default:1

Must be between 1 and 1. Defaults to 1.

Required range: 1 <= x <= 1
output_format
enum<string>

Must be one of: jpeg, png.

Available options:
jpeg,
png
output_compression
integer

Use with output_format=jpeg; PNG does not accept compression.

Required range: 0 <= x <= 100
extends.response_modalities
enum<string>[]

Requires updated code. Use [IMAGE] or [TEXT,IMAGE]; image tasks require IMAGE.

Required array length: 1 - 2 elements
Available options:
IMAGE,
TEXT
extends.thinking_level
enum<string>

Requires updated code. Omit to retain upstream default; LOW is unsupported.

Available options:
HIGH,
MEDIUM,
MINIMAL
videos
string[]

Optional array of video URL strings. Supports HTTPS or gs URIs, with up to 10 videos and at most one YouTube link. The MIME type is inferred from the URL path extension. For URLs without a file extension, use the legacy extends video format to specify the MIME type explicitly. Cannot be combined with legacy video fields.

Maximum array length: 10
extends.video_url
string

Requires updated code. HTTPS or gs URI; omitted video_mime_type defaults to video/mp4.

extends.video_mime_type
enum<string>

Requires updated code; only used with extends.video_url.

Available options:
video/3gpp,
video/avi,
video/mp4,
video/mpeg,
video/mpg,
video/quicktime,
video/webm,
video/wmv,
video/x-flv
extends.videos
string[]

Requires updated code. Each item: {url,mime_type}; at most one YouTube video. Item and URL safety validation is enforced by code.

Maximum array length: 10

Response

Business response. code=0 means the task was accepted; validation failures can return HTTP 200 with code=400.

code
enum<integer>
required
Available options:
0
Example:

0

data
object
required
msg
string
required
Example:

"success"

request_id
string<uuid>
Example:

"250b66dd-e1fb-4bb6-b5f6-c668efadc35d"