curl --request POST \
--url https://api.maxapi.io/api/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2/image-to-image",
"callBackUrl": "https://example.com/webhook",
"input": {
"prompt": "把人物风格改成赛博朋克",
"imageUrls": ["https://example.com/source.jpg"],
"ratio": "3:4",
"n": 1
}
}'
curl --request POST \
--url https://api.maxapi.io/api/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2/image-to-image",
"callBackUrl": "https://example.com/webhook",
"input": {
"prompt": "提升细节并放大到 4K",
"imageUrls": ["https://example.com/source.jpg"],
"ratio": "16:9",
"resolution": "4k"
}
}'
{
"code": 0,
"msg": "ok",
"data": {
"taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}
GPT Image 2 (OpenAI)
图生图
GPT Image 2 图生图 —— 基于参考图与提示词编辑图像
POST
/
api
/
v1
/
task
/
submit
curl --request POST \
--url https://api.maxapi.io/api/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2/image-to-image",
"callBackUrl": "https://example.com/webhook",
"input": {
"prompt": "把人物风格改成赛博朋克",
"imageUrls": ["https://example.com/source.jpg"],
"ratio": "3:4",
"n": 1
}
}'
curl --request POST \
--url https://api.maxapi.io/api/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2/image-to-image",
"callBackUrl": "https://example.com/webhook",
"input": {
"prompt": "提升细节并放大到 4K",
"imageUrls": ["https://example.com/source.jpg"],
"ratio": "16:9",
"resolution": "4k"
}
}'
{
"code": 0,
"msg": "ok",
"data": {
"taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}
使用 GPT Image 2 编辑现有图像。
总费用 =
可用模型
gpt-image-2/image-to-image
价格
按 分辨率档位 × 张数 计费,失败不扣费:resolution | 单价 / 张 |
|---|---|
1k(默认) | $0.02 |
2k | $0.04 |
4k | $0.06 |
n × 单价(resolution)。
gpt-image-2/image-to-imageWebhook 回调地址。
隐藏 properties
隐藏 properties
描述要应用的编辑效果。
可公网访问的参考图 HTTPS URL。仅接受 1 张。WebP 会自动转码为 JPEG。
图像宽高比。13 个可选值:
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不传时由上游决定(通常贴近输入图比例)。当
resolution = 4k 时,ratio 仅支持 16:9 / 9:16 / 2:1 / 1:2 / 21:9 / 9:21。输出变体数量。范围
1-10,默认 1。账单按 n × 单价(resolution) 线性扣费。curl --request POST \
--url https://api.maxapi.io/api/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2/image-to-image",
"callBackUrl": "https://example.com/webhook",
"input": {
"prompt": "把人物风格改成赛博朋克",
"imageUrls": ["https://example.com/source.jpg"],
"ratio": "3:4",
"n": 1
}
}'
curl --request POST \
--url https://api.maxapi.io/api/v1/task/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2/image-to-image",
"callBackUrl": "https://example.com/webhook",
"input": {
"prompt": "提升细节并放大到 4K",
"imageUrls": ["https://example.com/source.jpg"],
"ratio": "16:9",
"resolution": "4k"
}
}'
{
"code": 0,
"msg": "ok",
"data": {
"taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}
获取结果
通过 Query Task 或 Webhook 获取结果。{
"code": 0,
"msg": "ok",
"data": {
"taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "SUCCESS",
"input": {
"model": "gpt-image-2/image-to-image",
"prompt": "把人物风格改成赛博朋克"
},
"result": {
"type": "image",
"urls": ["https://cdn.maxapi.io/images/.../image-0.png"]
}
}
}
⌘I