GPT Image 2 Editing

openai/gpt-image-2/edit

GPT Image 2 Editing supports image editing and multi-image synthesis with high-quality results.

Base price
$0.20USD / run
Execution
async
Model type
image
Input fields
6

Try the model

Playground

Open playground
Input

PNG, JPEG, WebP, or GIF · 20 MiB maximum each

The URLs of the images to use for image-to-image generation or image editing.
The text prompt to generate an image from.
Quality for the generated image Allowed values: low, medium, high.
The resolution of the generated image. Leave unset to preserve the provider's standard dimensions. Allowed values: 1k, 2k, 4k.
The aspect ratio of the generated image. Allowed values: 1:1, 1:2, 2:1, 1:3, 3:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9.
The format of the generated image. Allowed values: jpeg, png, webp.
OutputReady

Your output will appear here

Complete the inputs, then click Run.

Specifications

Pricing

Base price
$0.20 / run
Billing formula
(params.aspect_ratio == "21:9" || params.aspect_ratio == "9:21") ? ((params.quality ?? "high") == "low" ? 0.03 : ((params.quality ?? "high") == "medium" ? 0.08 : 0.30)) : ((params.quality ?? "high") == "low" ? 0.015 : ((params.quality ?? "high") == "medium" ? 0.05 : 0.20))

Context & modalities

Input
Schema-defined
Output
image

Capabilities

Chat
Not supported
Vision
Not supported
Reasoning
Not supported
Structured output
Not supported
Function calling
Not supported
Audio input
Not supported

Access

Provider
OpenAI
Model ID
openai/gpt-image-2/edit
Execution
async
API
Unified Run API
Endpoint
/v1/run

API README

OpenAI GPT Image 2 Edit

Precision image editing powered by OpenAI's GPT Image 2. Modify existing images with natural language — swap backgrounds, combine multiple sources, add or remove elements — while preserving the original style and quality.

Highlights

Multi-image synthesis — Accepts up to 16 input images in a single request. Combine product photos into a gift basket, merge reference images into a cohesive scene, or apply style from one image to another.

Context-aware editing — Understands what to change and what to preserve. Edits blend naturally with surrounding pixels, maintaining lighting consistency, material textures, and perspective.

High-fidelity input — Processes source images at full resolution without downsampling. Fine details like fabric weave, text on labels, and subtle gradients survive the editing process.

Pricing

QualityStandard SizeLarge (21:9 / 9:21)
Low$0.015$0.03
Medium$0.05$0.08
High$0.20$0.30

Standard covers most aspect ratios (1:1, 2:3, 3:2, 4:3, 16:9, etc). Large applies to ultra-wide/tall formats only.

When to Use

✅ Good fit❌ Consider alternatives
Product photo background swapsGenerating images from zero (use Generation model)
Combining multiple items into one scenePixel-perfect mask control (limited stability)
Packaging and label visualizationReal-time interactive editing
Style transfer across imagesVideo frame manipulation
Adding text overlays to existing photosSimple crops or color adjustments

Input Requirements

  • Images provided as publicly accessible URLs
  • Supported formats: PNG, JPEG, WebP
  • Up to 16 images per request
  • Max file size: 50MB per image
  • For best results: use consistent lighting and resolution across input images

Technical Specs

SpecValue
InputText prompt + 1–16 image URLs
OutputPNG, JPEG, or WebP
Resolution655,360 – 8,294,400 total pixels
Max edge3,840 px
Aspect ratioUp to 3:1
Edge constraintMultiples of 16
ExecutionAsync (submit → poll for result)

Related

Start building

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

Production API
Unified Run API endpoint
https://api.sandbase.ai/v1/run
Model ID
openai/gpt-image-2/edit
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
  -X POST "https://api.sandbase.ai/v1/run" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'SANDBASE_JSON'
{
  "model": "openai/gpt-image-2/edit",
  "images": [
    "https://cdn.openai.com/API/docs/images/body-lotion.png",
    "https://cdn.openai.com/API/docs/images/soap.png",
    "https://cdn.openai.com/API/docs/images/incense-kit.png",
    "https://cdn.openai.com/API/docs/images/bath-bomb.png"
  ],
  "prompt": "Generate a photorealistic image of a gift basket on a white background labeled 'Relax & Unwind' with a ribbon and handwriting-like font, containing all the items in the reference pictures.",
  "quality": "high",
  "output_format": "png"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
  status=$(printf '%s' "$result" | jq -r .status)
  case "$status" in completed|failed|timeout) break ;; esac
  sleep 2
  result=$(curl --fail-with-body --silent \
    -H "Authorization: Bearer $SANDBASE_API_KEY" \
    "https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"

Choose your model

Compare models

All language models
ModelContextInput / 1MOutput / 1MReleased
OpenAI———Apr 21, 2026
OpenAI———Aug 20, 2026
OpenAI———Aug 20, 2026
OpenAI———Aug 20, 2026
OpenAI———Aug 20, 2026
OpenAI———Apr 21, 2026