PopNowAPI 文件
主要內容

GPT Image 2.6 Sunburst API 呼叫參考

OpenAI 精準檔,多次編輯細節穩定,最高 4K

只要一把 PopNow API 金鑰,就能在自己的程式裡呼叫 GPT Image 2.6 Sunburst。以下列出要填的呼叫名稱、這個型號接受的每個輸入欄位、每次請求花多少美元(USD),以及一段可以直接貼進終端機執行的請求。

參數說明直接取自型號的輸入 schema,目前只有英文。

總覽

開發商
OpenAI
產出
圖片
起價
$0.02232 USD 每張圖
一般耗時
約 50 秒

價格以 USD 顯示,從你的 PopNow 餘額扣款。任務受理時預留可能的最高費用,完成後依實際用量結算並釋放餘款;失敗任務不收費。執行前可呼叫 POST /api/v1/jobs/quote 取得準確報價。

生成圖片

openai/gpt-image-2.6-sunburst/text-to-image

價格

選項USD
quality = low, resolution = 1k$0.02232 每張圖
quality = low, resolution = 512$0.027 每張圖
quality = medium, resolution = 1k$0.03915 每張圖
quality = low, resolution = 2k$0.04131 每張圖
quality = low, resolution = 768$0.04392 每張圖
quality = high, resolution = 1k$0.04743 每張圖
quality = medium, resolution = 512$0.04752 每張圖
quality = high, resolution = 512$0.05742 每張圖
quality = medium, resolution = 2k$0.07299 每張圖
quality = low, resolution = 4k$0.07479 每張圖
quality = medium, resolution = 768$0.07776 每張圖
quality = xhigh, resolution = 1k$0.08433 每張圖
quality = high, resolution = 2k$0.08847 每張圖
quality = high, resolution = 768$0.09432 每張圖
quality = xhigh, resolution = 512$0.10206 每張圖
quality = medium, resolution = 4k$0.13221 每張圖
quality = xhigh, resolution = 2k$0.15723 每張圖
quality = high, resolution = 4k$0.16011 每張圖
quality = xhigh, resolution = 768$0.1674 每張圖
quality = max, resolution = 1k$0.18972 每張圖
quality = max, resolution = 512$0.22941 每張圖
quality = xhigh, resolution = 4k$0.28512 每張圖
quality = max, resolution = 2k$0.35379 每張圖
quality = max, resolution = 768$0.37638 每張圖
quality = max, resolution = 4k$0.64044 每張圖

依每次請求實際用掉的 token 計費:文字輸入每百萬 $4.5,圖片輸入每百萬 $7.2,圖片輸出每百萬 $27。表中是各檔方圖的價格,其他比例通常更便宜。一次出多張時,輸入 token 按張數計算。

參數

欄位型別預設值可用值用途
prompt必填string—最多 5000 個字元Describe the picture: subject, setting, light and any short text to render in quotes.
aspect_ratio選填string1:11:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21, 2:1, 1:2, 3:1, 1:3, 5:4, … (+1)Output aspect ratio.
resolution選填string1k1k, 2k, 4k, 512, 768Output size tier: 1k is about 1 megapixel, 2k about 3.7, 4k about 8.3. For GIF output use 512 or 768, the size of one frame.
quality選填stringmediumlow, medium, high, xhigh, maxRendering quality. Higher tiers add detail, time and cost.
reasoning_effort選填string—low, medium, highHow much the model plans the picture before drawing. Higher helps dense text and complex layouts and takes longer; the price does not change. Leave it unset for the model default (high).
num_outputs選填integer11 到 10How many images to return, each billed separately.
background選填stringautoauto, transparent, opaqueBackground treatment. Transparent needs PNG or WebP output.
output_format選填stringpngpng, jpeg, webp, gifFile format of the returned images. gif returns an animated loop; describe the motion in the prompt.
frame_count選填integer—2 到 16Number of frames in a GIF, 2 to 16 (default 9). Every 8 frames are billed as one more frame sheet. Only with gif output.
frame_duration_ms選填integer—20 到 2000How long each GIF frame stays on screen, 20 to 2000 milliseconds (default 200). Only with gif output.
output_quality選填integer—0 到 100Compression quality for JPEG and WebP output, from 0 to 100.

請求範例

這段請求原樣就能執行,沒寫的欄位都用預設值。執行前請先把金鑰放進環境變數 POPNOW_API_KEY。

POST /api/v1/jobs/createTask
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "model": "openai/gpt-image-2.6-sunburst/text-to-image",
  "input": {
    "prompt": "A cozy reading nook beside a rain-streaked window, warm lamp light, a sleeping orange cat on a knitted blanket, soft film grain",
    "num_outputs": 1,
    "quality": "medium",
    "resolution": "1k"
  }
}'

回應會立刻帶回 taskId。之後用 GET /api/v1/jobs/recordInfo 取得結果,或在請求裡加上 callBackUrl 等候通知。

GET /api/v1/jobs/recordInfo
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

編輯圖片

openai/gpt-image-2.6-sunburst/edit

價格

選項USD
quality = low, resolution = 1k$0.02232 每張圖
quality = medium, resolution = 1k$0.03915 每張圖
quality = low, resolution = 2k$0.04131 每張圖
quality = high, resolution = 1k$0.04743 每張圖
quality = medium, resolution = 2k$0.07299 每張圖
quality = low, resolution = 4k$0.07479 每張圖
quality = xhigh, resolution = 1k$0.08433 每張圖
quality = high, resolution = 2k$0.08847 每張圖
quality = medium, resolution = 4k$0.13221 每張圖
quality = xhigh, resolution = 2k$0.15723 每張圖
quality = high, resolution = 4k$0.16011 每張圖
quality = max, resolution = 1k$0.18972 每張圖
quality = xhigh, resolution = 4k$0.28512 每張圖
quality = max, resolution = 2k$0.35379 每張圖
quality = max, resolution = 4k$0.64044 每張圖

依每次請求實際用掉的 token 計費:文字輸入每百萬 $4.5,圖片輸入每百萬 $7.2,圖片輸出每百萬 $27。表中是各檔方圖的價格,其他比例通常更便宜。一次出多張時,輸入 token 按張數計算。

參數

欄位型別預設值可用值用途
prompt必填string—最多 5000 個字元Say what to change and what must stay the same. Refer to the images as Image 1, Image 2 and so on.
image_urls必填array<string (uri)>—最多 16 項One to 16 source images, in the order your prompt refers to them. Each one adds a small charge.
mask_url選填string (uri)——Optional PNG mask: transparent pixels mark the area to repaint in the first image, same size as that image. Cannot be combined with markup_url.
markup_url選填string (uri)——Optional transparent PNG with circles, sketches or notes drawn over the first image to show what to change, same size as that image. Cannot be combined with mask_url.
aspect_ratio選填string—1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21, 2:1, 1:2, 3:1, 1:3, 5:4, … (+1)Output aspect ratio. Leave it unset to keep the first image's shape (1k only); pick a ratio for 2k or 4k.
resolution選填string1k1k, 2k, 4kOutput size tier: 1k is about 1 megapixel, 2k about 3.7, 4k about 8.3.
quality選填stringmediumlow, medium, high, xhigh, maxRendering quality. Higher tiers add detail, time and cost.
reasoning_effort選填string—low, medium, highHow much the model plans the picture before drawing. Higher helps dense text and complex layouts and takes longer; the price does not change. Leave it unset for the model default (high).
num_outputs選填integer11 到 10How many images to return, each billed separately.
background選填stringautoauto, transparent, opaqueBackground treatment. Transparent needs PNG or WebP output.
output_format選填stringpngpng, jpeg, webpFile format of the returned images.
output_quality選填integer—0 到 100Compression quality for JPEG and WebP output, from 0 to 100.

請求範例

這段請求原樣就能執行,沒寫的欄位都用預設值。執行前請先把金鑰放進環境變數 POPNOW_API_KEY。

範例中的 image_urls 使用 PopNow 的範例素材,請換成你自己的公開 HTTPS 連結、上傳檔案或已儲存的素材。

POST /api/v1/jobs/createTask
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask" \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "model": "openai/gpt-image-2.6-sunburst/edit",
  "input": {
    "prompt": "Change the orange jacket to deep forest green and add soft golden-hour light; keep the face, pose and background unchanged",
    "image_urls": [
      "https://media.popnow.ai/influencer/examples/marco.webp"
    ],
    "num_outputs": 1,
    "quality": "medium",
    "resolution": "1k"
  }
}'

回應會立刻帶回 taskId。之後用 GET /api/v1/jobs/recordInfo 取得結果,或在請求裡加上 callBackUrl 等候通知。

GET /api/v1/jobs/recordInfo
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

接下來

本頁內容