Felo API PlatformFelo API Platform
Back to models

Nano Banana 2.1 API

Google's Nano Banana 2.1 is a high-efficiency Gemini 3 series image generation and editing model with multi-turn editing and strong text rendering.

Nano Banana 2.1 is Google's image generation and editing model in the Gemini 3 series, built on Gemini 3.6 Flash. It accepts text, image, video, and PDF input and produces both image and text output, with a context window of 131,072 tokens and an output limit of 32,768 tokens. It supports 1K, 2K, and 4K image resolutions (default 1K) and a wide range of aspect ratios from 1:1 through 21:9.

The model emphasizes precision and control for professional-grade image creation. Mask-based editing changes only the region specified by a mask while preserving the surrounding composition, and subject consistency holds across different scenes, lighting, and angles for faces and identity. Each prompt can use up to 14 reference images, and identity consistency is maintained for up to 4 characters and 10 objects. Grounding with Google web and image search is available, thinking levels can be set to minimal, medium, or high (default medium), and conversational multi-turn editing supports iterative workflows.

It is suited to rapid iterative editing, posters and complex diagrams with clear text, historically accurate scenes and infographics that draw on long-context knowledge, localized text rendering across languages, multi-image fusion for product and multi-character scenes, and virtual try-on or character generation. Known limitations include poor small text at 1K resolution, imperfect character consistency between input and output, partial instruction-following in mask or doodle editing, occasional pose preservation and left-right spatial mix-ups, and limited world knowledge and 3D reasoning. It does not support temperature, topP, topK, seed, or logprobs parameters, nor audio generation, caching, code execution, file search, function calling, or structured outputs.

Updated:

MODEL ID

gemini-nano-banana-2.1
Context
65.536K
Max output
58.982K
Input
image / text
Output
image / text

Highlights

  • Built on Gemini 3.6 Flash
  • Mask-based precise editing
  • Up to 14 reference images per prompt
  • Identity consistency for 4 characters and 10 objects
  • Configurable thinking levels
  • Grounding with Google web and image search

Providers

1 providers

Compare API prices across providers. Select a provider to view all charges and conditions.

Provider · Pricing details
Uptime

Reasoning

Default effort
minimal
Enabled by default
Yes
Always enabled
No
Available effort levels
high / minimal / none

Quick Start

Submit an image task, poll its status, then save the images. These examples use curl and Python 3 (standard library only).

POST https://openapi.felo.ai/api/v1/images/generations

1Get your API key

Create a key from your Felo API Platform account and set it as an environment variable.

export FELO_API_KEY="YOUR_API_KEY"

2Make your first request

Optional values vary by model. This example leaves them unset; confirm supported values in Playground before adding them. Request fields sit alongside model and prompt, without an input wrapper.

curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -o created.json \
  -d '{
  "prompt": "A studio product photo of a ceramic coffee cup on warm linen, soft morning light",
  "model": "gemini-nano-banana-2.1"
}'

3Poll the task

Submission returns task_id. Poll every 3 seconds while queued or running; stop on succeeded, failed or interrupted. This example stops waiting after 30 minutes. Keep created.json to resume querying the same task instead of submitting again.

python3 - <<'PY'
import json, os, time
from pathlib import Path
from urllib.parse import quote
from urllib.request import Request, urlopen

task = json.loads(Path("created.json").read_text())
task_id = task["task_id"]
url = "https://openapi.felo.ai/api/v1/images/generations/" + quote(task_id, safe="")
headers = {"Authorization": "Bearer " + os.environ["FELO_API_KEY"]}
deadline = time.monotonic() + 1800

while task["status"] in ("queued", "running"):
    if time.monotonic() >= deadline:
        raise TimeoutError(f"Keep task_id={task_id} to resume polling")
    time.sleep(3)
    with urlopen(Request(url, headers=headers), timeout=60) as response:
        task = json.load(response)
    if task.get("task_id") != task_id or task.get("kind") != "image":
        raise ValueError("Unexpected task response")
    print(task["status"])

if task["status"] != "succeeded":
    raise RuntimeError(task.get("error") or task["status"])
if not task.get("outputs"):
    raise ValueError("Task succeeded without image outputs")
Path("task.json").write_text(json.dumps(task))
print("Saved task.json")
PY

4Download the output

After success, save outputs from task.json. Results may be HTTPS URLs, URL objects or b64_json. Download signed URLs promptly; media downloads do not use your API key.

python3 - <<'PY'
import base64, json
from pathlib import Path
from urllib.request import urlopen

task = json.loads(Path("task.json").read_text())
if task.get("status") != "succeeded" or not task.get("outputs"):
    raise ValueError("No completed image outputs")
extensions = {"image/png": ".png", "image/jpeg": ".jpg", "image/webp": ".webp", "image/gif": ".gif", "image/avif": ".avif"}

for index, output in enumerate(task["outputs"], 1):
    item = output if isinstance(output, dict) else {}
    url = output if isinstance(output, str) else item.get("url") or item.get("unsigned_url")
    mime = item.get("media_type") or "image/png"
    if url and url.startswith("https://"):
        with urlopen(url, timeout=60) as response:
            data = response.read()
            mime = response.headers.get_content_type()
    elif url and url.startswith("data:image/") and ";base64," in url:
        header, encoded = url.split(",", 1)
        mime = header[5:].split(";", 1)[0]
        data = base64.b64decode(encoded, validate=True)
    elif item.get("b64_json"):
        data = base64.b64decode(item["b64_json"], validate=True)
    else:
        raise ValueError("Unrecognized image output")
    path = Path(f"image-{index}" + extensions.get(mime, ".bin"))
    path.write_bytes(data)
    print(path)
PY
input_references

For image editing, replace the example URL with your HTTPS image URL or a base64 image data URL. Submit once, then use the same polling and saving steps.

curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -o created.json \
  -d '{
  "prompt": "Keep the product and framing. Replace the background with a sunlit marble countertop.",
  "model": "gemini-nano-banana-2.1",
  "input_references": [
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/product.png"
      }
    }
  ]
}'

Supported parameters

  • n
  • seed
  • tools
  • top_p
  • reasoning
  • max_tokens
  • resolution
  • temperature
  • tool_choice
  • aspect_ratio
  • response_format
  • input_references
  • reasoning_effort
  • include_reasoning
  • structured_outputs

Prefer the full reference?

API reference →

Frequently asked questions

What is Nano Banana 2.1?

Nano Banana 2.1 is Google's image generation and editing model in the Gemini 3 series, built on Gemini 3.6 Flash. It accepts text, image, video, and PDF input and produces both image and text output, with a context window of 131,072 tokens and an output limit of 32,768 tokens. It supports 1K, 2K, and 4K image resolutions (default 1K) and a wide range of aspect ratios from 1:1 through 21:9. The model emphasizes precision and control for professional-grade image creation. Mask-based editing changes only the region specified by a mask while preserving the surrounding composition, and subject consistency holds across different scenes, lighting, and angles for faces and identity. Each prompt can use up to 14 reference images, and identity consistency is maintained for up to 4 characters and 10 objects. Grounding with Google web and image search is available, thinking levels can be set to minimal, medium, or high (default medium), and conversational multi-turn editing supports iterative workflows. It is suited to rapid iterative editing, posters and complex diagrams with clear text, historically accurate scenes and infographics that draw on long-context knowledge, localized text rendering across languages, multi-image fusion for product and multi-character scenes, and virtual try-on or character generation. Known limitations include poor small text at 1K resolution, imperfect character consistency between input and output, partial instruction-following in mask or doodle editing, occasional pose preservation and left-right spatial mix-ups, and limited world knowledge and 3D reasoning. It does not support temperature, topP, topK, seed, or logprobs parameters, nor audio generation, caching, code execution, file search, function calling, or structured outputs.

How is usage billed?

Your bill depends on the provider you use, its prices and your usage. Longer inputs or other conditions may have different prices. Billed based on the actual generation cost. See your bill for the final amount.

What input types does Nano Banana 2.1 accept?

It accepts text, image, video, and PDF input. It produces image and text output.

What are the context and output limits?

The context window is 131,072 tokens and the output limit is 32,768 tokens.

What image resolutions and aspect ratios are supported?

It supports 1K, 2K, and 4K resolutions, with 1K as the default. Supported aspect ratios include 1:1, 3:2, 2:3, 3:4, 1:4, 4:1, 4:3, 4:5, 5:4, 1:8, 8:1, 9:16, 16:9, and 21:9.

What tasks is it best suited for?

It is designed for professional-grade image creation and editing, rapid iterative editing, posters and complex diagrams, multi-image fusion, and virtual try-on or character generation.

How does it differ from Nano Banana 2 and Nano Banana Pro?

Nano Banana 2.1 is an upgrade to Nano Banana 2, which is based on Gemini 3.1 Flash Image. It is positioned as the high-efficiency counterpart to Gemini 3 Pro Image (Nano Banana Pro), offering near-Pro-level quality.

Can thinking levels be configured?

Yes. Thinking levels can be set to minimal, medium, or high, and the default is medium.

Related models