External Publication
Visit Post

/v1/images/edits rejects gpt-image-2 — hardcoded to dall-e-2 only

OpenAI Developer Community May 9, 2026
Source

Hi and welcome to the community!

This is likely caused by the documentation. The docs mix several image surfaces and model families, so it is easy to combine parameters from different paths.

For gpt-image-2 image input, use:

curl https://api.openai.com/v1/images/edits \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F "model=gpt-image-2" \
  -F "image[]=@input.png" \
  -F "prompt=Edit this image by ..."

Or with the Python SDK:

from openai import OpenAI

client = OpenAI()

result = client.images.edit(
    model="gpt-image-2",
    image=open("input.png", "rb"),
    prompt="Edit this image by ..."
)

Please note:

  • /v1/images/edits is the correct endpoint for GPT Image with reference-image or edit workflows.
  • /v1/images/variations is DALL-E 2 only. It does not support gpt-image-2.
  • response_format is a DALL-E-era parameter. GPT Image models return base64 image data and use GPT-image-specific parameters like output_format, output_compression, quality, etc.

Discussion in the ATmosphere

Loading comments...