curl --request POST \
--url https://api.omniall.ai/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-1",
"prompt": "把背景替换成干净的白色影棚背景",
"image": "https://example.com/product.png",
"n": 1
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}通用生图(推荐)
编辑图像
OpenAI 兼容图像编辑 / 局部重绘。
路径: POST https://api.omniall.ai/v1/images/edits
支持 application/json(image/mask 为 URL 或 Base64)与 multipart/form-data(上传文件)。多图时 JSON 用 image 字符串数组;表单用多个 image[] 文件字段。
提供 prompt 描述修改方式;可选 mask 指定可编辑区域。
POST
/
v1
/
images
/
edits
curl --request POST \
--url https://api.omniall.ai/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-1",
"prompt": "把背景替换成干净的白色影棚背景",
"image": "https://example.com/product.png",
"n": 1
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
]
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "new_api_error",
"code": "<string>"
}
}Authorizations
使用来自 https://omniall.ai/dashboard 的 Authorization: Bearer sk-...
Body
application/jsonmultipart/form-data
OpenAI 兼容图像编辑(POST /v1/images/edits)。支持 JSON 与 multipart/form-data。
支持编辑的模型 ID(如 gpt-image-1、dall-e-2、部分 Gemini/Qwen 编辑模型)。
Example:
"gpt-image-1"
描述如何编辑图像的指令。
Example:
"把天空替换成晚霞"
源图。JSON:URL / Base64 / 字符串数组(多图)。multipart:文件字段 image(单张)或重复 image[] / image[n](多张)。
可选蒙版。JSON 为 URL/Base64;multipart 为 mask 文件字段(PNG,透明区域可编辑)。
返回的编辑结果张数。
输出尺寸(若支持)。
质量档位(若支持)。
Available options:
url, b64_json 终端用户标识。