> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jiekou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Nano Banana 2 Image-to-Image

Generate images with the Nano Banana 2 model based on a text prompt and reference images, with support for configuring the image aspect ratio and quality level.

## Request Headers

<ParamField header="Content-Type" type="string" required={true}>
  Enum value: `application/json`
</ParamField>

<ParamField header="Authorization" type="string" required={true}>
  Bearer authentication format: Bearer \{\{API Key}}.
</ParamField>

## Request Body

<ParamField body="prompt" type="string" required={true}>
  The text prompt used to generate the image. Chinese and English are supported. We recommend keeping it under 1,000 characters.
</ParamField>

<ParamField body="image" type="string | string[]" required={true}>
  Reference image(s) for image-to-image generation. Supports image URLs or Base64 encoding. You can pass a single image (string) or multiple images (string array).
</ParamField>

<ParamField body="size" type="string" default="1x1">
  The aspect ratio of the output image. The system automatically maps it to the corresponding pixel dimensions.

  Available values: `1x1`, `2x3`, `3x2`, `3x4`, `4x3`, `4x5`, `5x4`, `9x16`, `16x9`, `21x9`
</ParamField>

<ParamField body="quality" type="string" default="1k">
  The image generation quality level. Higher quality can generate clearer, more detailed images.

  Available values: `1k`, `2k`, `4k`
</ParamField>

<ParamField body="response_format" type="string" default="url">
  The return format for the generated image.

  Available values: `url`, `b64_json`
</ParamField>

## Response Information

<ResponseField name="images" type="string[]" required={true}>
  The generated image array. Each element is an image URL (when `response_format` is `url`) or a Base64-encoded string (when `response_format` is `b64_json`).
</ResponseField>
