Skip to navigation

Reframe with Nano Banana 2

Expand an image to a new aspect ratio with Nano Banana 2. Upload the source image using multipart/form-data. Always asynchronous: returns a generation_id; poll GET /v2/generations/{generation_id} for results.

Authentication

Api-Keystring

API key for access control. Use in the header with the name "Api-Key"

Query parameters

dry_runbooleanOptionalDefaults to false

When true, the request is validated and priced but not run: nothing is generated, stored, or billed, and no safety review is performed. The response is a PriceQuote object instead of the usual response for this endpoint. Send exactly the request you would send to generate, so the quote reflects the same options.

Request

This endpoint expects a multipart form containing a file.
imagefileRequired

The JPEG, PNG, or WEBP image to reframe (max 50MB).

aspect_ratiostringRequiredformat: "^[1-9][0-9]*:[1-9][0-9]*$"3-21 characters
The requested output aspect ratio. It resolves to the closest dimensions the model supports at the 1K output tier.
privatebooleanOptional

API-key requests are always private. For bearer-authenticated requests, this controls whether the result is private; when omitted, it follows the caller's plan entitlement. Enterprise generations are always private.

num_imagesintegerOptional1-4Defaults to 1
The number of output images to generate.
seedintegerOptional0-2147483647
Random seed. Set for reproducible generation.

Response

An acknowledgement to poll with GET /v2/generations/{generation_id}.

generation_idstring

URL-safe base64 ID of the accepted generation. Accepted by the GET /v2/generations/{generation_id} polling endpoint.

seedinteger0-2147483647
Random seed. Set for reproducible generation.
widthinteger
The resolved 1K output width in pixels.
heightinteger
The resolved 1K output height in pixels.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error