curl --request POST \
--url https://openapi.imini.ai/imini/router/v1/images/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-image-2",
"prompt": "A cute shiba inu in a spacesuit standing on the moon, 3D cartoon style",
"aspect_ratio": "1:1",
"resolution": "1K",
"quality": "medium"
}
'{
"task_id": "task_2041350318103396352",
"model": "openai/gpt-image-2",
"created_at": "2026-04-23T03:00:17.062Z",
"request_id": "285f20ce-8158-401b-945c-7bc6a7ef6ead"
}{
"error": {
"code": "INVALID_PROMPT",
"message": "Prompt contains disallowed content",
"status": 400,
"request_id": "req_abc123"
}
}图像模型 API
GPT Image 2
OpenAI gpt-image-2 图像生成模型,1K / 2K / 4K 分辨率 × 3 档画质,最多 6 张参考图
POST
/
v1
/
images
/
generate
curl --request POST \
--url https://openapi.imini.ai/imini/router/v1/images/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai/gpt-image-2",
"prompt": "A cute shiba inu in a spacesuit standing on the moon, 3D cartoon style",
"aspect_ratio": "1:1",
"resolution": "1K",
"quality": "medium"
}
'{
"task_id": "task_2041350318103396352",
"model": "openai/gpt-image-2",
"created_at": "2026-04-23T03:00:17.062Z",
"request_id": "285f20ce-8158-401b-945c-7bc6a7ef6ead"
}{
"error": {
"code": "INVALID_PROMPT",
"message": "Prompt contains disallowed content",
"status": 400,
"request_id": "req_abc123"
}
}授权
在请求 Header 中传入 Authorization: Bearer <YOUR_API_KEY>。前往 API Keys 管理页 创建和管理 API Key。
请求体
application/json
固定值 openai/gpt-image-2
提示词,不超过 32000 字符。支持中英文,推荐使用细节丰富的描述以获得更好的生成效果。
示例:
"A majestic snow-capped mountain at golden hour, ultra-realistic photography"
输出清晰度档位(必填):1K / 2K / 4K
可用选项:
1K, 2K, 4K 输出宽高比(必填),可选值:
1:1 2:3 3:2 3:4 4:3 4:5 5:4 9:16 16:9 21:9 9:21
可用选项:
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 9:21 生成画质(必填):
-
low— 最快、最便宜,适合草稿 / 批量生成 -
medium— 均衡 -
high— 最细致,适合终稿 / 封面图
画质与清晰度正交:同一 resolution 下 quality 仅影响细节表现与成本,不影响输出尺寸。
可用选项:
low, medium, high 参考图列表。不传或传空数组则为文生图模式;传入图像则进入图生图 / 风格参考模式。最多 3 张。
Maximum array length:
3Show child attributes
Show child attributes
一次生成的图片数量,1-10。
必填范围:
1 <= x <= 10
