MAPI
图像(Images)Async Image Tasks

Submit Async Image Generation Task

Submit an image generation task and receive a task ID. Poll the GET endpoint to check status and retrieve results.

Recommended for models with long generation times (typically 30+ seconds).

Supported models: gpt-image-2

Reference images (image-to-image): Pass a reference image via image (single URL/Base64) or images (array of URLs/Base64 strings) to enable image-to-image mode. input_reference is an alias for image — use either one.

POST
/v1/image-tasks/submit

Authorization

BearerAuth

AuthorizationBearer <token>

使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

In: header

Request Body

application/json

model*string

模型名称。

gpt-image-2

模型 ID说明
gpt-image-2OpenAI GPT Image 2

豆包 Seedream 系列

模型 ID说明
doubao-seedream-3-0-t2i-250415Seedream 3.0
doubao-seedream-4-5-t2i-250505Seedream 4.5
doubao-seedream-4-5-251128Seedream 4.5(增强版)
doubao-seedream-5-0-t2i-250804Seedream 5.0

Gemini 系列

模型 ID系列名说明
gemini-2.5-flash-imageNano BananaGemini 2.5 Flash Image
gemini-3-pro-imageNano Banana ProGemini 3 Pro Image
gemini-3.1-flash-imageNano Banana 2Gemini 3.1 Flash Image

Kling 系列

模型 ID说明
kling-image-2.1Kling Image 2.1
kling-image-3.0Kling Image 3.0
kling-image-3.0-omniKling Image 3.0 Omni,支持 auto 宽高比
kling-image-o1Kling Image O1,支持 auto 宽高比
kling-image-sceneKling Image Scene,扩图模式,需配合 extra_fields.scene_type="image_expand"

Vidu 系列

模型 ID说明
vidu-image-q2Vidu Q2

Qwen 系列

模型 ID说明
qwen-image-0925Qwen-Image-0925,通过 size 传自定义像素尺寸

Hunyuan 系列

模型 ID说明
hunyuan-image-3.0Hunyuan 3.0,通过 size 传自定义像素尺寸;支持全景图模式
prompt*string

图像描述提示词

image?string

参考图(单张)的 URL 或 Base64 字符串。与 images 等价,二者同时传时以 images 为准。传入后默认触发图生图(image-to-image)模式。

images?array<string>

参考图列表(支持多张)。每项为图片 URL 或 Base64 字符串。传入后默认触发图生图(image-to-image)模式。

各模型参考图数量上限(超出将被自动截断):

模型最多参考图数
gemini-2.5-flash-image3 张
gemini-3-pro-image14 张
gemini-3.1-flash-image14 张
kling-image-2.14 张
kling-image-3.01 张
kling-image-3.0-omni10 张
kling-image-o110 张
kling-image-scene1 张(扩图原图)
vidu-image-q27 张
qwen-image-09251 张
hunyuan-image-3.03 张

超出上限的图片将被自动截断。

size?string

图像尺寸。

Gemini(GG)系列:映射到宽高比(AspectRatio),不支持自定义像素尺寸。

  • 直接传宽高比(推荐):"1:1""16:9""9:16"
  • 传像素尺寸:系统自动转换为最近邻宽高比,如 "1024x1024""1:1"

各版本支持的宽高比:GG 2.5/3.0 支持 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9;GG 3.1 额外支持 1:4, 1:8, 4:1, 8:1

gpt-image-2:指定 宽x高,总像素数范围 655,360 – 8,294,400。

Kling 系列(除 scene):映射到宽高比(AspectRatio)。 支持:1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:93.0-omni / o1 额外支持 autokling-image-scene 扩图模式 size 参数无效,输出尺寸由扩图参数决定。

Vidu(vidu-image-q2:映射到宽高比。支持:1:1, 2:3, 3:2, 3:4, 4:3, 9:16, 16:9, 21:9

Qwen(qwen-image-0925:指定 宽x高,总像素范围 261,632 – 4,194,304(512×512 至 2048×2048)。

Hunyuan(hunyuan-image-3.0:指定 宽x高,宽高均在 [512, 2048] 内,且宽×高 ≤ 1,048,576。

quality?string

图像质量 / 分辨率档位。各模型语义不同:

Gemini(GG)系列:映射到分辨率档位(Resolution)。

  • 直接传档位(推荐):1K2K4Kgemini-3.1-flash-image 额外支持 720P
  • 兼容标准值:low / standard1Kmedium / hd / high2K
  • 默认:1K

gpt-image-2low / standard → image2_low,medium → image2_medium,hd / high → image2_high。默认 standard(image2_low)。

Kling 系列(除 scene):映射到分辨率档位(小写)。

  • 直接传档位(推荐):1k2k3.0-omni / o1 额外支持 4k
  • 兼容标准值:low / standard / medium1khd / high2k
  • 默认:1kkling-image-scene 忽略此参数

Vidu(vidu-image-q2:映射到分辨率档位。

  • 直接传档位(推荐):1080p2K4K
  • 兼容标准值:low / standard1080pmedium / hd / high2K
  • 默认:1080p

Qwen / Hunyuan:不使用此参数(通过 size 传像素尺寸)。

其他模型lowmediumstandardhd / high,默认 standard

n?integer

生成图像数量。默认 1。

豆包 Seedream 系列n 映射为组图生成的 max_images(最多允许生成的张数上限),模型以 auto 模式根据 prompt 自主推理实际生成张数,最终张数 ≤ n。如需精确控制张数,建议在 prompt 中明确描述(如「生成 4 张不同风格的图片」)。支持范围 1-15。

Kling 系列:支持 1-9 张,超出自动截断。

OG(gpt-image-2):支持 1-8 张,超出自动截断。

其他模型(Gemini / Vidu / Qwen / Hunyuan 等):底层 API 不支持数量参数,n 字段传入后会被忽略,固定返回 1 张。

style?string

图像风格,如 vividnatural。部分模型支持。

output_format?string

输出图像文件格式。不传时跟随模型默认值。

gpt-image-2 / Kling 系列:支持 jpeg / png

豆包 Seedream 系列:支持 jpeg / png / webp;仅 doubao-seedream-5-0 系列支持。

其他模型:不支持,传入后忽略。

output_compression?integer

输出图像压缩质量(0-100),仅在 output_formatjpegwebp 时有效。部分模型支持。

metadata?

模型扩展参数,不支持的字段将被忽略。

参数类型支持模型说明
negative_promptstringgpt-image-2、Gemini 系列、Kling 系列反向提示词
seedintegergpt-image-2、Gemini 系列、Kling 系列随机种子,控制生成结果可复现性
enhance_promptstringGemini 系列自动优化 prompt,取值 Enabled / Disabled
scene_typestringKling scene、Hunyuan 3.0场景类型:image_expand(Kling 扩图)/ 3d_panorama(Hunyuan 全景图)
expansionobjectkling-image-scene扩图比例,配合 scene_type="image_expand" 使用,含 up / down / left / right,取值范围 [0, 2]

Response Body

application/json

curl -X POST "https://loading/v1/image-tasks/submit" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-image-2",    "prompt": "一只橙色的猫坐在窗台上,背景是城市夜景"  }'
{
  "id": "string",
  "task_id": "string",
  "status": "string",
  "model": "string",
  "created_at": 0
}

Last updated on