跳到內容
開放式卡斯塔利控制台

圖片

gpt-image-2.5-flare API

透過 Modelflare 使用本頁顯示的確切型號 ID 呼叫 gpt-image-2.5-flare。

使用準確的型號 ID gpt-image-2.5-flare。模型欄位必須與此頁面完全相符。

繪本插圖:黃昏時分,一隻戴著藍色圍巾的小狐狸提著紙燈籠穿過白雪皚皚的白樺林。

範例輸出gpt-image-2.5-flarePOST /v1/images/generations

參數: size=1536x1024quality=mediumn=1

提示詞: Children's picture-book illustration: a small fox carrying a paper lantern through a snowy birch forest at dusk, soft gouache textures, gentle blues and warm orange glow, friendly and calm, no text.

產生此樣本的請求
{
"model": "gpt-image-2.5-flare",
"prompt": "Children's picture-book illustration: a small fox carrying a paper lantern through a snowy birch forest at dusk, soft gouache textures, gentle blues and warm orange glow, friendly and calm, no text.",
"n": 1,
"size": "1536x1024",
"quality": "medium"
}

將 Modelflare API 金鑰與 https://modelflare.dev/v1 結合使用。網關入口點是POST /v1/images/generations。

HTTP
Authorization: Bearer YOUR_MODELFLARE_API_KEY
終端機視窗bash
curl https://modelflare.dev/v1/images/generations \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.5-flare",
"prompt": "A white cat runs through a neon-lit street in the rain",
"size": "1536x1024", "quality": "high", "background": "opaque", "output_format": "jpeg",
"output_compression": 85, "moderation": "auto", "n": 1
}'

GPT Image 2.5 Flare 是日常生成和編輯的快速、高品質的預設;保留images[]、image[]、mask和完整的輸出控制。

GPT Image 2.5 使用與 OpenAI 相容的圖像 API。產生使用JSON;編輯接受 JSON 影像引用或多部分檔案;回應傳回 data[].b64_json 中的 Base64 影像資料。

場 必填 註釋
model 是 gpt-image-2.5-flare
prompt 是 產生或編輯指令,1–32,000 個字符
images[] 有條件 對於 JSON 編輯,最多 16 個 file_id 或 image_url 對象
images[].file_id 有條件 上傳檔案API ID
images[].image_url 有條件 圖片 URL 或 Base64 資料 URL;資料 URL 限制為 20,971,520 個字符
image 有條件 一個多部分來源檔案;對多個檔案使用 image[]
image[] 有條件 對於多部分編輯,最多 16 個來源文件
mask 否 Alpha 遮罩與第一個來源格式/大小相符且小於 50 MB
size 否 auto或自訂WIDTHxHEIGHT; 16 像素倍數,1:3–3:1 寬高比,最大邊緣 3,840 像素,總像素 655,360–8,294,400
quality 否 low / medium / high / xhigh / max / auto;預設auto
background 否 auto / opaque / transparent;透明背景需要 PNG 或 WebP 輸出
output_format 否 png / jpeg / webp;預設png
output_compression 否 JPEG/WebP 為 0–100,預設為 100; PNG 被忽略
moderation 否 auto / low;預設auto
n 否 1–10 個輸出;預設1

GPT Image 2.5 Flare 和 Sunburst 支援最多 16 個編輯輸入。 JSON 編輯使用 images[] 和 file_id 或 image_url;多部分編輯使用 image/image[],每個來源影像和遮罩小於 50 MB。提示符號為 1–32,000 個字元;畫質支援low/medium/high/xhigh/max/auto;尺寸規則為 16 像素倍數、1:3–3:1 寬高比、最大邊緣 3,840 像素、總像素倍數 655,360,25,360,409 像素、總像素 65,360,49,360,094,009,094。透明背景需要PNG或WebP;壓縮僅適用於 JPEG/WebP,對於 PNG 會被忽略。 2560x1440 以上的解析度是實驗性的。閱讀data[].b64_json;不要發送 DALL·E-only response_format。 Flare 是日常生成和編輯的快速、高品質的預設; Sunburst 適用於更高保真度、更高控制力的工作。

GPT Image 2.5 支援 JSON 影像引用和透過 /v1/images/edits 進行分段檔案上傳。 JSON 使用 file_id 或 image_url 最多接受 16 個物件; multipart 最多接受 16 個原始檔。請勿在一項請求中將 images 與 image/image[] 混合使用。

終端機視窗bash
curl https://modelflare.dev/v1/images/edits \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.5-flare",
"images": [{"file_id": "file-example123"}, {"image_url": "https://example.com/reference.png"}],
"prompt": "Keep the product unchanged and replace the background with a warm studio gradient",
"size": "1536x1024", "quality": "high", "background": "opaque", "output_format": "png", "n": 1
}'
終端機視窗bash
curl https://modelflare.dev/v1/images/edits \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-F "model=gpt-image-2.5-flare" \
-F "image[]=@/path/to/product.png" \
-F "mask=@/path/to/mask.png" \
-F "prompt=Keep the product unchanged and replace the background with a warm studio gradient" \
-F "size=1536x1024" \
-F "quality=high" \
-F "background=opaque" \
-F "output_format=png" \
-F "n=1"

從data[]讀取產生和編輯的結果。 GPT Image 2.5返回Base64圖像資料;不要將回應視為 URL 輸出。

場 註釋
created 建立時間為 Unix 時間戳記(以秒為單位)
data 產生或編輯的影像結果
data[].b64_json Base64編碼的影像數據
background 最終背景模式:opaque或transparent
output_format 返回影像格式:png、jpeg或webp
quality 使用的品質等級
size 最終尺寸為 WIDTHxHEIGHT

無效的模型參數傳回帶有請求ID的4xx;使用所選模型合約定義的回應欄位和錯誤訊息。

此頁面涵蓋 Modelflare 模型產生和編輯呼叫。搜尋或地圖豐富、語音管理和元素庫管理是此公共模型呼叫表面之外的資源 API,並且不是必需的請求欄位。

此模型使用基於令牌的計費。請參閱 型號定價頁面 ,以了解當前客戶價格、參考標價和完整規格。

媒體合約 · v1

合約 ID: media.gpt-image-2-5-flare.v1適配器: image.openai.edit.v1@v1指紋: c4cbeff1ea117434ea2e7d714a58e7707eb2f7ca395190430840222909617f0b

官方來源: OpenAI

合約參數

意圖字段控制項選項
sizeselectauto / 1024x1024 / 1536x1024 / 1024x1536
qualityselectlow / medium / high
output_formatselectpng / jpeg / webp
backgroundselectauto / opaque / transparent
moderationselectauto / low
nnumber—
output_compressionnumber—

支援的功能

  • allowed_values · size · auto, 1024x1024, 1536x1024, 1024x1536
  • allowed_values · quality · low, medium, high
  • max_assets · reference_asset_ids · 16

結構化請求範例

text

意圖

{
  "background": "auto",
  "moderation": "auto",
  "n": 1,
  "output_compression": 1,
  "output_format": "png",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "quality": "medium",
  "size": "auto"
}

提供者請求

{
  "background": "auto",
  "model": "gpt-image-2.5-flare",
  "moderation": "auto",
  "n": 1,
  "output_compression": 1,
  "output_format": "png",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "quality": "medium",
  "size": "auto"
}

reference

意圖

{
  "background": "auto",
  "moderation": "auto",
  "n": 1,
  "output_compression": 1,
  "output_format": "png",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "quality": "medium",
  "size": "auto"
}

提供者請求

{
  "background": "auto",
  "images": [
    {
      "image_url": "https://example.com/reference.png"
    }
  ],
  "model": "gpt-image-2.5-flare",
  "moderation": "auto",
  "n": 1,
  "output_compression": 1,
  "output_format": "png",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "quality": "medium",
  "size": "auto"
}