コンテンツにスキップ
オープンキャスタリーコンソール

画像

gemini-3.1-flash-lite-image API

このページに表示されている正確なモデル ID を使用して、Modelflare を通じて gemini-3.1-flash-lite-image を呼び出します。

正確なモデル ID gemini-3.1-flash-lite-image を使用します。モデル フィールドはこのページと正確に一致する必要があります。

深夜のヌードルカウンターの上で、サンゴと紫のリボンを蒸気で編み上げます。

サンプル出力gemini-3.1-flash-lite-imagePOST /v1beta/models/gemini-3.1-flash-lite-image:generateContent

パラメータ: ratio=16:9

プロンプト: A late-night noodle counter, six stools and a steel pass, rain on the window behind. A cook in an orange quilted jacket has just lifted the lid off a stock pot. The steam is not dispersing: it has gathered into solid braided ribbons of coral and ultraviolet that rope up past her face and press flat along the ceiling. One hard tungsten bulb directly overhead, the street outside cold and blue. Wide camera at counter height, real density in the steam, film grain, slight vignette, no text.

このサンプルを作成したリクエスト
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "A late-night noodle counter, six stools and a steel pass, rain on the window behind. A cook in an orange quilted jacket has just lifted the lid off a stock pot. The steam is not dispersing: it has gathered into solid braided ribbons of coral and ultraviolet that rope up past her face and press flat along the ceiling. One hard tungsten bulb directly overhead, the street outside cold and blue. Wide camera at counter height, real density in the steam, film grain, slight vignette, no text."
}
]
}
],
"generationConfig": {
"responseModalities": [
"IMAGE"
],
"imageConfig": {
"aspectRatio": "16:9"
}
}
}

https://modelflare.dev で Modelflare API キーを使用します。ゲートウェイのエントリ ポイントは POST /v1/models/{model}:generateContent です。

HTTP
Authorization: Bearer YOUR_MODELFLARE_API_KEY
ターミナルウィンドウbash
curl "https://modelflare.dev/v1/models/gemini-3.1-flash-lite-image:generateContent" \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role": "user", "parts": [{"text": "A white cat runs through a neon-lit street in the rain"}]}],
"generationConfig": {"responseModalities": ["TEXT", "IMAGE"], "imageConfig": {"aspectRatio": "16:9", "imageSize": "1K"}}
}'

Gemini イメージ モデルはネイティブ contents および generationConfig を使用します。編集では、テキスト指示と inline_data を同じ parts[] で送信します。

Gemini イメージ モデルはネイティブ Gemini generateContent を使用します。テキストと参照画像を同じ contents[].parts[] に配置します。画像はinline_dataを使用しています。これらのモデルを /v1/images/generations、/v1/images/edits、または OpenAI /v1/responses に送信しないでください。 imageSize 列挙型はモデル固有であり、以下に示します。

フィールド 必須 注意事項
contents[].parts[].text はい テキストプロンプトまたは編集指示
contents[].parts[].inline_data いいえ Base64画像データとMIMEタイプ
contents[].parts[].inline_data.mime_type いいえ image/jpeg / image/png / image/webp
contents[].parts[].inline_data.data いいえ Base64 でエンコードされた参照画像コンテンツ
generationConfig.responseModalities はい ["IMAGE"]または["TEXT", "IMAGE"]
generationConfig.imageConfig.aspectRatio いいえ 1:1 / 3:2 / 2:3 / 3:4 / 4:3 / 4:5 / 5:4 / 9:16 / 16:9 / 21:9
generationConfig.imageConfig.imageSize いいえ 1K

Liteは、1:1、3:2、2:3、3:4、4:3、4:5、5:4、9:16、16:9、21:9では1Kのみをサポートします。公式ドキュメントでは参照イメージ数の上限が公開されていないため、ゲートウェイはローカルの上限を追加せず、サービス制限を超えた場合にサービス エラーを返します。

編集指示と参照画像を同じcontents[].parts[]に入れます。 inline_data.data は Base64 画像コンテンツです。 Gemini イメージ モデルを OpenAI イメージまたは Responses エンドポイントに送信しないでください。

ターミナルウィンドウbash
curl "https://modelflare.dev/v1/models/gemini-3.1-flash-lite-image:generateContent" \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role": "user", "parts": [
{"text": "Keep the subject and lighting, but replace the background with a misty pine forest."},
{"inline_data": {"mime_type": "image/jpeg", "data": "BASE64_IMAGE_DATA"}}
]}],
"generationConfig": {"responseModalities": ["TEXT", "IMAGE"], "imageConfig": {"aspectRatio": "1:1", "imageSize": "1K"}}
}'

candidates[].content.parts[] を読み取ります。応答にはテキスト部分と画像部分が一緒に含まれる可能性があるため、すべての部分が画像であると想定しないでください。

フィールド 注意事項
candidates[].content.parts[].inline_data 生成された画像の MIME タイプと Base64 データ
candidates[].content.parts[].text TEXT が要求されたときにテキスト キャプションが返されました
candidates[].finishReason 完了または安全上の理由
usageMetadata サービスによって返されたときの入出力トークンの使用法

Modelflare は、gemini-3.1-flash-lite-image のネイティブ Gemini 応答形状を保存し、使用可能な画像部分を保持します。

ネイティブ Gemini リクエストからのフィールド エラー、サイズ/比率制限、および安全性の拒否は、Gemini 互換のエラー応答のままです。ゲートウェイはそれらを OpenAI Images 応答として書き換えません。

このページでは、Modelflare モデルの生成と編集呼び出しについて説明します。検索またはマップのエンリッチメント、音声管理、および要素ライブラリ管理は、このパブリック モデル呼び出しサーフェスの外部にあるリソース API であり、必須のリクエスト フィールドではありません。

このモデルはトークンベースの課金を使用します。現在の顧客価格、参考定価、完全な仕様については、モデル価格ページを参照してください。

メディア契約 · v1

契約ID: media.gemini-3-1-flash-lite-image.v1アダプター: image.gemini.native.v1@v1指紋: 3eb181032c0d879a99b4c879c0ee28f714c72bf3d9c228ccc50eb61a3778b79e

公式ソース: Google

契約パラメータ

インテントフィールドコントロールオプション
sizeselect1K
ratioselect1:1 / 3:2 / 2:3 / 3:4 / 4:3 / 4:5 / 5:4 / 9:16 / 16:9 / 21:9

サポートされる機能

  • allowed_values · size · 1K
  • allowed_values · ratio · 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

構造化リクエストの例

text

インテント

{
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "1:1",
  "size": "1K"
}

プロバイダーリクエスト

{
  "contents": [
    {
      "parts": [
        {
          "text": "A red paper kite over a quiet harbour at dusk."
        }
      ],
      "role": "user"
    }
  ],
  "generationConfig": {
    "imageConfig": {
      "aspectRatio": "1:1",
      "imageSize": "1K"
    },
    "responseModalities": [
      "TEXT",
      "IMAGE"
    ]
  },
  "systemInstruction": {
    "parts": [
      {
        "text": "Generate an image for the user's request. If details are missing, choose reasonable defaults and still return an image. Do not ask clarifying questions."
      }
    ]
  }
}

reference

インテント

{
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "1:1",
  "size": "1K"
}

プロバイダーリクエスト

{
  "contents": [
    {
      "parts": [
        {
          "text": "A red paper kite over a quiet harbour at dusk."
        },
        {
          "inline_data": {
            "data": "AAAA",
            "mime_type": "image/png"
          }
        }
      ],
      "role": "user"
    }
  ],
  "generationConfig": {
    "imageConfig": {
      "aspectRatio": "1:1",
      "imageSize": "1K"
    },
    "responseModalities": [
      "TEXT",
      "IMAGE"
    ]
  },
  "systemInstruction": {
    "parts": [
      {
        "text": "Generate an image for the user's request. If details are missing, choose reasonable defaults and still return an image. Do not ask clarifying questions."
      }
    ]
  }
}