Skip to content

Picture Editor ​

Photo editing API is used to modify images based on uploading pictures and prompt, suitable for changing background, local modifications, style alignment and commodity chart processing. Whether or not to support editing based on the description of the selected image model, the GPT Image series is usually used as a priority.

API Path ​

MethodologyPathReturns by
POST/v1/images/editssynchronous returns the edit photo result.
POST/v1/images/edits/asyncReturns task ID first, then queryes the editing results.

Example request ​

bash
curl https://moonnexai.com/v1/images/edits \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -F "image=@./product.png" \
  -F "model=gpt-image-2-pro" \
  -F "prompt=Change the background to a clean studio scene." \
  -F "size=1024x1024"

Common field ​

fieldAnnotations
imageEnter the picture file.
modelPicture model name, for example, gpt-image-2-pro.
promptEdits the description of the target.
maskMonued file, based on API Reference.
sizeOutput size.

Results-based processing ​

sceneTreatment
Commodity Chart EditSaves original, edits prompt and results.
Local changessynchronous saves information about mask files or mask sources.
Failed to retryRe-submit the original file and the request parameter.
asynchronous EditSaves id, polling GET /v1/images/tasks/{task_id}, successfully read data[].url.

Access Recommendations ​

  • Enter the picture to be clear and the main edge as complete as possible.
  • For local changes, write in the programt to clear the contents and modify the area.
  • Use synchronous /v1/images/edits when uploading local picture files; Picture Step Task is available when entering a public web URL or Base64 image content.
  • When you need a stable re-use, look at Uploads and assets first.

Relevant Pages ​