dall-e-2 — Retired
- Deprecated
- —
- Shutdown
- 2026-05-12
- Status
- deprecated
- Replacement
- gpt-image-1
Quick fix — copy & paste
Choose your language. The "before" block matches the deprecated call; the "after" block is the drop-in replacement.
image = client.images.generate(
model="dall-e-2",
prompt="A red panda eating bamboo",
size="512x512",
n=4,
) image = client.images.generate(
model="gpt-image-1-mini",
prompt="A red panda eating bamboo",
size="1024x1024",
n=4,
) const image = await openai.images.generate({
model: "dall-e-2",
prompt: "A red panda eating bamboo",
size: "512x512",
n: 4,
}); const image = await openai.images.generate({
model: "gpt-image-1-mini",
prompt: "A red panda eating bamboo",
size: "1024x1024",
n: 4,
}); "model": "dall-e-2", "size": "512x512" "model": "gpt-image-1-mini", "size": "1024x1024" Error messages
Seeing one of these? You're in the right place.
-
model_not_found: dall-e-2 -
DALL-E 2 has been deprecated
Replacement options
-
gpt-image-1Compare token cost → -
gpt-image-1-miniCompare token cost →
Other OpenAI deprecations
Error decoder
Paste any API error and identify which deprecated model it refers to.
Upcoming shutdowns calendar
Chronological timeline of every scheduled shutdown across all providers.
What this means for your code
dall-e-2 is an image-generation model called through the images endpoint. Image generation models often change their quality enums, default response format (URL vs base64), supported sizes, and per-image pricing between versions. Migration is rarely a clean string swap.
dall-e-2 was retired by OpenAI on 2026-05-12. API calls now return an error and the model is no longer accessible. New code should use gpt-image-1; legacy code that still references this model id needs to be updated immediately.
Find every call in your codebase
Before you change anything, locate every place the deprecated model id is referenced. Search source files, environment files, feature flags, and config repos. Use these commands from your project root:
Python projects
grep -rn '"dall-e-2"' --include="*.py" . JavaScript / TypeScript projects
grep -rn '"dall-e-2"' --include="*.{js,ts,tsx,jsx}" . Anywhere (configs, scripts, infra)
grep -rn "dall-e-2" . Migration checklist
Steps in order. Skip any that don't apply, but read the whole list — for image gen models, the non-obvious steps are usually the ones that break in production.
- 1. Update the model id in image generation calls
- 2. Map the old quality enum (standard/hd) to the new model's enum (low/medium/high/auto)
- 3. Verify supported sizes — newer models may not support 256x256 or 512x512
- 4. Check response_format default — gpt-image-1 returns base64 by default while DALL-E returned URLs
- 5. Recompute per-image cost; some new models charge by tile count, not by image
Will this migration cost more?
Switching from dall-e-2 to gpt-image-1 could change your costs significantly. Calculate the exact difference for your prompts.
Open the cost calculator →