POST
/
v1
/
aigc-images
/
generations
GPT-Image 异步生图任务创建
curl --request POST \
  --url https://vip.xmsmartlink.com/v1/aigc-images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "gpt-image-2-async",
  "prompt": "只编辑遮罩区域,并参考多张输入图生成一张统一风格的产品海报。",
  "size": "1024x1024",
  "quality": "medium",
  "n": 1,
  "background": "transparent",
  "output_format": "png",
  "mask": "https://example.com/mask.png",
  "image": [
    "https://example.com/input-1.png",
    "https://example.com/input-2.png"
  ]
}
'
{
  "task_id": "imgtask_xxx"
}

Authorizations

Authorization
string
header
required

使用 Authorization: Bearer <YOUR_API_KEY> 进行认证。

Body

application/json
model
string
required

异步图片模型名称,通常为 gpt-image-2-async。

Example:

"gpt-image-2-async"

prompt
string
required

图片生成或编辑指令。

n
integer

请求生成图片数量。默认 1,最大 8。

Required range: 1 <= x <= 8
size
string

输出尺寸。为空或无法识别时按 1K。

quality
enum<string>

图片质量设置。

Available options:
low,
medium,
high,
auto
background
enum<string>

背景设置。

Available options:
transparent,
opaque,
auto
output_format
enum<string>

输出图片编码格式。

Available options:
png,
jpeg
mask
string

遮罩图 URL 或 Base64 字符串。计费时算 1 张输入图。

image

一个或多个输入图 URL、Base64 值。

Response

异步图片任务创建响应。

task_id
string
Example:

"imgtask_xxx"