Questions this answers
- How much does best AI image generation API cost through an API?
- When should developers use best AI image generation API instead of a direct provider account?
- How does TokenLab help compare best AI image generation API with related models?
The best AI image generation API for most production teams in 2026 depends on three sourced factors: per-image or per-megapixel cost, editing capability, and how the model fits into an existing multimodal pipeline. Based on current provider pricing documentation, Black Forest Labs' FLUX.2 family and Google's Gemini image models cover most commercial use cases, with cost per image ranging from $0.014 to $0.07 depending on tier and resolution. This article compares sourced pricing across these providers, flags where independent quality or speed benchmarks are missing, and gives you a framework for testing models yourself instead of relying on vendor claims.
This is an image generation API comparison. Video generation (Google Veo) is referenced only for cost context where a pipeline needs both, not as a primary subject.
Key Takeaways
- FLUX.2 pricing scales from $0.014/image (Klein 4B) to $0.07/image (Max), based on Black Forest Labs' own pricing docs (observed 2026-07-08).
- Both BFL and fal.ai price FLUX.2 by megapixel, so output resolution directly drives cost, not just model tier.
- Fine-tuned FLUX.2 public beta endpoints bill at the same rate as their base endpoint, per BFL's pricing documentation (observed 2026-07-08).
- No GenEval, DPG-Bench, or independent latency benchmarks are included in this evidence set for FLUX.2, Gemini image models, or the TokenLab catalog. Any quality or speed ranking beyond vendor copy is not benchmarked here.
- Gemini image models (Gemini 3.1 Flash Image, Gemini 3 Pro Image) are priced per token in the TokenLab live snapshot, not per image, so cost depends on output token volume and must be measured per workload.
- Midjourney and Stability AI are excluded from the pricing tables below because their current API pricing structures are not in this evidence set (see the Limitations section).
Source Snapshot: Provider Pricing
All rows below are sourced directly from provider documentation.
| Provider | Model / Endpoint | Pricing Metric | Cost (USD) | Source | Observed |
|---|---|---|---|---|---|
| Black Forest Labs | FLUX.2 Klein 4B | Per image | $0.014 | BFL pricing docs | 2026-07-08 |
| Black Forest Labs | FLUX.2 Klein 9B | Per image | $0.015 | BFL pricing docs | 2026-07-08 |
| Black Forest Labs | FLUX.2 Pro (text-to-image) | Per image | $0.030 | BFL pricing docs | 2026-07-08 |
| Black Forest Labs | FLUX.2 Pro (editing) | Per image | $0.045 | BFL pricing docs | 2026-07-08 |
| Black Forest Labs | FLUX.2 Flex | Per image | $0.050 | BFL pricing docs | 2026-07-08 |
| Black Forest Labs | FLUX.2 Max | Per image | $0.070 | BFL pricing docs | 2026-07-08 |
| fal.ai | FLUX.2 dev | Per megapixel | $0.012/MP | fal FLUX.2 page | 2026-07-08 |
| fal.ai | FLUX.2 pro | Per megapixel | $0.030/MP | fal FLUX.2 page | 2026-07-08 |
| fal.ai | FLUX.2 flex | Per megapixel | $0.050/MP | fal FLUX.2 page | 2026-07-08 |
| fal.ai | FLUX.2 max | Per megapixel | $0.070/MP | fal FLUX.2 page | 2026-07-08 |
| Veo 3.1 Standard (audio) | Per second | $0.40 (720p/1080p), $0.60 (4K) | Gemini API pricing | 2026-07-08 | |
| Veo 3.1 Fast (audio) | Per second | $0.10 (720p), $0.12 (1080p), $0.30 (4K) | Gemini API pricing | 2026-07-08 | |
| Veo 3.1 Lite (audio) | Per second | $0.05 (720p), $0.08 (1080p), 4K unsupported | Gemini API pricing | 2026-07-08 |
Note: BFL uses a credit system where 1 credit equals $0.01 USD, and megapixel-based scaling means actual cost per call moves with output resolution, not just the base rate above.
TokenLab Live Model and Pricing Snapshot
This table is limited to models present in the TokenLab live model/pricing evidence block, observed 2026-07-07 (expires 2026-07-14). Prices here are TokenLab catalog prices, not inferred from provider list prices.
| Series | Model | Metric | Rate | Source | Observed |
|---|---|---|---|---|---|
| flux | flux-2-klein-4b | Per image | $0.014000 | TokenLab live pricing snapshot | 2026-07-07 |
| flux | flux-2-klein-9b | Per image | $0.015000 | TokenLab live pricing snapshot | 2026-07-07 |
| flux | flux-1-dev | Per image | $0.025000 | TokenLab live pricing snapshot | 2026-07-07 |
| flux | flux-1.1-pro | Per image | $0.040000 | TokenLab live pricing snapshot | 2026-07-07 |
| flux | flux-2-flex | Per image | $0.050000 | TokenLab live pricing snapshot | 2026-07-07 |
| flux | flux-pro-1.1-ultra | Per image | $0.060000 | TokenLab live pricing snapshot | 2026-07-07 |
| flux | flux-2-max | Per image | $0.070000 | TokenLab live pricing snapshot | 2026-07-07 |
| gemini-3 | gemini-3.1-flash-image | Per MTok (in/out) | $0.50 / $3.00 | TokenLab live pricing snapshot | 2026-07-07 |
| gemini-3 | gemini-3-pro-image | Per MTok (in/out) | $2.00 / $12.00 | TokenLab live pricing snapshot | 2026-07-07 |
| gemini-3 | gemini-3.1-flash-lite | Per MTok (in/out) | $0.25 / $1.50 | TokenLab live pricing snapshot | 2026-07-07 |
| veo-3 | veo3.1-fast | Per second | $0.080000 | TokenLab live pricing snapshot | 2026-07-07 |
| veo-3 | veo3.1 | Per second | $0.200000 | TokenLab live pricing snapshot | 2026-07-07 |
Gemini image models are priced per token, not per image, because output cost depends on how many image tokens the model emits for a given resolution and complexity. Do not assume a flat per-image cost for these two rows; measure actual token output on representative prompts before committing to a routing decision.
If you're already comparing token costs across text models for the same pipeline (for example routing a captioning or prompt-rewriting step to Gemini 3.5 Flash or DeepSeek V4 Flash before an image call), see the LLM API pricing comparison for current per-token rates across providers. That article is a written comparison, not an interactive tool, so treat it as a reference snapshot rather than a live calculator.
Deep Dive: Image Generation API Providers
Black Forest Labs (FLUX.2)
FLUX.2 is priced on a credit system (1 credit = $0.01) with megapixel-based scaling, per BFL's pricing docs (observed 2026-07-08). That means the base rates below are starting prices; a larger output resolution increases the per-call cost proportionally.
- FLUX.2 Klein 4B ($0.014/image): smallest model in the tier, positioned by BFL for high-volume, low-cost generation.
- FLUX.2 Klein 9B ($0.015/image): one cent more per image at the base tier. BFL's own materials position Klein 9B as an upgrade in anatomy and text rendering over Klein 4B, but this evidence set does not include a benchmark score (GenEval, DPG-Bench, or otherwise) to quantify that gap. Treat it as a vendor positioning claim until you run your own comparison on your prompt set.
- FLUX.2 Pro ($0.030/image text-to-image, $0.045/image editing): the general commercial tier, with a separate higher rate for inpainting, outpainting, and edit operations.
- FLUX.2 Flex ($0.050/image) and FLUX.2 Max ($0.070/image): the two premium tiers, positioned for complex prompt adherence and photorealism.
Fine-tuning: BFL's pricing documentation states that fine-tuned FLUX.2 public beta endpoints are billed at the same rate as their base endpoint (source: BFL pricing docs, observed 2026-07-08). This applies specifically to the public beta program as documented at that URL and date; confirm current terms in the docs before budgeting a fine-tuning project, since beta pricing terms can change.
Is FLUX.2 Max worth roughly 5x the cost of Klein 4B ($0.070 vs $0.014)? This evidence set has no quality benchmark to answer that directly. What we can say from pricing structure alone: the price ladder (Klein 4B, Klein 9B, Pro, Flex, Max) roughly doubles in cost at each of the first three steps, then increases more steeply for Flex and Max. If your use case is draft generation, thumbnails, or high-volume placeholder art, start at Klein and only move up the ladder if you can show a measurable quality or acceptance-rate improvement on your own eval set. See the Quality and Speed section below for a concrete test method.
fal.ai (FLUX.2 Hosting)
fal.ai hosts the FLUX.2 family with a strict pay-per-megapixel model (source: fal FLUX.2 page, observed 2026-07-08):
- FLUX.2 dev: from $0.012/MP
- FLUX.2 pro: from $0.030/MP
- FLUX.2 flex: from $0.050/MP
- FLUX.2 max: from $0.070/MP
fal's per-MP rates track closely with BFL's own tiers for pro, flex, and max, with dev priced slightly under Klein 4B for equivalent output. If you're already using fal for hosting or infrastructure reasons, the pricing gap versus calling BFL directly is small at these tiers; the decision is more about existing infrastructure fit than a meaningful cost delta.
Google Gemini Image Models
The TokenLab live snapshot includes two Gemini image-capable models: gemini-3.1-flash-image and gemini-3-pro-image, priced per token ($0.50/$3.00 and $2.00/$12.00 per MTok input/output respectively). In the current model naming used for this evidence window, these correspond to Gemini 3.1 Flash Image and Gemini 3 Pro Image in the imageApi catalog examples. Because pricing is per token rather than per image, your actual cost per generated image depends on output resolution and model verbosity in image tokens, both of which you should measure against your own prompt set rather than assume from the flagship text pricing of the same model family.
If your pipeline sends a multimodal request that mixes an image input with a text instruction (for example an edit-in-place workflow), the exact request schema, image encoding, and response format must be verified against Google's current Gemini API documentation before you write production code. This article does not include a verified multimodal payload example because the supplied evidence does not contain the exact endpoint and schema needed to guarantee correctness; using an unverified schema risks silent failures in production.
Other Catalog Models Not Yet in the Live Evidence Snapshot
The imageApi model set for this evidence window also references GPT Image 2, Reve 2.0, and MAI-Image-2.5 as current examples. None of these three appear in the TokenLab live pricing snapshot supplied for this article, so no TokenLab price is included here for them. If you need current pricing for those models, check the TokenLab model pricing page directly rather than relying on provider list prices, since TokenLab catalog rates are not always identical to provider rate cards.
Related: TokenLab migration guide covers how to move a production pipeline between model providers without breaking downstream consumers, which is relevant if you plan to add or swap image models as pricing or availability changes.
Why Midjourney and Stability AI Aren't in This Comparison
A common question when reading an image API pricing comparison is why Midjourney and Stability AI are missing. Midjourney's primary access model is subscription and Discord/web-based, not a documented pay-per-call API pricing structure comparable to BFL, fal.ai, or Google's per-image and per-megapixel rates, so it doesn't fit cleanly into a per-image cost table without separate verification of its API terms. Stability AI's current API pricing was not included in the evidence supplied for this article. Rather than estimate either provider's cost from memory or older pricing pages, this comparison is scoped to providers with sourced, dated pricing evidence. If you need Stability or Midjourney numbers, pull them directly from each provider's current pricing page before comparing to the table above.
Quality and Speed: What This Evidence Set Does Not Show
None of the pricing sources used for this article include GenEval, DPG-Bench, or independent latency measurements for FLUX.2 tiers, Gemini image models, or any other model in the tables above. That means claims like "Klein 9B has better anatomy" or "FLUX.2 Max produces more photorealistic output" are vendor positioning, not measured results, and this article will not present them as benchmarked fact.
If you need to justify a model choice with data, run this checklist against your own prompt distribution:
- Build a fixed prompt set (30 to 100 prompts) representative of your actual production use case, not generic demo prompts.
- Run the same prompt set across your candidate tiers (for example Klein 4B, Klein 9B, Pro, Max) and log wall-clock generation time per request, including retries.
- Score outputs with a structured harness (GenEval or DPG-Bench style rubric, or a human review panel with a fixed rubric) rather than eyeballing a handful of samples.
- Compute cost per accepted image, not cost per generated image: if a cheaper tier requires 2x more regenerations to get an acceptable result, its effective cost is higher than the sticker price.
- Repeat the same process for latency if your product has a real-time or near-real-time requirement; log P50 and P95, not just average.
This is the only reliable way to answer "is the more expensive tier worth it" for your specific workload. Generic marketing comparisons cannot answer that question for you.
Video Generation Cost Context
If your pipeline also needs video, not just images, Google Veo 3.1 pricing is in the Source Snapshot table above: Standard at $0.40 to $0.60 per second, Fast at $0.10 to $0.30 per second, and Lite at $0.05 to $0.08 per second, all excluding 4K on the Lite tier. Google Veo 3.0 models are deprecated and scheduled for shutdown on June 30, 2026, so any pipeline still on 3.0 needs to migrate to Veo 3.1 Preview or GA Agent Platform models before that date. Google's documentation also states that users are not charged if an audio processing issue prevents a video from generating successfully; you are only billed for successful generations. This is context, not the focus of this article; if video is your primary need, treat this as a starting reference and verify current Veo terms directly before building a production dependency.
Architecture Notes: Cost Control and Routing
Resolution scaling. Because BFL and fal.ai charge by megapixel, constrain user-selectable output dimensions in your front end to avoid unexpected billing spikes. A request that doubles both width and height roughly quadruples megapixel count and cost.
Async by default. Image and video generation are long-running operations. Avoid holding synchronous HTTP connections open. Use webhooks where the provider supports them, or an async polling queue (Redis, RabbitMQ, or a managed queue) with exponential backoff on poll retries.
Error handling for production calls. Whatever image API you integrate, plan explicitly for:
- 4xx errors (invalid prompt, unsupported resolution, content policy rejection): surface a clear user-facing message, do not retry automatically.
- 429 (rate limited): back off with jitter and retry within provider-documented limits; if you don't have the provider's exact rate-limit headers documented, poll conservatively rather than guessing.
- 5xx / 503 (provider outage): fail over to a secondary model tier or provider if your architecture supports it, and log the failure for cost reconciliation since you may or may not be billed depending on provider terms (Google, for example, states audio-related generation failures are not billed).
- Timeouts on long-running video jobs: use a job ID and poll or webhook pattern rather than a fixed-timeout synchronous call, since multi-second video generation can exceed typical HTTP client timeouts.
Model tiering. Route low-stakes or draft requests (placeholders, thumbnails, internal previews) to the cheapest viable tier (flux-2-klein-4b at $0.014/image, for example), and reserve premium tiers (flux-2-max at $0.070/image, or Gemini 3 Pro Image) for final, customer-facing assets. Validate this tiering against your own accepted-output rate, not just sticker price, using the checklist above.
For teams also orchestrating text models around image calls (prompt rewriting, moderation, captioning), see Enterprise model routing strategies for fallback patterns you can adapt from coding-agent routing to multimodal pipelines, and the Gemini 3.5 Flash integration guide if you're pairing a fast text model with an image generation step.
Limitations
- No independent quality benchmark (GenEval, DPG-Bench, or equivalent) is included in this evidence set for any model listed. All quality comparisons above are either vendor-stated or explicitly marked as unverified.
- No latency or throughput measurement is included in this evidence set. Speed claims in provider marketing (for example "Fast" tiers) are not independently verified here.
- Midjourney and Stability AI pricing is not in this evidence set and is excluded from the tables rather than estimated.
- GPT Image 2, Reve 2.0, and MAI-Image-2.5 are referenced as current catalog examples but have no corresponding TokenLab live pricing row in this snapshot; check the TokenLab pricing page directly for current rates.
- Gemini image model costs are per-token, and this article does not convert them to an estimated per-image cost, since output token count varies by resolution and prompt and would require measurement, not assumption.
- The BFL fine-tuning billing claim is sourced to a specific documentation page and observation date (2026-07-08); confirm current terms before budgeting, since beta program terms can change without updating this article.
Frequently Asked Questions
What is the best AI image generation API for commercial use? Based on sourced pricing, Black Forest Labs' FLUX.2 Pro and Max tiers and fal.ai's hosted FLUX.2 endpoints are the most fully documented options for commercial per-image billing. "Best" for your case depends on measured quality and acceptance rate on your own prompts, which this evidence set does not provide; use the checklist in the Quality and Speed section before committing.
How does megapixel-based pricing work? You pay based on total output pixels. At fal.ai's $0.030/MP FLUX.2 pro rate, a 1024x1024 image (about 1.05 MP) costs roughly $0.0315. A 512x512 image (about 0.26 MP) costs roughly $0.0079 at the same rate. Always confirm the current per-MP rate before estimating, since these are starting rates per the cited sources.
Is FLUX.2 Max worth 5x the cost of Klein 4B? Not benchmarked in this evidence set. The price gap is real ($0.070 vs $0.014 per image), but no GenEval, DPG-Bench, or comparable quality score is available here to justify the premium. Test both tiers on your own prompt distribution and compare cost per accepted image before deciding.
Are there any deprecated models to avoid? Yes, on the video side: Google Veo 3.0 models are deprecated and scheduled for shutdown on June 30, 2026. Migrate to Veo 3.1 Preview or GA Agent Platform models. This does not affect the image models covered as the primary subject of this article.
Why isn't Midjourney or Stability AI included? Their current API pricing structures are not in the evidence set used for this article. Midjourney's primary access model is subscription-based rather than a documented per-call API price comparable to the providers above. Check each provider's current pricing page directly if you need those numbers.
How are failed video generations billed on Google Veo? Per Google's documentation, if an audio processing issue prevents a video from generating, you are not charged. You're billed only for successfully generated output.
Related TokenLab Resources
- LLM API pricing comparison: current per-token rates across text model providers, useful when orchestrating a text step before or after an image call.
- Gemini 3.5 Flash integration guide: pairing a fast text model with multimodal or image generation steps.
- Enterprise model routing strategies: fallback and tiering patterns adaptable to image API routing.
- TokenLab migration guide: moving a production pipeline between providers without breaking downstream consumers.
Next Step
Before you commit budget to a single image API tier, pull current rates from the sourced tables above, run the quality and speed checklist against your own prompts, and confirm any fine-tuning or beta pricing terms directly in the provider's docs since those can change faster than this article is updated. For current per-token text model rates to pair with your image pipeline, see the LLM API pricing comparison.
Sources
Price observed 2026-07-07
- Black Forest Labs pricing docsObserved 2026-07-08
- fal FLUX.2 model pageObserved 2026-07-08
- Google AI Gemini API pricingObserved 2026-07-08
- TokenLab model directoryObserved 2026-07-07
- Replicate pricingObserved 2026-07-07
- fal pricingObserved 2026-07-07



