# Nano Banana

> Google's light and fast model: pictures from a description and edits of your photos.

| Mode | ID | Price |
|---|---|---|
| [Edit a photo](#edit-a-photo) | `google/nano-banana-edit` | 1K $0.010 · 2K $0.020 |
| [Create a picture](#create-a-picture) | `google/nano-banana` | 1K $0.010 · 2K $0.020 |

## Edit a photo

Upload a photo and describe what to change. ID: `google/nano-banana-edit` · 1K $0.010 · 2K $0.020 per image · under 1 min

**Parameters** (field `input`)

| Parameter | Required | Description | Values (default in bold) |
|---|---|---|---|
| `prompt` | yes | What to draw or what to change | text, up to 5000 chars |
| `image_urls` | yes | Links to your photos (https), up to 10 | `["https://…"]` |
| `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` |
| `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` |
| `output_format` | no | File format | **`png`** `jpeg` |

**Example**

```bash
curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"google/nano-banana-edit","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1K"}}'
```

```python
import os, requests

r = requests.post(
    "https://mixmedia.tech/api/v1/jobs/createTask",
    headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
    json={
      "model": "google/nano-banana-edit",
      "input": {
        "prompt": "Make the background a neon city at night",
        "image_urls": [
          "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"
        ],
        "aspect_ratio": "auto",
        "resolution": "1K"
      }
    },
)
print(r.json())  # {"code": 200, "data": {"taskId": "..."}}
```

```javascript
const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "model": "google/nano-banana-edit",
    "input": {
      "prompt": "Make the background a neon city at night",
      "image_urls": [
        "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"
      ],
      "aspect_ratio": "auto",
      "resolution": "1K"
    }
  }),
});
console.log(await r.json()); // { code: 200, data: { taskId: "..." } }
```

## Create a picture

Describe the picture and the model creates it from scratch. ID: `google/nano-banana` · 1K $0.010 · 2K $0.020 per image · ~1 min

**Parameters** (field `input`)

| Parameter | Required | Description | Values (default in bold) |
|---|---|---|---|
| `prompt` | yes | What to draw or what to change | text, up to 5000 chars |
| `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` |
| `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` |
| `output_format` | no | File format | **`png`** `jpeg` |

**Example**

```bash
curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"google/nano-banana","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1K"}}'
```

```python
import os, requests

r = requests.post(
    "https://mixmedia.tech/api/v1/jobs/createTask",
    headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
    json={
      "model": "google/nano-banana",
      "input": {
        "prompt": "A cat astronaut in a neon city, cinematic light",
        "aspect_ratio": "auto",
        "resolution": "1K"
      }
    },
)
print(r.json())  # {"code": 200, "data": {"taskId": "..."}}
```

```javascript
const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "model": "google/nano-banana",
    "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: "..." } }
```

## Compatibility

apimart/OpenAI-style requests work too:

- `model`: `google/nano-banana-edit`, `nano-banana-edit`, `google/nano-banana`, `nano-banana`, `nano-banana-ext`, `gemini-2.5-flash-image-preview`, `gemini-2.5-flash-image-preview-official`.
- `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio.
- Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper.
- `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request).
- `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result.
- Photos sent to `google/nano-banana` route the task to `google/nano-banana-edit`.

## Result

Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours).

Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links.
