Skip to main content
POST
/
v1
/
tasks
GPT-Image Series
curl --request POST \
  --url https://www.qingbo.dev/v1/tasks \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "action": "<string>",
  "prompt": "<string>",
  "n": 123,
  "seed": 123,
  "aspect_ratio": "<string>",
  "resolution": "<string>",
  "image_urls": [
    "<string>"
  ],
  "callback_url": "<string>",
  "callback_events": [
    "<string>"
  ]
}
'
import requests

url = "https://www.qingbo.dev/v1/tasks"

payload = {
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"n": 123,
"seed": 123,
"aspect_ratio": "<string>",
"resolution": "<string>",
"image_urls": ["<string>"],
"callback_url": "<string>",
"callback_events": ["<string>"]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
action: '<string>',
prompt: '<string>',
n: 123,
seed: 123,
aspect_ratio: '<string>',
resolution: '<string>',
image_urls: ['<string>'],
callback_url: '<string>',
callback_events: ['<string>']
})
};

fetch('https://www.qingbo.dev/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://www.qingbo.dev/v1/tasks"

payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"seed\": 123,\n \"aspect_ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://www.qingbo.dev/v1/tasks")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"seed\": 123,\n \"aspect_ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ]\n}")
.asString();
{
  "task_id": "task-wave1775285160b950328499",
  "model": "gpt-image-2",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
OpenAI’s GPT-Image generation models, across three generations:
  • GPT-Image-2 — flagship new release, expanded to 13 ratios × 1K/2K/4K resolution tiers with independent billing, up to 16 reference images, with transparent background and mask inpainting support
  • GPT-Image-1.5 Official — upgraded GPT-Image-1 with significantly improved visual quality and instruction following
  • GPT-Image-1 Official — multimodal generation model integrating text and image understanding, suited for high-quality generation and editing
Per-image billing. Supports text-to-image / image-to-image / editing / mask inpainting / multi-image reference.

Pricing

ModelPrice (per image)
gpt-image-2$0.006375
gpt-image-1.5-official$0.09044
gpt-image-1-official$0.11356

Mode Quick Reference

ModeTrigger FieldsSupported Versions
Text-to-imageprompt only, action: "generate" (default)All
Image-to-image+ image_urls + action: "image2image"All
Image editing+ image_urls + action: "edit"All
Multi-image reference+ image_urls (multiple) + action: "reference"All (up to 16)
Inpainting (mask)+ image_urls + mask_url + action: "inpaint"All

Examples

curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "未来主义城市夜景,霓虹灯映在湿润街面,电影感构图",
    "aspect_ratio": "16:9",
    "resolution": "2k"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "action": "edit",
    "prompt": "把背景换成黄昏天空,人物保持不变",
    "image_urls": ["https://cdn.example.com/portrait.jpg"],
    "aspect_ratio": "1:1",
    "resolution": "2k"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "action": "inpaint",
    "prompt": "把遮罩区域替换为蓝色花朵",
    "image_urls": ["https://cdn.example.com/scene.jpg"],
    "mask_url": "https://cdn.example.com/mask.png",
    "aspect_ratio": "1:1",
    "resolution": "2k"
  }'
curl -X POST https://www.qingbo.dev/v1/tasks \
  -H "Authorization: Bearer $WAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "悬浮的水晶球,产品级摄影,无背景",
    "background": "transparent",
    "output_format": "png",
    "aspect_ratio": "1:1",
    "resolution": "2k"
  }'
{
  "task_id": "task-wave1775285160b950328499",
  "model": "gpt-image-2",
  "action": "generate",
  "status": "queued",
  "created_at": 1775285160040,
  "progress": 0
}
After submitting, poll task status with GET /v1/tasks/{task_id}. See Task System for details.

Available Models

Model IDDescription
gpt-image-2Flagship new release, 13 ratios × 1K/2K/4K, up to 16 reference images
gpt-image-1.5-officialUpgraded GPT-Image-1 with significantly improved visual quality and instruction following
gpt-image-1-officialMultimodal text + image understanding, suited for high-quality generation and editing

Common Parameters

model
string
required
Pick one from the Available Models list
action
string
default:"generate"
Operation type, allowed values:
  • generate — text-to-image (default)
  • image2image — image-to-image (requires image_urls)
  • edit — image editing
  • reference — multi-image reference fusion
  • inpaint — inpainting (requires mask_url)
prompt
string
required
Image description text; supports both Chinese and English
n
integer
default:"1"
Number of images to generate (multiple per call)
seed
integer
default:"-1"
Random seed; -1 means random. A fixed value reproduces similar results.
aspect_ratio
string
default:"1:1"
Aspect ratio. Values depend on the model:
  • GPT-Image-2: auto / 1:1 / 3:2 / 2:3 / 4:3 / 3:4 / 5:4 / 4:5 / 16:9 / 9:16 / 2:1 / 1:2 / 21:9 / 9:21 (14 total)
  • GPT-Image-1.5 / 1 official: 1:1 / 3:2 / 2:3 (3 only)
resolution
string
Output resolution. GPT-Image-2 only accepts an explicit value:
  • 1k — 1K tier
  • 2k — 2K tier
  • 4k — 4K tier (only 6 ratios available: 16:9 / 9:16 / 2:1 / 1:2 / 21:9 / 9:21)
GPT-Image-1.5 / 1 official does not accept this field and uses the model default.
image_urls
string[]
Reference image URL array, up to 16; base64 inline upload also supported
callback_url
string
Webhook callback URL, invoked when the task reaches a terminal state. See Callback Mechanism.
callback_events
string[]
Callback event filter, e.g. ["completed", "failed"]

Model-Specific Parameters

Supported actions: generate / image2image / edit / reference / inpaintaspect_ratio (14): auto / 1:1 / 3:2 / 2:3 / 4:3 / 3:4 / 5:4 / 4:5 / 16:9 / 9:16 / 2:1 / 1:2 / 21:9 / 9:21resolution: 1k / 2k / 4k (4K limited to 16:9 / 9:16 / 2:1 / 1:2 / 21:9 / 9:21)Highlights: 13 ratios × three resolution tiers with independent billing, up to 16 reference images (URL / base64), OpenAI per-image pixel ceiling of 8.29M.
quality
string
default:"auto"
Generation quality, allowed values:
  • auto — automatic (default)
  • low — low quality
  • medium — medium quality
  • high — high quality
background
string
default:"auto"
Background handling, allowed values:
  • auto — automatic (default)
  • opaque — opaque
  • transparent — transparent background (not supported on the official channel)
mask_url
string
Mask image URL for inpainting (used with action: "inpaint")
moderation
string
default:"auto"
Content moderation level, allowed values:
  • auto — automatic (default)
  • low — low restriction
output_format
string
default:"png"
Output format, allowed values:
  • png — default
  • jpeg
  • webp
output_compression
integer
Output compression rate, range 0-100. Effective only for jpeg / webp.
style
string
Style preset
official_fallback
boolean
default:"false"
Switch to the gpt-image-2-official channel

Resource Limits

ItemLimit
Reference image countUp to 16 (URL or base64)
Per-image pixel ceiling8.29M pixels (OpenAI’s official limit)
Per-image size≤ 30MB; supports JPG/PNG/WEBP
Output resolutionGPT-Image-2 up to 4K (select ratios); others use default
Output filePNG (default) / JPEG / WEBP (GPT-Image-2 only); URLs valid for 24 hours
Transparent backgroundbackground: transparent only supported on non-official channels