AI Image Generation API Comparison 2026: Pricing, Quality, Value
As of October 10, 2026, GPT Image 2.5 leads Arena's image ranking, low-quality GPT Image 2 is cheapest at about $0.006, and Nano Banana Pro costs $0.134.
On this page

Prices, model IDs and leaderboard scores below are as of October 10, 2026. Most of the image APIs people compared in early 2026 are gone or about to go: DALL-E 3 shut down on May 12, Imagen 4 left the Gemini API on August 17, and gpt-image-1 shuts down on October 23. The current field is OpenAI's GPT Image 2 and 2.5, Google's Nano Banana family, Black Forest Labs' FLUX 3 and FLUX.2, ByteDance's Seedream 5.0, xAI's Grok Imagine, Alibaba's Qwen and Wan, Recraft and Stability AI.
Best, Cheapest, and Best-Value AI Image API as of October 2026
Best quality: GPT Image 2.5 Sunburst holds first place on the LM Arena text-to-image leaderboard dated October 7, 2026 (score 1425), ahead of GPT Image 2.5 Flare (1398) and GPT Image 2 at medium quality (1383). Both 2.5 entries are still marked preliminary. OpenAI bills them per token; a 1024×1024 image works out to about $0.013 at medium quality and $0.053 at high.
Cheapest per image: at roughly one megapixel, OpenAI's own low-quality setting is the cheapest first-party option: $0.006 for a 1024×1024 GPT Image 2 image, and about $0.006 for GPT Image 2.5 (output tokens only). Outside OpenAI, Recraft V4.1 Flash is $0.007, FLUX.2 [klein] 4B is $0.015 and Seedream 5.0 Flash is $0.018.
Best value at a usable quality: Nano Banana 2.1 (gemini-nano-banana-2.1) costs $0.0336 per 1K image, $0.0168 on Google's Batch API, and sits sixth on Arena at 1328. FLUX.2 [pro] from $0.03 is the other strong price-to-score pick.
Nano Banana Pro (Gemini 3 Pro Image) is not cheap: it costs $0.134 per 1K or 2K image and $0.24 at 4K on the Gemini API, four times Nano Banana 2.1 at 1K. No Gemini image model has a free API tier.
At roughly one megapixel, list prices run from $0.006 (GPT Image 2, low) to $0.211 (GPT Image 2, high), a 35x spread inside a single model. Your quality setting moves the bill more than your choice of provider.
Every AI Image API You Need to Know in 2026
The lineup below covers the image models you can call today through each vendor's own API, with the IDs you put in the request.
OpenAI. gpt-image-2.5-sunburst and gpt-image-2.5-flare (snapshots dated 2026-09-08) are the current models. They share the same token rates: $5 per million text input tokens, $8 per million image input tokens and $30 per million image output tokens. gpt-image-2 is still available with per-image prices by quality and size. For the 2.5 cost math in more depth, including quality settings and editing charges, see GPT Image 2.5 Sunburst pricing; for implementation details of the previous model, see the GPT-Image-2 API guide.
Google. The Gemini API sells four image models under the Nano Banana name: Nano Banana 2.1 (gemini-nano-banana-2.1), Nano Banana 2 (gemini-3.1-flash-image), Nano Banana 2 Lite (gemini-3.1-flash-lite-image) and Nano Banana Pro (gemini-3-pro-image, also called Gemini 3 Pro Image). Prices are per image and depend on output resolution. Gemini API pricing page. The Nano Banana 2.1 API pricing guide covers the newest model, and Nano Banana API cost: Lite, Nano Banana 2, Pro compares the rest of the family.
Black Forest Labs. FLUX 3 Image is the new flagship, priced by output size. The FLUX.2 line has [pro], [max], [flex] and the small [klein] 4B and 9B models; FLUX.2 [dev] is open weights and isn't sold on the BFL API. Older FLUX1.1 [pro] ($0.04), FLUX1.1 [pro] Ultra ($0.06) and the Kontext editing models ($0.04 [pro], $0.08 [max]) are still listed. BFL API pricing.
ByteDance. Seedream 5.0 comes in Pro (dola-seedream-5-0-pro-260628), Flash (dola-seedream-5-0-flash-260915) and Lite (seedream-5-0-lite-260128) on BytePlus ModelArk, alongside Seedream 4.5, Seedream 4.0 and SeedEdit 3.0. Failed or moderated images are not billed. BytePlus ModelArk pricing.
xAI. grok-imagine-image ($0.02), grok-imagine-image-2.0 ($0.04) and grok-imagine-image-quality ($0.05). xAI model list.
Alibaba Cloud Model Studio. Prices for the Singapore region: qwen-image-3.0-pro ($0.04 at 1k, $0.075 at 2k), qwen-image-3.0 ($0.03), qwen-image-2.1-turbo ($0.016), z-image-turbo ($0.015), wan2.7-image-pro ($0.075) and wan2.7-image ($0.03). New Singapore accounts get small free quotas of 10 to 100 images per model. Alibaba Cloud Model Studio pricing.
Recraft and Stability AI. Recraft V4.1 Flash is $0.007 per raster image and V4.1 is $0.035, with vector output at $0.08 (Recraft API pricing). Stability AI lists Stable Image Ultra at $0.08, SD 3.5 Large at $0.065, SD 3.5 Large Turbo at $0.04, SD 3.5 Medium at $0.035, Core at $0.03, SD 3.5 Flash at $0.025 and SDXL from $0.009, plus 25 free credits for new accounts (Stability AI platform pricing).
Tencent. Hy-Image-3.5-preview costs ¥0.15 per image at 1K or 2K and ¥0.2 at 4K on TokenHub, priced in yuan only. The older HY-Image-v3.0 (Hunyuan Image 3.0) went offline on September 15, 2026.
Ideogram, Microsoft and Midjourney. Ideogram 4.0 has Turbo, Default and Quality tiers; check Ideogram's pricing page for the API rate before budgeting, since it isn't in the tables below. Microsoft's MAI-Image-2.6 ranks fifth on Arena, but its API pricing isn't covered here. Midjourney has no public API, and its guidelines say automating interactions with the service is strictly prohibited.
For a consumer-side ranking of image apps rather than APIs, see best AI image generators.
Retired and retiring models: gpt-image-1 shuts down October 23
If your code still calls one of these, plan the switch now. Dates come from the OpenAI deprecations page and the Gemini API deprecations page.
| Model | Status | Move to |
|---|---|---|
dall-e-3, dall-e-2 | Shut down May 12, 2026 | gpt-image-2 or gpt-image-2.5-* |
| Imagen 4 Fast / Standard / Ultra | Shut down on the Gemini API August 17, 2026 | gemini-nano-banana-2.1 (Google's named replacement) |
| HY-Image-v3.0 (Hunyuan Image 3.0) | Offline since September 15, 2026 | Hy-Image-3.5-preview |
gemini-2.5-flash-image | Deprecated; Google's pricing page gives October 2, 2026, its deprecations page March 15, 2027 | gemini-3.1-flash-image or gemini-3.1-flash-lite-image |
gpt-image-1 (1024²: $0.011 / $0.042 / $0.167) | Shuts down October 23, 2026 | gpt-image-2.5-* or gpt-image-2 |
gpt-image-1.5 ($0.009 / $0.034 / $0.133) | Shuts down December 1, 2026 | same |
gpt-image-1-mini ($0.005 / $0.011 / $0.036) | Shuts down December 1, 2026 | same |
Two names from early-2026 comparisons were never real model names: "Flux 2 Pro v1.1" and "Flux 2 Schnell". The actual BFL models are FLUX.2 [pro] and FLUX1.1 [pro]; the cheap "schnell" model is FLUX.1 [schnell], an open-weights model you can run on hosts such as Replicate. Ideogram 2.0 has been replaced by Ideogram 4.0. Whether Imagen 4 is still available on Vertex AI is not stated in the Gemini API documentation.
The Real Cost: AI Image API Pricing Compared

Selected Standard prices as of October 10, 2026. OpenAI figures estimate image-output tokens; prompts, reference inputs and other request components may add cost.
Every price here is the vendor's standard list price in US dollars for a single generated image at about one megapixel (1024×1024, "1K" or "1k"), unless the row says otherwise. Token-billed models also charge for your prompt and any input images.
Per-Image API Pricing Table
| Model | API ID | Standard price per image | Batch price | Notes |
|---|---|---|---|---|
| GPT Image 2.5 Sunburst / Flare | gpt-image-2.5-sunburst, gpt-image-2.5-flare | ~$0.006 low, ~$0.013 medium, ~$0.053 high, ~$0.094 xhigh, ~$0.211 max | Image output at $15/1M (about half) | Output-token estimate, 1024² |
| GPT Image 2 | gpt-image-2 | $0.006 low, $0.053 medium, $0.211 high | Image output tokens at half price | 1024×1536: $0.005 / $0.041 / $0.165 |
| Nano Banana 2.1 | gemini-nano-banana-2.1 | $0.0336 (1K), $0.0504 (2K), $0.113 (4K) | $0.0168 / $0.0252 / $0.0567 | Replacement for Imagen 4 |
| Nano Banana 2 | gemini-3.1-flash-image | $0.067 (1K); $0.045 (0.5K), $0.101 (2K), $0.151 (4K) | Half ($0.034 at 1K) | |
| Nano Banana 2 Lite | gemini-3.1-flash-lite-image | $0.0336 (1K) | $0.0168 | |
| Nano Banana Pro (Gemini 3 Pro Image) | gemini-3-pro-image | $0.134 (1K or 2K), $0.24 (4K) | $0.067 / $0.12 | |
| FLUX 3 Image | BFL | $0.048 (1k); $0.041 (768²), $0.100 (2k), $0.607 (4k) | — | |
| FLUX.2 [pro] | BFL | From $0.03 for the first megapixel | — | +$0.015 per extra output or reference megapixel |
| FLUX.2 [max] / [flex] | BFL | From $0.07 / $0.05 per megapixel | — | |
| FLUX.2 [klein] 4B / 9B | BFL | $0.014 + $0.001 per MP / $0.015 + $0.002 per MP | — | About $0.015 and $0.017 at 1 MP |
| Seedream 5.0 Pro | dola-seedream-5-0-pro-260628 | $0.045 (up to 1.5K), $0.09 above | — | Failed or moderated images free |
| Seedream 5.0 Flash / Lite | dola-seedream-5-0-flash-260915, seedream-5-0-lite-260128 | $0.018 / $0.035 | — | Seedream 4.5: $0.04 |
| Grok Imagine Image | grok-imagine-image, -2.0, -quality | $0.02 / $0.04 / $0.05 | — | |
| Qwen Image 3.0 Pro | qwen-image-3.0-pro | $0.04 (1k), $0.075 (2k) | — | Singapore region |
| Recraft V4.1 Flash / V4.1 | Recraft | $0.007 / $0.035 | — | V4.1 vector: $0.08 |
| Stable Image Ultra / Core | Stability AI | $0.08 / $0.03 | — | SD 3.5 Flash: $0.025 |
A dash means the vendor's pricing page lists no separate batch rate. Vendor pricing pages: OpenAI image generation pricing, OpenAI image generation guide, Gemini API pricing page, BFL API pricing, BytePlus ModelArk pricing, xAI model list, Alibaba Cloud Model Studio pricing, Recraft API pricing, Stability AI platform pricing.
laozhang.ai, an OpenAI-compatible platform, lists flat per-call prices in its default group for several of these models: gpt-image-2 and the gpt-image-2.5-sunburst-vip / -flare-vip IDs at $0.03, gemini-3-pro-image at $0.09, gemini-3.1-flash-image at $0.055, gemini-nano-banana-2.1 at $0.045, flux-2-pro at $0.03 and dola-seedream-5-0-pro at $0.12 (as of October 10, 2026). That is below the official list for Nano Banana Pro, Nano Banana 2 at 1K, GPT Image 2 at medium or high and GPT Image 2.5 at high quality; equal for FLUX.2 [pro]; and above the official price for Nano Banana 2.1 at 1K ($0.0336), Seedream 5.0 Pro ($0.045–$0.09), GPT Image 2.5 at low or medium and GPT Image 2 at low. The listing does not say whether a call's price changes with resolution or covers more than one image.
Disclosure: laozhang.ai is our own service. Its prices are platform pricing, not an independent comparison.
GPT Image 2.5 API pricing: $30 per 1M image output tokens
GPT Image 2.5 has no flat per-image price. OpenAI bills Sunburst and Flare at $5 per million text input tokens, $8 per million image input tokens and $30 per million image output tokens; the Batch API charges $15 per million image output tokens. A 1024×1024 image uses about 439 output tokens at medium quality and 1,756 at high, which gives the per-image estimates in the table:
- medium: 439 × $30 / 1,000,000 ≈ $0.0132
- high: 1,756 × $30 / 1,000,000 ≈ $0.0527
- high on Batch: 1,756 × $15 / 1,000,000 ≈ $0.0263
Add your prompt. A 200-token prompt costs 200 × $5 / 1,000,000 = $0.001, which is small at high quality but adds about 17% to a $0.006 low-quality image. Editing calls also pay $8 per million tokens for each input image. For the full breakdown by quality setting, see GPT Image 2.5 Sunburst pricing.
Gemini API image generation pricing: Nano Banana 2.1, 2, Lite and Pro
Google charges each Gemini image model per output image, and the price climbs with resolution. At 1K, Nano Banana 2.1 and Nano Banana 2 Lite both cost $0.0336, Nano Banana 2 costs $0.067 and Nano Banana Pro costs $0.134. Pro charges the same $0.134 at 2K, which makes 2K the better deal on that model if you need the pixels. At 4K the prices are $0.113 (2.1), $0.151 (Nano Banana 2) and $0.24 (Pro). The Batch API halves all of them.
There is no free API tier for image output on any of these models. Gemini API keys are free to create, but image calls need a project on a paid tier. More detail: Gemini 3 Pro Image API pricing, Nano Banana Pro pricing, the Gemini API pricing guide, and an older Gemini 3 Pro Image API pricing and speed test with generation-time measurements.
Cheapest image generation API at about one megapixel
Sorted by standard price for a single ~1 MP image:
- GPT Image 2 or 2.5 at low quality: ~$0.006 (plus prompt tokens)
- Recraft V4.1 Flash: $0.007
- GPT Image 2.5 at medium quality: ~$0.013
- FLUX.2 [klein] 4B: ~$0.015, and Alibaba
z-image-turbo: $0.015 - Alibaba
qwen-image-2.1-turbo: $0.016 - Nano Banana 2.1 or Nano Banana 2 Lite on Google's Batch API: $0.0168
- Seedream 5.0 Flash: $0.018
- Grok Imagine Image: $0.02
Among the models priced above, the cheapest ways to get a top-ten Arena model are GPT Image 2.5 at medium (~$0.013, about half that on Batch) and Nano Banana 2.1 on Batch ($0.0168). Below about $0.006, hosted open-weights models are what's left: FLUX.1 [schnell] on Replicate runs about $0.003 per image, and Cloudflare Workers AI gives 10,000 free Neurons a day for FLUX models. The free AI image generation API comparison works out how many images those free allowances buy.
Volume Cost Projections
Monthly cost at a fixed price per image, before prompt tokens and without any volume discount:
| Model and setting | Price per image | 1,000 images | 10,000 images | 100,000 images |
|---|---|---|---|---|
| GPT Image 2, low (1024²) | $0.006 | $6 | $60 | $600 |
| Recraft V4.1 Flash | $0.007 | $7 | $70 | $700 |
| GPT Image 2.5, medium | ~$0.0132 | $13.20 | $132 | $1,320 |
| Nano Banana 2.1, 1K, Batch | $0.0168 | $16.80 | $168 | $1,680 |
| Seedream 5.0 Flash | $0.018 | $18 | $180 | $1,800 |
| FLUX.2 [pro], 1 MP | $0.03 | $30 | $300 | $3,000 |
| Nano Banana 2.1, 1K | $0.0336 | $33.60 | $336 | $3,360 |
| Grok Imagine Image 2.0 | $0.04 | $40 | $400 | $4,000 |
| FLUX 3 Image, 1k | $0.048 | $48 | $480 | $4,800 |
| GPT Image 2.5, high | ~$0.0527 | $52.70 | $527 | $5,270 |
| Nano Banana 2, 1K | $0.067 | $67 | $670 | $6,700 |
| Nano Banana Pro, 1K or 2K | $0.134 | $134 | $1,340 | $13,400 |
| GPT Image 2, high (1024²) | $0.211 | $211 | $2,110 | $21,100 |
A worked mix: a catalog app that drafts 10,000 images a month on Nano Banana 2.1 Batch (10,000 × $0.0168 = $168) and renders 1,000 finals on GPT Image 2.5 at high quality (1,000 × $0.0527 = $52.70) spends about $220.70 before prompt tokens. Running all 11,000 images on GPT Image 2.5 high would cost 11,000 × $0.0527 = $579.70, and on Nano Banana Pro 11,000 × $0.134 = $1,474.
Consumer Subscription Comparison
Consumer chat plans are billed separately from the APIs, and they don't promise a fixed number of images. In the US, Google's Gemini plans are Free ($0), AI Plus ($4.99 a month), AI Pro ($19.99) and AI Ultra ($99.99 or $199.99); image use counts against a compute-based allowance that refreshes every five hours under a weekly cap, with no images-per-day figure (Gemini subscription plans). ChatGPT plans are likewise separate from OpenAI API billing. If you need predictable cost per image in an app, the API tables above are the numbers to budget with.
Quality vs Price: Arena Score per Cent for Each Image API
A higher price buys a higher leaderboard score only up to a point. Dividing each model's Arena score by its price in cents shows where the money goes furthest; Nano Banana 2.1 and FLUX.2 [pro] come out on top, and GPT Image 2.5 beats them both if its medium setting is good enough for you.
LM Arena and Artificial Analysis image leaderboards in October 2026
On the LM Arena text-to-image leaderboard dated October 7, 2026 (6.6 million votes), the top of the table is:
| Rank | Arena entry | Score |
|---|---|---|
| 1 | gpt-image-2.5-sunburst | 1425 (preliminary) |
| 2 | gpt-image-2.5-flare | 1398 (preliminary) |
| 3 | gpt-image-2 (medium) | 1383 |
| 4 | grok-imagine-image-2.0 (canvas) | 1334 (preliminary) |
| 5 | mai-image-2.6 | 1332 |
| 6 | gemini-nano-banana-2.1 | 1328 (preliminary) |
| 7 | reve-2.1 | 1302 |
| 12 | seedream-5.0-pro | 1255 |
| 13 | qwen-image-3.0-pro | 1255 |
| 16 | gemini-3-pro-image-2k | 1248 |
| 17 | gpt-image-1.5 | 1237 |
| 20 | ideogram-4.0-quality | 1205 |
| 29 | flux-2-max | 1162 |
| 32 | flux-2-pro | 1153 |
| 35 | hunyuan-image-3.0 | 1150 |
Arena also lists a dated grok-imagine-image-2.0 (20260801) entry at 1294 (rank 8). The Artificial Analysis text-to-image leaderboard also puts the three OpenAI models first, on its own scale: GPT Image 2.5 Sunburst 1198, Flare 1191, GPT Image 2 1172, Nano Banana 2.1 1160, Grok Imagine 2.0 1156 and FLUX 3 Image 1117. Artificial Analysis lists the 2.5 models at max quality.
Scores from earlier leaderboard snapshots, such as the "Elo 1,264" figures quoted for GPT Image 1.5 in early 2026, can't be mixed with these numbers. Both leaderboards measure general preference across many prompts; they don't isolate text accuracy, product photography or editing.
The Value Efficiency Formula
Value efficiency = Arena score ÷ price per image in cents. It is a rough ratio, not a quality measure, and it rewards cheap models heavily. Use it to shortlist, then test.
| Model | Arena score | Price used | Score per cent |
|---|---|---|---|
| GPT Image 2.5 Sunburst, medium | 1425 | ~$0.0132 | 1,080 |
| Nano Banana 2.1, 1K | 1328 | $0.0336 | 395 |
| FLUX.2 [pro] | 1153 | $0.03 | 384 |
| Grok Imagine Image 2.0 | 1294–1334 | $0.04 | 324–334 |
| Qwen Image 3.0 Pro, 1k | 1255 | $0.04 | 314 |
| Seedream 5.0 Pro, up to 1.5K | 1255 | $0.045 | 279 |
| GPT Image 2.5 Sunburst, high | 1425 | ~$0.0527 | 270 |
| GPT Image 2.5 Flare, high | 1398 | ~$0.0527 | 265 |
| GPT Image 2, medium | 1383 | $0.053 | 261 |
| FLUX.2 [max] | 1162 | $0.07 | 166 |
| Nano Banana Pro, 2K | 1248 | $0.134 | 93 |
Example: 1328 ÷ 3.36 = 395 for Nano Banana 2.1. Arena doesn't state which quality setting its GPT Image 2.5 entries used, so the table shows the 2.5 models at both medium and high price. The Grok range covers the two Arena entries. On Google's Batch API, Nano Banana 2.1 doubles to 790.
Finding Your Sweet Spot: When the Top Score Is Worth Paying For
GPT Image 2.5 is both the top-scoring model and, at medium quality, one of the cheapest; start there if your images look right at medium. Pay for high (~$0.053) only for images people will look at closely, such as hero shots or product pages. Nano Banana 2.1 gives near-top scores at $0.0336, or $0.0168 on Batch, which makes it the default for bulk work at 1K. Nano Banana Pro scores lower than 2.1 on Arena at four times the 1K price, so choose it for a specific strength you've confirmed on your own prompts rather than for general quality.
How to Cut Your Image API Costs: Batch, Quality and Resolution
Three settings change the bill more than switching vendors: batch mode, the quality setting and the output size.
Use batch pricing for anything that can wait. Google's Batch API halves every Nano Banana price, and OpenAI's Batch API halves the price of GPT Image output tokens. Batch jobs run asynchronously, so they suit catalog backfills, nightly content jobs and dataset generation, not interactive features.
Pick the lowest quality setting that passes. On GPT Image 2, high costs about 35 times low at 1024² ($0.211 vs $0.006); on GPT Image 2.5, high costs four times medium. Run a fixed set of your own prompts at each setting and compare how many results you'd actually use.
Generate at the size you display. Nano Banana 2.1 goes from $0.0336 at 1K to $0.113 at 4K, and FLUX 3 Image from $0.048 at 1k to $0.607 at 4k. If your page shows 1,024-pixel images, a 4K render is wasted money. Nano Banana Pro is the exception: 1K and 2K both cost $0.134, so take the 2K.
Count cost per usable image, not per call. Rerolls and failed generations are part of the price. Seedream on BytePlus doesn't bill failed or moderated images; token-billed models do bill whatever they produce. Caching results for repeated prompts also removes calls you've already paid for once.
Best AI Image API by Use Case
E-commerce product images. Draft and variant images on Nano Banana 2.1 ($0.0336, or $0.0168 on Batch); final hero shots on GPT Image 2.5 Sunburst at high quality (~$0.053). For editing an existing product photo, the GPT Image 2.5 models, Nano Banana models, FLUX.2 [pro] (editing from $0.045) and SeedEdit 3.0 ($0.03) all accept input images.
Marketing and social content. Grok Imagine Image 2.0 ($0.04), Seedream 5.0 Pro ($0.045) and Qwen Image 3.0 Pro ($0.04) sit in the Arena top 13 at similar prices; test two of them against GPT Image 2.5 medium (~$0.013), which scores higher and costs less.
Logos, icons and text-heavy layouts. Recraft V4.1 can return vector output ($0.08), which you can edit afterward instead of regenerating. For raster images with text, the leaderboards don't measure text accuracy separately, so test the top models on your own copy; the Nano Banana Pro pricing guide compares Pro with 2.1 on exact text.
High-volume automated generation. At 100,000 images a month, GPT Image 2 low ($600), Recraft V4.1 Flash ($700), GPT Image 2.5 medium (~$1,320) and Nano Banana 2.1 Batch ($1,680) are the realistic first-party options. Seedream 5.0 Flash ($1,800) is the next step up.
Self-hosting or near-zero budget. FLUX.2 [dev] and FLUX.1 [schnell] are open weights. Run them yourself or use a host; see the free AI image generation API comparison for the free daily allowances.
Getting Started: Quick Integration Guide

This chart predates the October 10, 2026 update: Imagen 4 and gpt-image-1 are retired or retiring, Google has no free image API tier, and the "50–80% below official pricing" line no longer applies. The code and text below are current.
All three approaches below use an API key and a REST call. The samples show the request shape with current model IDs; they were not executed for this update, so check the response against each vendor's API reference before you ship.
OpenAI GPT Image 2.5: Setup and Code
Create an API key in the OpenAI platform dashboard and install the openai Python package. GPT Image models return base64 image data, and the response includes token usage you can compare with your cost estimate.
import base64
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY
result = client.images.generate(
model="gpt-image-2.5-sunburst",
prompt="A product photo of wireless earbuds on white marble",
quality="medium",
size="1024x1024",
)
with open("earbuds.png", "wb") as f:
f.write(base64.b64decode(result.data[0].b64_json))
print(result.usage)Use the full ID gpt-image-2.5-sunburst or gpt-image-2.5-flare. Set quality and size explicitly; leaving them on auto makes the cost per image hard to predict. OpenAI image generation guide.
Google Nano Banana 2.1: Setup and Code
Create a key in Google AI Studio and install google-genai. Image models are called through generate_content, not the old Imagen generate_images method, and need a project on a paid tier.
from google import genai
client = genai.Client() # reads GEMINI_API_KEY
response = client.models.generate_content(
model="gemini-nano-banana-2.1",
contents="A product photo of wireless earbuds on white marble",
)
for part in response.candidates[0].content.parts:
if part.inline_data:
with open("earbuds.png", "wb") as f:
f.write(part.inline_data.data)Code that still calls imagen-4.0-generate-001 stopped working on the Gemini API on August 17, 2026. For limits and what the free key does cover, see Gemini API free tier limits.
OpenAI-Compatible Gateways: One Key for Several Models
Several platforms expose many image models behind an OpenAI-style endpoint, so the OpenAI SDK works with a different base_url and the gateway's model ID. The trade-offs: model IDs and parameters differ from the vendor's own, billing may be a flat per-call price instead of tokens or resolution tiers, and new vendor features can arrive later. Compare the gateway's per-call price with the vendor's price at the quality and size you actually use.
from openai import OpenAI
client = OpenAI(
api_key="YOUR_GATEWAY_KEY",
base_url="https://YOUR_GATEWAY_HOST/v1",
)
result = client.images.generate(
model="MODEL_ID_FROM_GATEWAY_DOCS",
prompt="A product photo of wireless earbuds on white marble",
)Whichever approach you choose, add retries with exponential backoff for rate-limit errors, log latency and cost per request, and keep a second model configured so a vendor outage or a model shutdown doesn't stop your pipeline.
FAQ: AI Image Generation API Questions Answered
Which AI API is best for image generation?
For overall quality in October 2026, GPT Image 2.5 Sunburst: it leads both LM Arena (1425) and Artificial Analysis (1198). For quality per dollar, Nano Banana 2.1 at $0.0336 per 1K image ($0.0168 on Batch) ranks sixth on Arena. The best API for your project is the one that produces the most usable images per dollar on your own prompts.
What is the cheapest image generation API?
Among first-party APIs, GPT Image 2 or 2.5 at low quality (about $0.006 per 1024×1024 image) and Recraft V4.1 Flash ($0.007). Of the Arena top ten, GPT Image 2.5 at medium (~$0.013) and Nano Banana 2.1 on Batch ($0.0168) are the cheapest options with published prices. Hosted open-weights FLUX.1 [schnell] on Replicate costs about $0.003, and Cloudflare Workers AI has a free daily allowance.
How much does the GPT Image 2.5 API cost?
$5 per million text input tokens, $8 per million image input tokens and $30 per million image output tokens, for both Sunburst and Flare. A 1024×1024 image comes to about $0.006 at low, $0.013 at medium, $0.053 at high, $0.094 at xhigh and $0.211 at max quality, before the prompt. Batch halves the output-token price. Details: GPT Image 2.5 Sunburst pricing.
What is Gemini 3 Pro Image API pricing?
Gemini 3 Pro Image (Nano Banana Pro, gemini-3-pro-image) costs $0.134 per image at 1K or 2K and $0.24 at 4K, or $0.067 and $0.12 on the Batch API. There is no free API tier. See Gemini 3 Pro Image API pricing for per-tier detail.
Is the Google Imagen 4 API still available, and is it free?
No on both counts for the Gemini API: Imagen 4 Fast, Standard and Ultra shut down there on August 17, 2026, and Google names gemini-nano-banana-2.1 as the replacement. None of Google's current image models has a free API tier.
How much does it cost to generate 10,000 AI images per month?
At list prices, about $60 on GPT Image 2 low, $132 on GPT Image 2.5 medium, $168 on Nano Banana 2.1 Batch, $336 on Nano Banana 2.1 standard, $527 on GPT Image 2.5 high and $1,340 on Nano Banana Pro. The full table is under Volume Cost Projections above.
Can I switch between AI image APIs without rewriting my code?
Partly. OpenAI-style endpoints let you swap base_url, key and model ID, but Google's own SDK uses generate_content with a different response shape, and parameters such as quality, size, aspect ratio and reference images differ by vendor. A thin wrapper function around your image calls keeps a switch to a few lines.
What are the rate limits for AI image generation APIs?
Limits are set per account and per model, and each vendor shows them in its console: Google in AI Studio for your project, OpenAI in your organization's limits settings. The old "15 requests per minute free" figure for Google image models doesn't apply, because image models have no free tier.
Making Your Choice: Test Two Models on Your Own Prompts
GPT Image 2.5 leads on quality and is cheap at medium quality; Nano Banana 2.1 is the value pick, especially on Batch; Nano Banana Pro costs $0.134, four times 2.1 at 1K. If you still run gpt-image-1, it stops working on October 23, 2026, and gpt-image-1.5 and gpt-image-1-mini follow on December 1.
Pick two candidates from the tables above, run 50 to 100 of your real prompts through each at the quality and size you'll ship, and divide the bill by the number of images you'd actually use. That figure, not the list price, is what to compare. Prices and leaderboard positions move every few weeks, so recheck the vendor pricing pages before a large commitment.
Sources15
External pages this guide links to, in the order they appear. Last updated Oct 10, 2026.
Sources15
External pages this guide links to, in the order they appear. Last updated Oct 10, 2026.
- 1.LM Arena text-to-image leaderboardarena.ai/leaderboard/text-to-image
- 2.Gemini API pricing pageai.google.dev/gemini-api/docs/pricing
- 3.BFL API pricingdocs.bfl.ai/quick_start/pricing
- 4.BytePlus ModelArk pricingdocs.byteplus.com/en/docs/ModelArk/1544106
- 5.xAI model listdocs.x.ai/docs/models
- 6.Alibaba Cloud Model Studio pricingalibabacloud.com/help/en/model-studio/model-pricing
- 7.Recraft API pricingrecraft.ai/docs/api-reference/pricing
- 8.Stability AI platform pricingplatform.stability.ai/pricing
- 9.Ideogram's pricing pageideogram.ai/pricing
- 10.OpenAI deprecations pagedevelopers.openai.com/api/docs/deprecations
- 11.Gemini API deprecations pageai.google.dev/gemini-api/docs/deprecations
- 12.OpenAI image generation pricingdevelopers.openai.com/api/docs/pricing
- 13.OpenAI image generation guidedevelopers.openai.com/api/docs/guides/image-generation
- 14.Gemini subscription plansgemini.google/us/subscriptions
- 15.Artificial Analysis text-to-image leaderboardartificialanalysis.ai/image/leaderboard/text-to-image





