> ## 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="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>
