Jan 18, 2025
Programmatic image generation went from "impressive demo" to "line item in your unit economics." A publishable image now costs anywhere from a third of a cent to about six cents — so the model you choose directly affects your margins.
This guide covers the current image generation APIs, how to call them, and what each image actually costs.
Stability AI's Stable Image / Stable Diffusion 3.5 models remain the flexible, affordable default, with a clean REST API for generate, edit, and upscale (typically ~$0.01–$0.05/image).
import requests
resp = requests.post(
"https://api.stability.ai/v2beta/stable-image/generate/sd3",
headers={"Authorization": "Bearer YOUR_KEY", "Accept": "application/json"},
files={"none": ""},
data={"prompt": "isometric API gateway, soft studio lighting, 8k", "aspect_ratio": "16:9"}
)
Best for: flexible workflows, image-to-image, and cost control.
FLUX.2 set a new bar for open-weight image quality. Hosted via aggregators like Replicate: Flux Schnell ~$0.003/image, Flux Dev ~$0.025, Flux 2 Pro ~$0.055.
Best for: photorealism and prompt adherence at a competitive price.
DALL·E is retired; the gpt-image family replaced it. gpt-image-1 (~$0.04/image, mini ~$0.005) excels at following complex prompts and rendering legible text inside images.
from openai import OpenAI
client = OpenAI()
img = client.images.generate(model="gpt-image-1", prompt="A poster that says 'SHIP IT', retro print style", size="1024x1024")
Best for: marketing creatives, anything with text, and tight prompt control.
Imagen 4 offers three tiers — Fast (~$0.02), Standard (~$0.04), Ultra (~$0.06) — accessible through Google Cloud AI.
Best for: Google Cloud stacks and predictable quality tiers.
Leonardo AI ships fine-tuned models for game assets and concept art with a developer API. Midjourney remains the aesthetic benchmark; check current official API availability before building on it.
| Model | Per image (standard) | Standout | API |
|---|---|---|---|
| Stable Image 3.5 | ~$0.01–0.05 | Flexible edit/upscale | REST |
| Flux Schnell | ~$0.003 | Cheapest decent quality | Aggregators |
| Flux 2 Pro | ~$0.055 | Top open-weight quality | Aggregators |
| gpt-image-1 | ~$0.04 | Prompt + text rendering | REST |
| Imagen 4 (Std) | ~$0.04 | Tiered quality | Google Cloud |
Batch APIs from OpenAI and Google can cut these ~50%.
Structure prompts as subject → style → details → lighting → quality:
A medieval castle on a sea cliff, digital concept art,
intricate stonework, ivy-covered towers, dramatic sunset,
volumetric clouds, sharp focus, highly detailed
Use negative prompts to exclude artifacts: blurry, low quality, distorted, watermark, text.
E-commerce product shots, marketing creatives, game concept art, editorial illustration, and unique hero images for web.
Explore every image API in our AI API directory, and if you also need motion, see our AI video generation guide.