图像编辑(gpt-image-1)
开发中
POST
https://api.deerapi.com/v1/images/edits
official docs:
https://platform.openai.com/docs/api-reference/images/createEdit
Image Editing Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
image | file or file array | ✅ | The image(s) to edit. Must be a supported image file or array. - gpt-image-1: PNG, WEBP, or JPG, each <25MB. - dall-e-2: 1 square PNG <4MB. |
prompt | string | ✅ | A text description of the desired image(s). - Max length: 1000 chars for dall-e-2, 32000 chars for gpt-image-1. |
mask | file | Optional PNG mask image. Transparent areas (alpha = 0) indicate regions to edit. Must match size of image and be <4MB. Applies to first image. | |
model | string | Model to use: "dall-e-2" or "gpt-image-1". Defaults to "dall-e-2", unless gpt-image-1-specific parameters are used. | |
n | integer or null | Number of images to generate. Must be between 1 and 10. Default: 1. | |
quality | string or null | For gpt-image-1 only. Options: "high", "medium", "low". Default: "auto". | |
response_format | string or null | Response format. Options: "url" or "b64_json". Only "dall-e-2" supports "url" (valid for 60 minutes). | |
size | string or null | Image size: - gpt-image-1: "1024x1024", "1536x1024", "1024x1536", "auto" (default) - dall-e-2: "256x256", "512x512", "1024x1024" |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.deerapi.com/v1/images/edits' \
--header 'Authorization: Bearer {{api-key}}' \
--form 'image=@"cmMtdXBsb2FkLTE3NDU4MTIyNDQ0NzEtMg==/image.png"' \
--form 'prompt="Put on glasses"' \
--form 'model="gpt-image-1"'
响应示例响应示例
{}
请求参数
Header 参数
Authorization
string
可选
示例值:
Bearer {{api-key}}
Body 参数multipart/form-data
image
file
可选
示例值:
cmMtdXBsb2FkLTE3NDU4MTIyNDQ0NzEtMg==/image.png
prompt
string
可选
示例值:
Put on glasses
model
string
可选
示例值:
gpt-image-1
返回响应
修改于 2025-04-28 06:31:48