# Text to image API

https://getmegabrain.com/media/text-to-image · prices from the live MegaBrain catalogue

> 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.

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.

## Text-to-image models and prices

| Model | ID | Price |
|---|---|---|
| [FLUX.1 [schnell]](https://getmegabrain.com/media/flux/schnell) | `flux/schnell` | $0.0036 per megapixel |
| [FLUX.1 [dev]](https://getmegabrain.com/media/flux/dev) | `flux/dev` | $0.03 per megapixel |
| [FLUX 2](https://getmegabrain.com/media/flux-2) | `flux-2` | $0.0144 per megapixel |
| [FLUX 2 Flash](https://getmegabrain.com/media/flux-2/flash) | `flux-2/flash` | $0.006 per megapixel |
| [Nano Banana](https://getmegabrain.com/media/nano-banana) | `nano-banana` | $0.024 per image |
| [Nano Banana 2](https://getmegabrain.com/media/nano-banana-2) | `nano-banana-2` | $0.048 per image |
| [Nano Banana Pro](https://getmegabrain.com/media/nano-banana-pro) | `nano-banana-pro` | $0.108 per image |
| [Seedream 4.5](https://getmegabrain.com/media/bytedance/seedream/v4.5/text-to-image) | `bytedance/seedream/v4.5/text-to-image` | $0.039 per image |
| [MiniMax H3 Image](https://getmegabrain.com/media/minimax/h3-image) | `minimax/h3-image` | $0.0297 per image |
| [MiniMax H3 Image Highspeed](https://getmegabrain.com/media/minimax/h3-image/highspeed) | `minimax/h3-image/highspeed` | $0.0484 per image |
| [Nano Banana 2.1](https://getmegabrain.com/media/google/nano-banana-2.1) | `google/nano-banana-2.1` | $0.024 per image |
| [Seedream 5 Pro](https://getmegabrain.com/media/bytedance/seedream-5-pro) | `bytedance/seedream-5-pro` | $0.042 per image |
| [GPT Image 2](https://getmegabrain.com/media/openai/gpt-image-2) | `openai/gpt-image-2` | $0.036 per image |
| [Ideogram V3](https://getmegabrain.com/media/ideogram/v3) | `ideogram/v3` | $0.021 per image |
| [Grok Imagine Image 2](https://getmegabrain.com/media/xai/grok-imagine-image-2) | `xai/grok-imagine-image-2` | $0.024 per image |
| [Qwen Image 3.0 Pro](https://getmegabrain.com/media/qwen/image-3-pro) | `qwen/image-3-pro` | $0.0384 per image |
| [Flux 3 Klein](https://getmegabrain.com/media/black-forest-labs/flux-3-klein) | `black-forest-labs/flux-3-klein` | $0.0096 per image |
| [Flux 2 Pro](https://getmegabrain.com/media/black-forest-labs/flux-2-pro) | `black-forest-labs/flux-2-pro` | $0.03 per image |
| [Flux 2 Flex](https://getmegabrain.com/media/black-forest-labs/flux-2-flex) | `black-forest-labs/flux-2-flex` | $0.084 per image |
| [Imagen 4](https://getmegabrain.com/media/google/imagen-4) | `google/imagen-4` | $0.048 per image |
| [Imagen 4 Fast](https://getmegabrain.com/media/google/imagen-4-fast) | `google/imagen-4-fast` | $0.024 per image |
| [Imagen 4 Ultra](https://getmegabrain.com/media/google/imagen-4-ultra) | `google/imagen-4-ultra` | $0.072 per image |
| [Nano Banana 2 Lite](https://getmegabrain.com/media/google/nano-banana-2-lite) | `google/nano-banana-2-lite` | $0.024 per image |
| [GPT Image 1.5](https://getmegabrain.com/media/openai/gpt-image-1.5) | `openai/gpt-image-1.5` | $0.024 per image |
| [GPT Image 2.5 Flare](https://getmegabrain.com/media/openai/gpt-image-2.5-flare) | `openai/gpt-image-2.5-flare` | $0.036 per image |
| [GPT Image 2.5 Sunburst](https://getmegabrain.com/media/openai/gpt-image-2.5-sunburst) | `openai/gpt-image-2.5-sunburst` | $0.036 per image |
| [GPT Image 2.6 Economy](https://getmegabrain.com/media/openai/gpt-image-2.6-economy) | `openai/gpt-image-2.6-economy` | $0.03 per image |
| [Grok Imagine Image](https://getmegabrain.com/media/xai/grok-imagine-image) | `xai/grok-imagine-image` | $0.024 per image |
| [Kling Image 4.0](https://getmegabrain.com/media/kling-image/v4) | `kling-image/v4` | $0.0678 per image |
| [Qwen Image 2](https://getmegabrain.com/media/qwen/image-2) | `qwen/image-2` | $0.0336 per image |
| [Qwen Image 2.1](https://getmegabrain.com/media/qwen/image-2.1) | `qwen/image-2.1` | $0.024 per image |
| [Qwen Image 3.0](https://getmegabrain.com/media/qwen/image-3) | `qwen/image-3` | $0.0288 per image |
| [Wan 2.7 Image](https://getmegabrain.com/media/alibaba/wan-2.7-image) | `alibaba/wan-2.7-image` | $0.0288 per image |
| [Wan 2.7 Image Pro](https://getmegabrain.com/media/alibaba/wan-2.7-image-pro) | `alibaba/wan-2.7-image-pro` | $0.072 per image |
| [Z-Image](https://getmegabrain.com/media/alibaba/z-image) | `alibaba/z-image` | $0.0048 per image |
| [Seedream 5.5](https://getmegabrain.com/media/bytedance/seedream-5.5) | `bytedance/seedream-5.5` | $0.0216 per image |
| [Seedream 5 Flash](https://getmegabrain.com/media/bytedance/seedream-5-flash) | `bytedance/seedream-5-flash` | $0.0194 per image |
| [Seedream 5.0 Lite](https://getmegabrain.com/media/bytedance/seedream-5-lite) | `bytedance/seedream-5-lite` | $0.033 per image |
| [Seedream 4.0](https://getmegabrain.com/media/bytedance/seedream-4) | `bytedance/seedream-4` | $0.03 per image |
| [Seedream 3.0](https://getmegabrain.com/media/bytedance/seedream-3) | `bytedance/seedream-3` | $0.021 per image |
| [GPT-4o Image](https://getmegabrain.com/media/openai/gpt-4o-image) | `openai/gpt-4o-image` | $0.036 per image |
| [FLUX.1 Kontext Pro](https://getmegabrain.com/media/black-forest-labs/flux-kontext-pro) | `black-forest-labs/flux-kontext-pro` | $0.03 per image |
| [FLUX.1 Kontext Max](https://getmegabrain.com/media/black-forest-labs/flux-kontext-max) | `black-forest-labs/flux-kontext-max` | $0.06 per image |

## 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.

## Call it

```python
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())
```

## FAQ

**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.
