الانتقال إلى المحتوى الرئيسي
POST
/
openai
/
images
/
edits
Openai Images Edits
curl --request POST \
  --url https://api.acedata.cloud/openai/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'image=<string>' \
  --form 'prompt=<string>' \
  --form background=auto \
  --form input_fidelity=high \
  --form mask='@example-file' \
  --form model=dall-e-3 \
  --form n=1 \
  --form output_compression=100 \
  --form output_format=png \
  --form partial_images=0 \
  --form quality=auto \
  --form response_format=url \
  --form size=1024x1024 \
  --form 'callback_url=<string>' \
  --form image.items='@example-file'
{
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ],
  "created": 123
}

التفويضات

Authorization
string
header
مطلوب

الترويسات

accept
enum<string>

Specifies the response format. Only application/json is supported.

الخيارات المتاحة:
application/json
Content-Type
enum<string>
مطلوب

Upload uses multipart form data.

الخيارات المتاحة:
multipart/form-data

الجسم

multipart/form-data
image
file[]
مطلوب

Image(s) to edit. GPT image models: up to 16 images (png/webp/jpg) <50MB each. dall-e-2: single square PNG <4MB.

Maximum array length: 16
prompt
string
مطلوب

Text description of the desired edit. Max 1000 characters for dall-e-2, 32000 for GPT image models.

background
enum<string>
افتراضي:auto

GPT image models only. Transparency handling: transparent, opaque, or auto (default). Use png/webp output when requesting transparency.

الخيارات المتاحة:
transparent,
opaque,
auto
input_fidelity
enum<string>

How strongly to match input style/features. Supported for gpt-image-1; not supported for gpt-image-1-mini.

الخيارات المتاحة:
high,
low
mask
file

Optional mask (PNG <4MB, same dimensions as first image). Transparent areas indicate editable regions.

model
enum<string>
افتراضي:dall-e-3

Model for image editing. Only dall-e-3 and GPT image models are supported.

الخيارات المتاحة:
dall-e-3,
gpt-image-1,
gpt-image-1.5
n
integer
افتراضي:1

Number of images to generate (1-10).

النطاق المطلوب: 1 <= x <= 10
output_compression
integer
افتراضي:100

Compression level (0-100%) for GPT image models when using webp or jpeg output.

النطاق المطلوب: 0 <= x <= 100
output_format
enum<string>
افتراضي:png

Return format for GPT image models: png, jpeg, or webp.

الخيارات المتاحة:
png,
jpeg,
webp
partial_images
integer
افتراضي:0

Number of partial images in streaming responses (0-3). 0 returns only the final image event.

النطاق المطلوب: 0 <= x <= 3
quality
enum<string>
افتراضي:auto

Image quality. GPT image models: auto (default), high, medium, low. dall-e-2: standard only.

الخيارات المتاحة:
auto,
high,
medium,
low,
standard
response_format
enum<string> | null
افتراضي:url

Format for dall-e-2 responses: url or b64_json. GPT image models always return base64.

الخيارات المتاحة:
url,
b64_json
مثال:

"url"

size
enum<string> | null
افتراضي:1024x1024

Image size. GPT image models: 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto. dall-e-2: 256x256, 512x512, or 1024x1024.

الخيارات المتاحة:
1024x1024,
1536x1024,
1024x1536,
256x256,
512x512,
auto
مثال:

"1024x1024"

callback_url
string

Optional callback URL. When provided, the API returns a task_id immediately and POSTs the result to this URL once image editing completes. The callback payload includes task_id, trace_id, success (boolean), and the full response data or error.

الاستجابة

Image generated successfully or operation performed successfully.

data
object[]
مطلوب
created
number
مطلوب