> ## 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 画像から画像生成

テキストプロンプトと参照画像に基づいて Nano Banana 2 モデルで画像を生成します。画像のアスペクト比と画質レベルを設定できます。

## リクエストヘッダー

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

<ParamField header="Authorization" type="string" required={true}>
  Bearer 認証形式: Bearer \{\{API Key}}。
</ParamField>

## リクエストボディ

<ParamField body="prompt" type="string" required={true}>
  画像生成に使用するテキストプロンプトです。中国語と英語に対応しています。1000 文字以内を推奨します。
</ParamField>

<ParamField body="image" type="string | string[]" required={true}>
  画像から画像生成の参照画像です。画像 URL または Base64 エンコードに対応しています。単一の画像（文字列）または複数の画像（文字列配列）を渡せます。
</ParamField>

<ParamField body="size" type="string" default="1x1">
  出力画像のアスペクト比です。システムが対応するピクセルサイズに自動的にマッピングします。

  選択可能な値：`1x1`, `2x3`, `3x2`, `3x4`, `4x3`, `4x5`, `5x4`, `9x16`, `16x9`, `21x9`
</ParamField>

<ParamField body="quality" type="string" default="1k">
  画像生成の品質レベルです。より高い品質では、より鮮明で精細な画像を生成できます。

  選択可能な値：`1k`, `2k`, `4k`
</ParamField>

<ParamField body="response_format" type="string" default="url">
  生成画像の返却形式です。

  選択可能な値：`url`, `b64_json`
</ParamField>

## レスポンス情報

<ResponseField name="images" type="string[]" required={true}>
  生成された画像の配列です。要素は画像 URL（`response_format` が `url` の場合）または Base64 エンコード文字列（`response_format` が `b64_json` の場合）です。
</ResponseField>
