> ## 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.

# Gemini 3.1 Flash 画像生成

Gemini 3.1 Flash Image Preview モデルを使用して、テキストプロンプトから画像を生成します。より高品質な生成結果を得るために、画像サイズ、アスペクト比、思考深度を設定できます。

## リクエストヘッダー

<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="size" type="string" default="1K">
  出力画像のピクセルサイズ（幅\*高さ）。0.5K（512px）は Gemini 3.1 Flash でのみ利用できます。

  指定可能な値：`0.5K`, `1K`, `2K`, `4K`
</ParamField>

<ParamField body="google" type="object">
  Google 検索オプション

  <Expandable title="properties" defaultOpen={true}>
    <ParamField body="web_search" type="boolean" default={false}>
      Google ウェブ検索を有効にし、現実世界の情報に基づいてより正確な画像を生成します。
    </ParamField>

    <ParamField body="image_search" type="boolean" default={false}>
      Google 画像検索を有効にし、実際の画像を生成の視覚的な参照として使用します。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="prompt" type="string" required={true}>
  生成する画像を説明するテキストプロンプト
</ParamField>

<ParamField body="aspect_ratio" type="string" default="1:1">
  生成画像のアスペクト比。

  指定可能な値：`1:1`, `1:4`, `1:8`, `2:3`, `3:2`, `3:4`, `4:1`, `4:3`, `4:5`, `5:4`, `8:1`, `9:16`, `16:9`, `21:9`
</ParamField>

<ParamField body="output_format" type="string" default="image/png">
  出力画像の MIME タイプ。PNG および JPEG 形式をサポートします。

  指定可能な値：`image/png`, `image/jpeg`
</ParamField>

## レスポンス情報

<ResponseField name="image_urls" type="string[]" required={true}>
  生成された画像 URL のリスト
</ResponseField>

<ResponseField name="grounding_metadata" type="object" required={false}>
  モデルの grounding メタデータ。Google のサーバー側ツール（検索など）が呼び出された場合に返されます。注意：ツール呼び出しは Google に依存します。パラメータでツールを有効にしても、必ず 100% ツール呼び出しが発生するとは限りません。
</ResponseField>
