图片编辑
Header Parameters
格式: Authorization: Bearer sk-xxxxxx
Request Body
application/json
Input image references to edit. For GPT image models, you can provide up to 16 images.
A text description of the desired image edit.
minLength1 maxLength32000
optional "transparent" or "opaque" or "auto" Background behavior for generated image output.
optional "high" or "low" Controls fidelity to the original input image(s).
Reference an input image by either URL or uploaded file ID. Provide exactly one of image_url or file_id.
模型名称,固定值: gpt-image-1.5
optional "low" or "auto" Moderation level for GPT image models.
The number of edited images to generate.
minimum1 maximum10
Compression level for jpeg or webp output.
minimum0 maximum100
optional "png" or "jpeg" or "webp" Output image format. Supported for GPT image models.
The number of partial images to generate. This parameter is used for streaming responses that return partial images. Value must be between 0 and 3. When set to 0, the response will be a single image sent in one streaming event.
Note that the final image may be sent before the full number of partial images are generated if the full image is generated more quickly.
maximum3 minimum0
optional "low" or "medium" or "high" or "auto" Output quality for GPT image models.
optional "auto" or "1024x1024" or "1536x1024" or "1024x1536" Requested output image size.
Stream partial image results as events.
A unique identifier representing your end-user, which can help OpenAI monitor and detect abuse.
Response Body
application/json
curl -X POST "https://api.aa.com.cn/api/v1/image/generation" \ -H "Authorization: string" \ -H "Content-Type: application/json" \ -d '{ "images": [ { "file_id": "string", "image_url": "string" } ], "prompt": "string", "model": "string" }'{
"code": 0,
"data": {
"urls": [
"string"
],
"usage": {
"images": 0,
"seconds": 0,
"input_tokens": 0,
"total_tokens": 0,
"output_tokens": 0
},
"expired": "string",
"task_id": "string",
"task_status": "string"
},
"message": "string",
"request_id": "string"
}