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>

The five additional ratios require the updated Vertex provider.

Available options:
16:9,
16x9,
1:1,
1:4,
1:8,
1x1,
1x4,
1x8,
21:9,
21x9,
2:3,
2x3,
3:2,
3:4,
3x2,
3x4,
4:1,
4:3,
4:5,
4x1,
4x3,
4x5,
5:4,
5x4,
8:1,
8x1,
9:16,
9:21,
9x16,
9x21
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[]

可选视频 URL 字符串数组;HTTPS/gs URI,最多 10 个,最多一个 YouTube 链接。按 URL 路径后缀推断 MIME;无后缀链接请使用旧 extends 视频格式显式指定 MIME。不可与旧视频字段混用。.

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"