4Z API

Edit with gpt-image-2.6-flare

Endpoint: POST https://4zapi.com/v1/images/edits

Edits the uploaded image according to the prompt. One image is edited in place; several images are combined into one. The request body is multipart/form-data.

  • To upload several images, repeat the image field (up to 16). In the OpenAI SDK, client.images.edit(image=[f1, f2, ...]) sends them this way.
  • For local edits use either mask (transparent areas are changed) or markup (new in 2.6: circle the area on a transparent PNG and describe the change in prompt), not both.
  • Multi-round edits: send the previous result back as image, describe only this round's change, and state that everything else stays the same.
  • For focused edits such as background swaps or signage changes, complexity low is recommended.
  • Synchronous: all images are returned at once when generation finishes.
  • SVG output is supported by the generations endpoint only.

Request example

{
  "complexity": "low",
  "image": "@file",
  "model": "gpt-image-2.6-flare",
  "n": 1,
  "prompt": "把背景换成雪山,人物保持不变",
  "size": "1024x1024"
}