Text to image API
Every model on MegaBrain that generates an image from a text prompt, from fast FLUX drafts to infographics and 4K in Nano Banana Pro. Generate in the browser playground or through the API on one key, paid per image or per megapixel from a prepaid US-dollar balance.
The short answer
MegaBrain runs 43 text-to-image models on one API key: FLUX.1 [schnell], FLUX.1 [dev], FLUX 2, FLUX 2 Flash, Nano Banana, Nano Banana 2, Nano Banana Pro, Seedream 4.5, MiniMax H3 Image, MiniMax H3 Image Highspeed, Nano Banana 2.1, Seedream 5 Pro, GPT Image 2, Ideogram V3, Grok Imagine Image 2, Qwen Image 3.0 Pro, Flux 3 Klein, Flux 2 Pro, Flux 2 Flex, Imagen 4, Imagen 4 Fast, Imagen 4 Ultra, Nano Banana 2 Lite, GPT Image 1.5, GPT Image 2.5 Flare, GPT Image 2.5 Sunburst, GPT Image 2.6 Economy, Grok Imagine Image, Kling Image 4.0, Qwen Image 2, Qwen Image 2.1, Qwen Image 3.0, Wan 2.7 Image, Wan 2.7 Image Pro, Z-Image, Seedream 5.5, Seedream 5 Flash, Seedream 5.0 Lite, Seedream 4.0, Seedream 3.0, GPT-4o Image, FLUX.1 Kontext Pro and FLUX.1 Kontext Max. At default settings the lowest price is FLUX.1 [schnell] at $0.0036 per megapixel (a 1024×768 image is one megapixel); the highest is Nano Banana Pro at $0.108 per image. Prices are in US dollars from the live MegaBrain catalogue; a job the provider fails is refunded in full.
Text-to-image models and prices
Prices in US dollars from the MegaBrain catalogue; they update automatically. Each model’s page has examples, every parameter and a playground.
![Example: FLUX.1 [schnell]](/media-previews/flux-schnell.webp)
FLUX.1 [schnell]
$0.0036The fastest and cheapest FLUX: 1–4 steps, for drafts and previews.
![Example: FLUX.1 [dev]](/media-previews/flux-dev.webp)
FLUX.1 [dev]
$0.03FLUX.1 dev: high-quality text-to-image generation.

FLUX 2
$0.0144FLUX 2 from Black Forest Labs: photorealism and accurate text in images.

FLUX 2 Flash
$0.006Fast FLUX 2 for high-volume generation.

Nano Banana
$0.024Gemini Image from Google: generation and edits that keep fine detail.

Nano Banana 2
$0.048Second generation of Gemini Image.

Nano Banana Pro
$0.108The Gemini Image flagship: infographics, text, 2K–4K.

Seedream 4.5
$0.039Seedream 4.5 from ByteDance: generation up to 4K.

MiniMax H3 Image
$0.0297MiniMax’s open-weight model: native 4K (4096×4096) in about 15 seconds, prompts up to 20,000 characters.

MiniMax H3 Image Highspeed
$0.0484Native 4K (4096×4096) in about 9 seconds: the fast mode of H3 Image.

Nano Banana 2.1
$0.024Google's Nano Banana 2.1: text to image and editing with up to 10 reference images, 1K to 4K.

Seedream 5 Pro
$0.042ByteDance Seedream 5 Pro: photoreal images and text in images, 1K (basic) or 2K (high).

GPT Image 2
$0.036OpenAI GPT Image 2: precise text rendering and layouts, 1K to 4K.

Ideogram V3
$0.021Ideogram V3: typography, posters and logos; Turbo, Balanced or Quality rendering.

Grok Imagine Image 2
$0.024xAI Grok Imagine Image 2.0: fast, vivid text to image.

Qwen Image 3.0 Pro
$0.0384Alibaba Qwen Image 3.0 Pro: strong prompt following and text in Chinese and English, 1K or 2K.
Flux 3 Klein
$0.0096Black Forest Labs Flux 3 Klein: fast text to image at 1K, 2K or 4K, with optional prompt enhancement.
Flux 2 Pro
$0.03Black Forest Labs Flux 2 Pro: high-quality photorealistic text to image at 1K or 2K.
Flux 2 Flex
$0.084Black Forest Labs Flux 2 Flex: photorealistic text to image at 1K or 2K.
Imagen 4
$0.048Google Imagen 4: text to image with an optional negative prompt, in five aspect ratios.
Imagen 4 Fast
$0.024Google Imagen 4 Fast: the quicker Imagen 4 tier for text to image.
Imagen 4 Ultra
$0.072Google Imagen 4 Ultra: the highest-quality Imagen 4 tier for text to image.
Nano Banana 2 Lite
$0.024Google Nano Banana 2 Lite: text to image with up to 10 optional reference images, one 1K JPEG per request.
GPT Image 1.5
$0.024OpenAI GPT Image 1.5: text to image in 1:1, 2:3 or 3:2, medium or high quality.
GPT Image 2.5 Flare
$0.036OpenAI GPT Image 2.5 Flare: text to image at 1K, 2K or 4K from prompts of up to 20,000 characters.
GPT Image 2.5 Sunburst
$0.036OpenAI GPT Image 2.5 Sunburst: text to image at 1K, 2K or 4K from prompts of up to 20,000 characters.
GPT Image 2.6 Economy
$0.03OpenAI GPT Image 2.6 Economy: the cost-efficient GPT Image 2.6 variant, one 1K PNG per request.
Grok Imagine Image
$0.024xAI Grok Imagine: text to image; speed mode returns two images, quality mode favours precision.
Kling Image 4.0
$0.0678Kuaishou Kling Image 4.0: text to image at 2K, 4K or 8K.
Qwen Image 2
$0.0336Alibaba Qwen Image 2: text to image in five aspect ratios.
Qwen Image 2.1
$0.024Alibaba Qwen Image 2.1: text to image at 1K or 2K with optional prompt rewriting.
Qwen Image 3.0
$0.0288Alibaba Qwen Image 3.0: text to image at 1K or 2K with negative prompts and prompt rewriting.
Wan 2.7 Image
$0.0288Alibaba Wan 2.7 Image: text to image, or editing with up to 9 input images, at 1K or 2K.
Wan 2.7 Image Pro
$0.072Alibaba Wan 2.7 Image Pro: text to image up to 4K, or editing with up to 9 input images.
Z-Image
$0.0048Alibaba Z-Image: fast text to image in five aspect ratios, PNG output.
Seedream 5.5
$0.0216ByteDance Seedream 5.5: text to image at 1K, 1.5K, 2K or 3K.
Seedream 5 Flash
$0.0194ByteDance Seedream 5 Flash: fast text to image at 1K, 1.5K or 2K.
Seedream 5.0 Lite
$0.033ByteDance Seedream 5.0 Lite: text to image in 2K (basic), 3K (high) or 4K (ultra).
Seedream 4.0
$0.03ByteDance Seedream 4.0: text to image at 1K, 2K or 4K in nine size presets.
Seedream 3.0
$0.021ByteDance Seedream 3.0: text to image in six size presets with adjustable prompt guidance.
GPT-4o Image
$0.036OpenAI GPT-4o Image: accurate text in images and prompt following, in 1:1, 3:2 or 2:3.
FLUX.1 Kontext Pro
$0.03Black Forest Labs FLUX.1 Kontext Pro: images with readable text and consistent style.
FLUX.1 Kontext Max
$0.06Black Forest Labs FLUX.1 Kontext Max: images with readable text and consistent style.
| Model | Task | Image | 4K image |
|---|---|---|---|
| FLUX.1 [schnell] flux/schnell | Text to image | $0.0036 per megapixel | — |
| FLUX.1 [dev] flux/dev | Text to image | $0.03 per megapixel | — |
| FLUX 2 flux-2 | Text to image | $0.0144 per megapixel | — |
| FLUX 2 Flash flux-2/flash | Text to image | $0.006 per megapixel | — |
| Nano Banana nano-banana | Text to image | $0.024 | — |
| Nano Banana 2 nano-banana-2 | Text to image | $0.048 | $0.108 |
| Nano Banana Pro nano-banana-pro | Text to image | $0.108 | $0.144 |
| Seedream 4.5 bytedance/seedream/v4.5/text-to-image | Text to image | $0.039 | — |
| MiniMax H3 Image minimax/h3-image | Text to image | $0.0297 | — |
| MiniMax H3 Image Highspeed minimax/h3-image/highspeed | Text to image | $0.0484 | — |
| Nano Banana 2.1 google/nano-banana-2.1 | Text to image | $0.024 | — |
| Seedream 5 Pro bytedance/seedream-5-pro | Text to image | $0.042 | — |
| GPT Image 2 openai/gpt-image-2 | Text to image | $0.036 | — |
| Ideogram V3 ideogram/v3 | Text to image | $0.021 | — |
| Grok Imagine Image 2 xai/grok-imagine-image-2 | Text to image | $0.024 | — |
| Qwen Image 3.0 Pro qwen/image-3-pro | Text to image | $0.0384 | — |
| Flux 3 Klein black-forest-labs/flux-3-klein | Text to image | $0.0096 | — |
| Flux 2 Pro black-forest-labs/flux-2-pro | Text to image | $0.03 | — |
| Flux 2 Flex black-forest-labs/flux-2-flex | Text to image | $0.084 | — |
| Imagen 4 google/imagen-4 | Text to image | $0.048 | — |
| Imagen 4 Fast google/imagen-4-fast | Text to image | $0.024 | — |
| Imagen 4 Ultra google/imagen-4-ultra | Text to image | $0.072 | — |
| Nano Banana 2 Lite google/nano-banana-2-lite | Text to image | $0.024 | — |
| GPT Image 1.5 openai/gpt-image-1.5 | Text to image | $0.024 | — |
| GPT Image 2.5 Flare openai/gpt-image-2.5-flare | Text to image | $0.036 | — |
| GPT Image 2.5 Sunburst openai/gpt-image-2.5-sunburst | Text to image | $0.036 | — |
| GPT Image 2.6 Economy openai/gpt-image-2.6-economy | Text to image | $0.03 | — |
| Grok Imagine Image xai/grok-imagine-image | Text to image | $0.024 | — |
| Kling Image 4.0 kling-image/v4 | Text to image | $0.0678 | — |
| Qwen Image 2 qwen/image-2 | Text to image | $0.0336 | — |
| Qwen Image 2.1 qwen/image-2.1 | Text to image | $0.024 | — |
| Qwen Image 3.0 qwen/image-3 | Text to image | $0.0288 | — |
| Wan 2.7 Image alibaba/wan-2.7-image | Text to image | $0.0288 | — |
| Wan 2.7 Image Pro alibaba/wan-2.7-image-pro | Text to image | $0.072 | — |
| Z-Image alibaba/z-image | Text to image | $0.0048 | — |
| Seedream 5.5 bytedance/seedream-5.5 | Text to image | $0.0216 | — |
| Seedream 5 Flash bytedance/seedream-5-flash | Text to image | $0.0194 | — |
| Seedream 5.0 Lite bytedance/seedream-5-lite | Text to image | $0.033 | — |
| Seedream 4.0 bytedance/seedream-4 | Text to image | $0.03 | — |
| Seedream 3.0 bytedance/seedream-3 | Text to image | $0.021 | — |
| GPT-4o Image openai/gpt-4o-image | Text to image | $0.036 | — |
| FLUX.1 Kontext Pro black-forest-labs/flux-kontext-pro | Text to image | $0.03 | — |
| FLUX.1 Kontext Max black-forest-labs/flux-kontext-max | Text to image | $0.06 | — |
Which model to pick
FLUX.1 [schnell] and FLUX 2 Flash are for drafts and high volume. FLUX 2 does photorealism and accurate text. Nano Banana Pro does infographics, lettering and 4K. Seedream 4.5 and MiniMax H3 Image generate up to 4K.
Per image or per megapixel
FLUX models are priced per megapixel of output: a 1024×768 image is one megapixel. The others are priced per image, and Nano Banana’s price depends on the resolution. A failed generation is not charged.
Editing existing images
To change an image you already have, such as replacing the background or putting a product in a scene, use the image editing models.
Image editing: modelsFirst request
Generation runs through a queue: a POST request submits the job, then the script polls status_url and fetches the result from response_url. Create the key on the API key page after you sign up.
import os, time, requests
BASE = "https://getmegabrain.com/api/gateway/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MEGABRAIN_API_KEY']}"}
job = requests.post(f"{BASE}/queue/nano-banana-pro", headers=HEADERS, json={
"prompt": "wooden matryoshka dolls on a frosty windowsill, soft morning light, photo"
}).json()
while requests.get(job["status_url"], headers=HEADERS).json()["status"] not in ("COMPLETED", "FAILED"):
time.sleep(2)
print(requests.get(job["response_url"], headers=HEADERS).json())Questions and answers
How much does text-to-image generation cost through an API?
MegaBrain runs 43 text-to-image models on one API key: FLUX.1 [schnell], FLUX.1 [dev], FLUX 2, FLUX 2 Flash, Nano Banana, Nano Banana 2, Nano Banana Pro, Seedream 4.5, MiniMax H3 Image, MiniMax H3 Image Highspeed, Nano Banana 2.1, Seedream 5 Pro, GPT Image 2, Ideogram V3, Grok Imagine Image 2, Qwen Image 3.0 Pro, Flux 3 Klein, Flux 2 Pro, Flux 2 Flex, Imagen 4, Imagen 4 Fast, Imagen 4 Ultra, Nano Banana 2 Lite, GPT Image 1.5, GPT Image 2.5 Flare, GPT Image 2.5 Sunburst, GPT Image 2.6 Economy, Grok Imagine Image, Kling Image 4.0, Qwen Image 2, Qwen Image 2.1, Qwen Image 3.0, Wan 2.7 Image, Wan 2.7 Image Pro, Z-Image, Seedream 5.5, Seedream 5 Flash, Seedream 5.0 Lite, Seedream 4.0, Seedream 3.0, GPT-4o Image, FLUX.1 Kontext Pro and FLUX.1 Kontext Max. At default settings the lowest price is FLUX.1 [schnell] at $0.0036 per megapixel (a 1024×768 image is one megapixel); the highest is Nano Banana Pro at $0.108 per image. Prices are in US dollars from the live MegaBrain catalogue; a job the provider fails is refunded in full.
Do I need an account with each model’s maker?
No. Sign up on MegaBrain, top up the balance by card and create one API key: it works for every model in the table, for the other image, video and audio models and for the text models.
How is generation paid for?
From a prepaid US-dollar balance at the price in the table, with no subscription. The price of a job is held when it is submitted and refunded in full if the provider fails it.
Can I generate 4K images?
Yes. Nano Banana Pro and Nano Banana 2 take resolution 4K, and Seedream 4.5 and MiniMax H3 Image generate up to 4K. Nano Banana’s 4K price is in the table.
Get your API key
Sign-up is open. Create an account, top up the balance by card and create a key: it works for every text, image, video and audio model in the catalogue. Credits never expire.
Questions? Write to team@getmegabrain.com