Skip to content

Edit Images (OpenAI Native Format)

Edit a source image (with an optional mask) according to a prompt. See also Generate images; as well as the Gemini native format and Qwen native format.

Endpoint

POST /v1/images/edits

Upload via multipart/form-data:

bash
curl https://ai.youqi.tech/v1/images/edits \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -F model="dall-e-2" \
  -F image="@origin.png" \
  -F mask="@mask.png" \
  -F prompt="Replace the background with a seaside sunset"

Parameters

ParameterTypeRequiredDescription
modelstringYesImage model, e.g. dall-e-2
imagefileYesSource image file
maskfileNoMask file; transparent areas mark the region to edit
promptstringYesEdit instruction
nintegerNoNumber to generate, default 1
sizestringNoSize

TIP

Supported edit / mask capabilities vary by model.