images-reframe

Reframe an image with Gemini 3.1 Flash Image

Expand one image to a new aspect ratio with Gemini 3.1 Flash Image. Supply either an existing Ideogram image asset or raw image bytes, but not both. The requested aspect ratio is resolved to the closest supported 1K output dimensions.

This operation is asynchronous. It returns as soon as the request is accepted; poll GET /v1/generations/{generation_id} for completion and results.

post/v2/images/reframe/gemini-3.1-flash-image

Request body

imagestring binary

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

aspect_ratiostring required

The requested output aspect ratio. It resolves to the closest dimensions Gemini supports at the 1K output tier.

privateboolean

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_imagesinteger

The number of output images to generate.

seedinteger

Random seed. Set for reproducible generation.

Example request

{
  "image_asset_identifier": {
    "asset_type": "RESPONSE",
    "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
  },
  "seed": 12345
}

Response

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

generation_idstring required

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

seedinteger required

Random seed. Set for reproducible generation.

widthinteger required

The resolved 1K output width in pixels.

heightinteger required

The resolved 1K output height in pixels.

Example response

{
  "seed": 12345,
  "generation_id": "generation_id",
  "width": 0,
  "height": 6
}

Changes

Changed in 2 of the 18 revisions of this API.3

    • added the media type application/json for the response with the status

      response-media-type-added

    • added the media type application/json for the response with the status

      response-media-type-added

    • endpoint added

      endpoint-added