About GPT Image 2 Edit
GPT Image 2 Edit is OpenAI's image editing model. It transforms one or more reference images using a text prompt, supporting multi-image composition and accurate preservation of subject identity, text, and layout. Ideal for photo modifications, style transfer, composition changes, and product mockups.
Ready to build with GPT Image 2 Edit?
Try GPT Image 2 Edit in the Workbench to prompt it, compare outputs, and iterate on prompts without writing any code. When you're ready to ship, call the same model from our API and build your own apps on top of it.
curl -sSf -X POST https://hub.oxen.ai/api/ai/images/edit \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OXEN_API_KEY" \
-d '{
"model": "gpt-image-2-edit",
"prompt": "Place the subject from @Image1 on the surface of the moon with Earth rising in the background, photorealistic, cinematic lighting.",
"input_image": [
"https://hub.oxen.ai/api/repos/ox/Oxen-AI-Assets/file/main/images/ox_zoom_out_1926_1076.png"
],
"aspect_ratio": "16:9",
"resolution": "2K",
"quality": "high",
"output_format": "png"
}'Request parameters
Every field GPT Image 2 Edit accepts in the request body. See the API reference for response formats.
POST
https://hub.oxen.ai/api/ai/images/edit| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | — | Text description of how to edit the input image(s). Use @Image1, @Image2, etc. to reference the input images. |
input_image | array<string>nullable | Yes | — | One or more reference images to transform. Reference them in the prompt as @Image1, @Image2, etc. |
mask_url | stringuri · nullable | No | — | Optional mask image URL. White pixels mark regions to edit; black pixels are preserved. Leave empty to edit the whole image. |
aspect_ratio | string | No | "16:9" | auto1:116:99:164:33:43:22:321:99:21 |
resolution | string | No | "2K" | 1K2K |
quality | string | No | "high" | Output quality tier. Use 'auto' to let the model pick, or set explicitly to low, medium, or high.autolowmediumhigh |
output_format | string | No | "png" | File format for the generated image.pngjpegwebp |
image_size | object | No | — | Pixel dimensions sent to fal, derived from aspect_ratio and resolution. |