MixMediaAPI · Docs
Open as Markdown

Nano Banana 2

Gemini 3.1 Flash Image: fast generation and editing, accurate text in images, up to 14 references.

Nano Banana 2 (Gemini 3.1 Flash Image) is Google's main image model. It keeps characters consistent, renders legible text inside images, understands long prompts (up to 20,000 characters) and accepts up to 14 reference images for editing, compositing and style transfer.

ModeIDPrice
Image to Imagenano-banana-2$0.02
Text to Imagenano-banana-2$0.02

Both modes are one model, nano-banana-2: pass photos and it edits them or uses them as references.

Image to Image

Upload a photo and describe what to change. ID: nano-banana-2 · $0.02 per image · ~1.5 min

Parameters (field input)

ParameterRequiredDescriptionValues (default in bold)
promptyesWhat to draw or what to changetext, up to 20000 chars
image_inputyesLinks to your photos (https), up to 14["https://…"]
aspect_rationoImage shapeauto 1:1 2:3 3:2 1:4 4:1 3:4 4:3 4:5 5:4 1:8 8:1 9:16 16:9 21:9
resolutionnoQuality: 1K is faster, 2K has more detail1K 2K 4K
output_formatnoFile formatjpg png

Example

curl -X POST https://ai.aimixmedia.site/api/v1/jobs/createTask \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nano-banana-2","input":{"prompt":"Make the background a neon city at night","image_input":["https://ai.aimixmedia.site/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1K"}}'
import os, requests

r = requests.post(
    "https://ai.aimixmedia.site/api/v1/jobs/createTask",
    headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
    json={
      "model": "nano-banana-2",
      "input": {
        "prompt": "Make the background a neon city at night",
        "image_input": [
          "https://ai.aimixmedia.site/static/img/previews/gpt-t2i.jpg"
        ],
        "aspect_ratio": "auto",
        "resolution": "1K"
      }
    },
)
print(r.json())  # {"code": 200, "data": {"taskId": "..."}}
const r = await fetch("https://ai.aimixmedia.site/api/v1/jobs/createTask", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "model": "nano-banana-2",
    "input": {
      "prompt": "Make the background a neon city at night",
      "image_input": [
        "https://ai.aimixmedia.site/static/img/previews/gpt-t2i.jpg"
      ],
      "aspect_ratio": "auto",
      "resolution": "1K"
    }
  }),
});
console.log(await r.json()); // { code: 200, data: { taskId: "..." } }

Text to Image

Describe the picture and the model creates it from scratch. ID: nano-banana-2 · $0.02 per image · ~1.5 min

Parameters (field input)

ParameterRequiredDescriptionValues (default in bold)
promptyesWhat to draw or what to changetext, up to 20000 chars
aspect_rationoImage shapeauto 1:1 2:3 3:2 1:4 4:1 3:4 4:3 4:5 5:4 1:8 8:1 9:16 16:9 21:9
resolutionnoQuality: 1K is faster, 2K has more detail1K 2K 4K
output_formatnoFile formatjpg png

Example

curl -X POST https://ai.aimixmedia.site/api/v1/jobs/createTask \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nano-banana-2","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1K"}}'
import os, requests

r = requests.post(
    "https://ai.aimixmedia.site/api/v1/jobs/createTask",
    headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
    json={
      "model": "nano-banana-2",
      "input": {
        "prompt": "A cat astronaut in a neon city, cinematic light",
        "aspect_ratio": "auto",
        "resolution": "1K"
      }
    },
)
print(r.json())  # {"code": 200, "data": {"taskId": "..."}}
const r = await fetch("https://ai.aimixmedia.site/api/v1/jobs/createTask", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "model": "nano-banana-2",
    "input": {
      "prompt": "A cat astronaut in a neon city, cinematic light",
      "aspect_ratio": "auto",
      "resolution": "1K"
    }
  }),
});
console.log(await r.json()); // { code: 200, data: { taskId: "..." } }

Result

Same as any task: call recordInfo or receive a callback. Image links are in resultJson (kept for 30 days).

Upload your photos via files/upload or pass any public https links.