▥ Seedance 2.5 is here! ›
TEXT TO IMAGE

Image generation API

Turn a text prompt into an image with 14 models from OpenAI, Google, and ByteDance. One API key and one request format for all of them, billed per image in credits.

Models

Every model below takes a text prompt at POST /v1/images/generations. Prices are estimates for one image on the default route.

Model and API model IDOptionsPrice on official-cheap (default)
GPT Image 2openai/gpt-image-2Sizes: 1K, 2K, 4K$0.032 per 1K imageofficial: $0.053
GPT Image 2.5 Flareopenai/gpt-image-2.5-flareSizes: 1K, 2K$0.008 per 1K imageofficial: $0.013
GPT Image 2.5 Sunburstopenai/gpt-image-2.5-sunburstSizes: 1K, 2K$0.008 per 1K imageofficial: $0.013
Nano Bananagoogle/nano-bananaOne standard size$0.019 per imageofficial: $0.039
Nano Banana 2google/nano-banana-2Sizes: 1K, 2K, 4K$0.034 per 1K imageofficial: $0.067
Nano Banana 2 Litegoogle/nano-banana-2-liteOne standard size$0.017 per imageofficial: $0.034
Nano Banana 2.1google/nano-banana-2.1Sizes: 1K, 2K, 4K$0.017 per 1K imageofficial: $0.034
Nano Banana Progoogle/nano-banana-proSizes: 1K, 2K, 4K$0.067 per 1K imageofficial: $0.134
Seedream 4.0bytedance/seedream-4.0Sizes: 1K, 2K, 4K$0.027 per imageofficial: $0.03
Seedream 4.5bytedance/seedream-4.5Sizes: 2K, 4K$0.036 per imageofficial: $0.04
Seedream 5.0bytedance/seedream-5.0Sizes: 2K, 4K$0.032 per imageofficial: $0.035
Seedream 5 Probytedance/seedream-5.0-proSizes: 2K, 4K$0.081 per imageofficial: $0.09
Qwen Image 2.1 Proqwen/qwen-image-2.1-proSizes: 1K, 2K$0.035 per imageofficial: $0.038
Qwen Image 2.1 Turboqwen/qwen-image-2.1-turboSizes: 1K, 2K$0.014 per imageofficial: $0.015

Quick start

  1. Create an API key

    Create a key in the console and save it as the MLMUX_API_KEY environment variable.

    Create an API key
  2. Send a request

    The example sends Nano Banana 2 (google/nano-banana-2) to https://api.mlmux.com/v1/images/generations. Change the model ID to any model in the table above.

  3. Read the result

    The response lists the image URLs in data. Add "async": true to get a task to poll instead.

    Image API reference
curl https://api.mlmux.com/v1/images/generations \
  -H "Authorization: Bearer $MLMUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "google/nano-banana-2",
  "route_mode": "official-cheap",
  "prompt": "A red fox in fresh snow at sunrise, cinematic light",
  "resolution": "1K",
  "aspect_ratio": "1:1",
  "output_format": "jpg",
  "n": 1
}'

Frequently asked questions

Which model should I use for image generation?

Start with Nano Banana 2 for general-purpose images. GPT Image and Qwen Image are strong at text inside images, Nano Banana Pro at detailed professional work, and Seedream at a fixed price per image at high resolution. GPT Image 2.5 Flare is the lowest-cost option.

How much does the image generation API cost?

Prices start at about $0.008 per image (GPT Image 2.5 Flare) on the default official-cheap route. GPT Image and Nano Banana are billed on the tokens an image uses, so larger sizes cost more; Seedream and Qwen Image have a fixed price per image.

Do I get the image in the same request?

Yes. The response lists the image URLs. For long or batch jobs, add "async": true to get a task and poll it, or receive a webhook when it finishes.

Am I charged for failed requests, and is there a limit?

Failed requests are not charged, and the credits held for them return to your balance. Each account can run up to 60 tasks at the same time; email support@mlmux.com if you need more.