画像
gpt-image-2 API
このページに表示されている正確なモデル ID を使用して、Modelflare を通じて gpt-image-2 を呼び出します。
正確なモデル ID gpt-image-2 を使用します。モデル フィールドはこのページと正確に一致する必要があります。

パラメータ: size=1536x1024n=1
プロンプト: A 24-hour laundromat at three in the morning, a whole wall of front-loaders turning. A young man in a silver metallic bomber jacket has just tipped a jar of coloured glass marbles into the nearest drum. The marbles are pouring upward out of the open door instead of sinking, already arcing across the room in a bright teal and amber bridge that rings against the ceiling lights. Cold cyan tubes overhead, a hard warm amber glow thrown out of the drum itself. Straight-on symmetrical camera, wide, hyper-real detail in the glass, film grain, no text.
{ "model": "gpt-image-2", "prompt": "A 24-hour laundromat at three in the morning, a whole wall of front-loaders turning. A young man in a silver metallic bomber jacket has just tipped a jar of coloured glass marbles into the nearest drum. The marbles are pouring upward out of the open door instead of sinking, already arcing across the room in a bright teal and amber bridge that rings against the ceiling lights. Cold cyan tubes overhead, a hard warm amber glow thrown out of the drum itself. Straight-on symmetrical camera, wide, hyper-real detail in the glass, film grain, no text.", "n": 1, "size": "1536x1024"}認証とエンドポイント
Section titled “認証とエンドポイント”https://modelflare.dev/v1 で Modelflare API キーを使用します。ゲートウェイのエントリ ポイントは POST /v1/images/generations です。
Authorization: Bearer YOUR_MODELFLARE_API_KEYcurl https://modelflare.dev/v1/images/generations \ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "A white cat runs through a neon-lit street in the rain", "size": "1024x1024", "n": 1 }'リクエストメモ
Section titled “リクエストメモ”OpenAI 互換の画像モデルは prompt、n、size、および quality を使用します。公式ページに文書化されている場合にのみ編集を使用してください。
リクエストパラメータ
Section titled “リクエストパラメータ”GPT Image は OpenAI 互換の画像 API を使用します。生成には JSON を使用します。編集とマスクガイド付き編集はマルチパートを使用します。 GPT Image 2 は、Base64 画像データを data[].b64_json で返します。
| フィールド | 必須 | 注意事項 |
|---|---|---|
model |
はい | gpt-image-2 |
prompt |
はい | 生成または編集命令 |
size |
いいえ | auto またはカスタム WIDTHxHEIGHT |
quality |
いいえ | low / medium / high / auto;デフォルトauto |
background |
いいえ | auto / opaque / transparent;透明な背景には PNG または WebP 出力が必要です |
output_format |
いいえ | png / jpeg / webp |
output_compression |
いいえ | JPEG/WebP の場合は 0 ~ 100、デフォルトは 100。 PNG の場合は無視されます |
moderation |
いいえ | auto / low;デフォルト auto |
n |
いいえ | 1 ~ 10 出力。デフォルト 1 |
応答および入力制限
Section titled “応答および入力制限”カスタム サイズでは、両方のエッジが 16 の倍数、アスペクト比が 1:3 ~ 3:1、最大エッジが 3,840 ピクセル、合計ピクセルが 655,360 ~ 8,294,400 である必要があります。編集では最大 16 個のソース画像を受け入れ、各ソースとマスクは 50 MB 未満です。 DALL・E-only response_formatは送信しないでください。
GPT Image 2 つの編集では、マルチパート image/image[] で /v1/images/edits を使用します。最大 16 個の入力画像が受け入れられ、マスクは最初の画像の形式と寸法に一致する必要があります。
curl https://modelflare.dev/v1/images/edits \ -H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \ -F "model=gpt-image-2" \ -F "image[]=@/path/to/product.png" \ -F "mask=@/path/to/mask.png" \ -F "prompt=保持主体不变,将背景替换为暖色摄影棚渐变" \ -F "size=1536x1024" \ -F "quality=high" \ -F "output_format=png" \ -F "n=1"エラーと失敗したタスク
Section titled “エラーと失敗したタスク”無効なモデル パラメーターは、リクエスト ID を含む 4xx を返します。選択したモデル コントラクトによって定義された応答フィールドとエラー メッセージを使用します。
サポート範囲
Section titled “サポート範囲”このページでは、Modelflare モデルの生成と編集呼び出しについて説明します。検索またはマップのエンリッチメント、音声管理、および要素ライブラリ管理は、このパブリック モデル呼び出しサーフェスの外部にあるリソース API であり、必須のリクエスト フィールドではありません。
価格設定と請求
Section titled “価格設定と請求”このモデルはトークンベースの課金を使用します。現在の顧客価格、参考定価、完全な仕様については、モデル価格ページを参照してください。
メディア契約 · v1
公式ソース: OpenAI
契約パラメータ
| インテントフィールド | コントロール | オプション |
|---|---|---|
size | select | auto / 1024x1024 / 1536x1024 / 1024x1536 |
quality | select | auto / low / medium / high |
n | number | — |
サポートされる機能
allowed_values·size· auto, 1024x1024, 1536x1024, 1024x1536allowed_values·quality· auto, low, medium, highmax_assets·reference_asset_ids· 16
構造化リクエストの例
text
インテント
{
"n": 1,
"prompt": "A red paper kite over a quiet harbour at dusk.",
"quality": "auto",
"size": "auto"
}プロバイダーリクエスト
{
"model": "gpt-image-2",
"n": 1,
"prompt": "A red paper kite over a quiet harbour at dusk.",
"quality": "auto",
"size": "auto"
}reference
インテント
{
"n": 1,
"prompt": "A red paper kite over a quiet harbour at dusk.",
"quality": "auto",
"size": "auto"
}プロバイダーリクエスト
{
"images": [
"https://example.com/reference.png"
],
"model": "gpt-image-2",
"n": 1,
"prompt": "A red paper kite over a quiet harbour at dusk.",
"quality": "auto",
"size": "auto"
}