Text to image

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]

FLUX.1 [schnell]

$0.0036

The fastest and cheapest FLUX: 1–4 steps, for drafts and previews.

Text to imageper megapixel
Example: FLUX.1 [dev]

FLUX.1 [dev]

$0.03

FLUX.1 dev: high-quality text-to-image generation.

Text to imageper megapixel
Example: FLUX 2

FLUX 2

$0.0144

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

Text to imageper megapixel
Example: FLUX 2 Flash

FLUX 2 Flash

$0.006

Fast FLUX 2 for high-volume generation.

Text to imageper megapixel
Example: Nano Banana

Nano Banana

$0.024

Gemini Image from Google: generation and edits that keep fine detail.

Text to imageper image
Example: Nano Banana 2

Nano Banana 2

$0.048

Second generation of Gemini Image.

Text to imageper image
Example: Nano Banana Pro

Nano Banana Pro

$0.108

The Gemini Image flagship: infographics, text, 2K–4K.

Text to imageper image
Example: Seedream 4.5

Seedream 4.5

$0.039

Seedream 4.5 from ByteDance: generation up to 4K.

Text to imageper image
Example: MiniMax H3 Image

MiniMax H3 Image

$0.0297

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

Text to imageper image
Example: MiniMax H3 Image Highspeed

MiniMax H3 Image Highspeed

$0.0484

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

Text to imageper image
Example: Nano Banana 2.1

Nano Banana 2.1

$0.024

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

Text to imageper image
Example: Seedream 5 Pro

Seedream 5 Pro

$0.042

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

Text to imageper image
Example: GPT Image 2

GPT Image 2

$0.036

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

Text to imageper image
Example: Ideogram V3

Ideogram V3

$0.021

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

Text to imageper image
Example: Grok Imagine Image 2

Grok Imagine Image 2

$0.024

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

Text to imageper image
Example: Qwen Image 3.0 Pro

Qwen Image 3.0 Pro

$0.0384

Alibaba Qwen Image 3.0 Pro: strong prompt following and text in Chinese and English, 1K or 2K.

Text to imageper image

Flux 3 Klein

$0.0096

Black Forest Labs Flux 3 Klein: fast text to image at 1K, 2K or 4K, with optional prompt enhancement.

Text to imageper image

Flux 2 Pro

$0.03

Black Forest Labs Flux 2 Pro: high-quality photorealistic text to image at 1K or 2K.

Text to imageper image

Flux 2 Flex

$0.084

Black Forest Labs Flux 2 Flex: photorealistic text to image at 1K or 2K.

Text to imageper image

Imagen 4

$0.048

Google Imagen 4: text to image with an optional negative prompt, in five aspect ratios.

Text to imageper image

Imagen 4 Fast

$0.024

Google Imagen 4 Fast: the quicker Imagen 4 tier for text to image.

Text to imageper image

Imagen 4 Ultra

$0.072

Google Imagen 4 Ultra: the highest-quality Imagen 4 tier for text to image.

Text to imageper image

Nano Banana 2 Lite

$0.024

Google Nano Banana 2 Lite: text to image with up to 10 optional reference images, one 1K JPEG per request.

Text to imageper image

GPT Image 1.5

$0.024

OpenAI GPT Image 1.5: text to image in 1:1, 2:3 or 3:2, medium or high quality.

Text to imageper image

GPT Image 2.5 Flare

$0.036

OpenAI GPT Image 2.5 Flare: text to image at 1K, 2K or 4K from prompts of up to 20,000 characters.

Text to imageper image

GPT Image 2.5 Sunburst

$0.036

OpenAI GPT Image 2.5 Sunburst: text to image at 1K, 2K or 4K from prompts of up to 20,000 characters.

Text to imageper image

GPT Image 2.6 Economy

$0.03

OpenAI GPT Image 2.6 Economy: the cost-efficient GPT Image 2.6 variant, one 1K PNG per request.

Text to imageper image

Grok Imagine Image

$0.024

xAI Grok Imagine: text to image; speed mode returns two images, quality mode favours precision.

Text to imageper image

Kling Image 4.0

$0.0678

Kuaishou Kling Image 4.0: text to image at 2K, 4K or 8K.

Text to imageper image

Qwen Image 2

$0.0336

Alibaba Qwen Image 2: text to image in five aspect ratios.

Text to imageper image

Qwen Image 2.1

$0.024

Alibaba Qwen Image 2.1: text to image at 1K or 2K with optional prompt rewriting.

Text to imageper image

Qwen Image 3.0

$0.0288

Alibaba Qwen Image 3.0: text to image at 1K or 2K with negative prompts and prompt rewriting.

Text to imageper image

Wan 2.7 Image

$0.0288

Alibaba Wan 2.7 Image: text to image, or editing with up to 9 input images, at 1K or 2K.

Text to imageper image

Wan 2.7 Image Pro

$0.072

Alibaba Wan 2.7 Image Pro: text to image up to 4K, or editing with up to 9 input images.

Text to imageper image

Z-Image

$0.0048

Alibaba Z-Image: fast text to image in five aspect ratios, PNG output.

Text to imageper image

Seedream 5.5

$0.0216

ByteDance Seedream 5.5: text to image at 1K, 1.5K, 2K or 3K.

Text to imageper image

Seedream 5 Flash

$0.0194

ByteDance Seedream 5 Flash: fast text to image at 1K, 1.5K or 2K.

Text to imageper image

Seedream 5.0 Lite

$0.033

ByteDance Seedream 5.0 Lite: text to image in 2K (basic), 3K (high) or 4K (ultra).

Text to imageper image

Seedream 4.0

$0.03

ByteDance Seedream 4.0: text to image at 1K, 2K or 4K in nine size presets.

Text to imageper image

Seedream 3.0

$0.021

ByteDance Seedream 3.0: text to image in six size presets with adjustable prompt guidance.

Text to imageper image

GPT-4o Image

$0.036

OpenAI GPT-4o Image: accurate text in images and prompt following, in 1:1, 3:2 or 2:3.

Text to imageper image

FLUX.1 Kontext Pro

$0.03

Black Forest Labs FLUX.1 Kontext Pro: images with readable text and consistent style.

Text to imageper image

FLUX.1 Kontext Max

$0.06

Black Forest Labs FLUX.1 Kontext Max: images with readable text and consistent style.

Text to imageper image
ModelTaskImage4K 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: models

First 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