If you are searching for the DALL-E 3 API, here is the short version: it no longer exists. OpenAI shut down DALL-E 2 and DALL-E 3 on 12 May 2026. Code that still calls dall-e-3 now fails.
The good news is that image generation APIs have moved on, and there are several strong replacements. This guide compares the five worth evaluating today: OpenAI GPT Image, Google Gemini image models, Flux (Black Forest Labs), Stability AI and Ideogram, plus Replicate as a way to try many models with one key.
All prices and limits below come from each provider's own pages, checked on 15 October 2026. Where we could not confirm something, we say so. These prices change often, so confirm before you budget.
What changed in 2026#
- DALL-E 2 and DALL-E 3: shut down on 12 May 2026.
- gpt-image-1: shuts down on 23 October 2026. gpt-image-1.5: shuts down on 1 December 2026. OpenAI points both to
gpt-image-2.5-sunburstorgpt-image-2.5-flare. - Responses changed too. OpenAI's image API now returns the picture as base64 data (
b64_json), not a web link. - Google's Gemini image models are now a serious option, with clear per-image prices.
If you run image generation in a live app, also read our guide to choosing an image API for production, which covers shutdown risk, rate limits and fallbacks.
What matters when choosing an image generation API#
Prompt adherence: does the model do what you ask, especially with complex scenes?
Photorealism: how convincing do people, products and places look?
Text in images: logos, posters and labels are the hardest thing for image models. OpenAI itself says text rendering is "significantly improved" but can still struggle with precise placement.
Cost per image: varies with size and quality. Quality settings are usually the biggest cost lever.
Commercial rights and data location: what you may do with outputs, and where your data is processed.
Longevity: models get retired quickly now, as DALL-E 3 shows. Keep the model name in one setting so a shutdown is a one-line change.
OpenAI: GPT Image (the DALL-E 3 replacement)#
Best for: general-purpose images, following detailed prompts, apps already using the OpenAI API.
OpenAI's current image models are gpt-image-2 and the gpt-image-2.5 pair: gpt-image-2.5-sunburst for the most precise editing, and gpt-image-2.5-flare for fast, high-quality everyday generation. OpenAI's docs say the 2.5 models need API organization verification.
Two practical changes from the DALL-E days: the quality setting is now low, medium, high or auto (the 2.5 models add xhigh and max), and the image comes back as base64, so you decode it and save the file.
// npm install openai
import fs from "node:fs";
import OpenAI from "openai";
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
async function generateImage(prompt) {
const result = await openai.images.generate({
model: "gpt-image-2.5-flare", // keep this in one setting: models get retired
prompt,
size: "1024x1024",
quality: "medium",
});
// The API returns base64 data, not a link.
return Buffer.from(result.data[0].b64_json, "base64");
}
const png = await generateImage(
"A photorealistic image of a red coffee mug on a wooden desk, morning light"
);
fs.writeFileSync("mug.png", png);import base64
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])
def generate_image(prompt: str) -> bytes:
result = client.images.generate(
model="gpt-image-2.5-flare", # keep in one setting
prompt=prompt,
size="1024x1024",
quality="medium",
)
return base64.b64decode(result.data[0].b64_json)
with open("logo.png", "wb") as f:
f.write(generate_image("Minimalist logo design, blue and white, geometric shapes"))Pros
Cons
Pricing: per million image output tokens, OpenAI lists gpt-image-2 and the gpt-image-2.5 models at $30, and $15 in batch mode. The cheaper gpt-image-1-mini is $8 ($4 in batch). Per-image cost depends on size and quality, so test with OpenAI's calculator.
Google: Gemini image models#
Best for: predictable per-image pricing, batch jobs, teams already on Google Cloud.
Google's Gemini API now includes several image models. Their official pricing page lists plain prices per image, which makes budgeting easy:
| Model | Standard price per image | Batch price per image |
|---|---|---|
| Gemini 3.1 Flash Lite Image | $0.0336 (1K) | $0.0168 (1K) |
| Gemini Nano Banana 2.1 | $0.0336 (1K), $0.0504 (2K), $0.113 (4K) | about half |
| Gemini 3.1 Flash Image | $0.067 (1K), $0.101 (2K), $0.151 (4K) | about half |
| Gemini 3 Pro Image | $0.134 (1K/2K), $0.24 (4K) | $0.067 (1K/2K) |
Google has also been retiring older models. Its page said gemini-2.5-flash-image was due to shut down on 2 October 2026, so start new work on the 3.1 models.
Pros
Cons
Flux (Black Forest Labs)#
Best for: photorealistic images, regional data control (EU or US), cost-sensitive projects.
Flux comes from Black Forest Labs, founded by several of the original Stable Diffusion researchers. Despite what older guides say, there is an official first-party API at api.bfl.ai. Its docs describe:
- A model family including FLUX.2 ([klein], [pro], [max], [flex]) and FLUX.1 models such as Kontext and 1.1 [pro], plus a newer FLUX 3 image model.
- Credits: 1 credit equals $0.01, and API and playground prices are the same. FLUX.2 models are priced by output size (megapixels), and FLUX 3 Image is priced per image by resolution tier. Third-party guides put smaller FLUX models at about a cent or two per image and premium ones at several cents, but check bfl.ai/pricing for live numbers.
- Async jobs: you start a job and poll a
polling_urluntil it is ready (or use webhooks). - Short-lived results: result links expire after 10 minutes, so download the image straight away and serve it from your own storage.
- Limits: up to 24 concurrent requests on most endpoints.
- Regions: a global endpoint plus EU (
api.eu.bfl.ai) and US (api.us.bfl.ai) endpoints.
You can also run Flux through platforms such as Replicate or fal.ai:
// Using Replicate: npm install replicate
import Replicate from "replicate";
const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN });
const output = await replicate.run("black-forest-labs/flux-schnell", {
input: { prompt: "Aerial view of a mountain lake at sunrise, cinematic" },
});
// Save the result right away: links from model platforms can expire.Pros
Cons
Stability AI#
Best for: custom styles, open-weight flexibility, the Stable Diffusion ecosystem.
Stability AI makes the Stable Diffusion family, the most widely used open-weight image models. You can run models yourself, use community fine-tunes, and apply techniques such as ControlNet and LoRA that closed APIs do not offer. Their hosted API (platform.stability.ai) gives you the models without running a GPU:
// Stability AI REST API (check platform.stability.ai for current endpoints)
async function generateStableImage(prompt) {
const form = new FormData();
form.append("prompt", prompt);
form.append("output_format", "webp");
const res = await fetch("https://api.stability.ai/v2beta/stable-image/generate/core", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.STABILITY_API_KEY}`, Accept: "image/*" },
body: form,
});
if (!res.ok) throw new Error(`Stability API error: ${res.status}`);
return Buffer.from(await res.arrayBuffer()); // raw image bytes
}Pros
Cons
Pricing: credit-based, with one credit worth about $0.01. Price guides report the Core model at about 3 credits ($0.03) and Ultra at about 8 credits ($0.08) per image, and new accounts have been given 25 free credits. We could not confirm these on Stability's own page, so check platform.stability.ai before budgeting. (Older guides, including an earlier version of this one, understated Core as about $0.01.)
Ideogram#
Best for: images with text in them, such as logos, posters and product labels.
Ideogram was built around the hardest problem in image generation: readable text inside the picture. Its API uses an Api-Key header, and the current docs show a request path for ideogram-4-5 (/v2/image/generate/ideogram-4-5). See Ideogram's API docs for the exact request format.
Things worth knowing from Ideogram's own pages:
- No free API tier. Requests are rejected until you add a payment method and prepaid credits. Credits cost 1 cent each, and the number of credits each image uses is listed on their pricing tab.
- Default limit of 10 requests in flight, with more available by contacting them.
- Links expire, so download images you want to keep.
We did not compare text quality head to head. Since every model, including OpenAI's, can still struggle with text placement, test your own wording before choosing.
Replicate: try many models with one key#
Best for: experimenting across many models without separate accounts.
Replicate hosts many open-source models behind one API, including Flux and Stable Diffusion variants. One REPLICATE_API_TOKEN gives you access to all of them, and you pay for what you use. Prices differ by model and change, so check the page of the model you want. It is a good way to compare models before you commit to one provider.
Side-by-side comparison#
| OpenAI GPT Image | Google Gemini image | Flux (BFL) | Stability AI | Ideogram | |
|---|---|---|---|---|---|
| Best for | Detailed prompts, editing | Clear pricing, batch | Photorealism, EU/US regions | Custom styles, open weights | Text in images |
| Pricing style | Per token (by quality and size) | Per image | Credits, per megapixel/tier | Credits | Prepaid credits |
| Half-price batch | Yes | Yes | Not confirmed | Not confirmed | Not confirmed |
| Free API tier | No | No | No | 25 starter credits reported | No |
| Fine-tuning | No | No | Not offered on the hosted API | Yes (open weights) | No |
| Image delivery | Base64 in the response | Check docs | Link that expires in 10 minutes | Raw image bytes | Link that expires |
| Documented limit | By account tier | By account tier | 24 concurrent | By account tier | 10 in flight |
Which one should you pick?#
Replacing DALL-E 3 with minimal changes: OpenAI GPT Image. Switch the model to gpt-image-2.5-flare (or gpt-image-2), update the quality values, and read the base64 response. If you used dall-e-3, those three changes are most of the migration.
You want the easiest price forecasting: Google Gemini image models. Plain per-image prices and half-price batch mode.
You need photorealism or EU/US data control: Flux via the Black Forest Labs API. Remember to download results within 10 minutes.
You need custom styles or open weights: Stability AI, or open-weight models via Replicate.
You need text inside the image: try Ideogram, and test your exact wording against the others.
Not sure yet: Replicate. One key, many models, pay per use.
Whatever you pick, test 20 of your own prompts on two providers before deciding, and keep a second provider ready as a backup.
Related reading#
- gpt-image-1 Shutdown: How to Migrate Before 23 Oct 2026: step-by-step switch to the gpt-image-2.5 models.
- Best Image Generation API for Production Apps: shutdown risk, rate limits, costs at scale and fallbacks for live apps.
- Cheapest Image Generation API (2026): real cost per image and per 10,000 images, plus free options.
- Runway Gen-4.5 vs Veo 3.1 vs Seedance: if you need video, not images.
- How to Tell If an API Tutorial Is Outdated: 7 quick checks, useful when a model like DALL-E 3 gets retired.
- How to Use the OpenAI API: covers the full OpenAI API including text, vision and embeddings.
- Browse all AI & ML APIs: LLMs, speech, embeddings, and more AI APIs.