Skip to main content
POST
/
api
/
ai
/
images
/
edits
OpenAI Image Editing
curl --request POST \
  --url https://aitoearn.cn/api/ai/images/edits \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "image": "<string>",
  "prompt": "<string>"
}
'
{}

Authorizations

Authorization
string
header
required

Used by OpenAI-compatible endpoints. Example: Bearer .

Body

application/json
model
string
required

Image editing model name. First call the "Image Editing Models" interface (GET /api/ai/models/image/edit) and pass in the data[n].name returned by it; the size, maximum number of input images and price supported by each model shall be subject to the return of this interface.

image
required

Picture list

prompt
string
required

prompt word

mask
string

Mask image URL for partial redraw (optional). It needs to be a PNG image with the same size as image: the completely transparent area (alpha is 0) represents the part that needs to be redrawn according to the prompt word, and the opaque area remains unchanged. Edit the entire image when not uploading.

n
integer

Generate quantity

Required range: 1 <= x <= 9007199254740991
size
string

Image size. The optional values ​​vary from model to model, and are subject to the data[n].sizes returned by the "Image Editing Models" interface; the prices for different sizes are different, see data[n].pricing.

response_format
enum<string>

Return format

Available options:
url,
b64_json

Response

Native third-party protocol response or SSE data, not wrapped in the AiToEarn common response envelope.

Native third-party protocol response, not wrapped in the AiToEarn common response envelope.