Port a gemini-nano-banana-2.1 image call to Sume POST /v1/images

Map Google's response_format aspect_ratio and image_size, base64 output and inline inputs to Sume's aspect_ratio, resolution, data[].url and input_references.

4 min readSume
All posts

To move a Google image call for gemini-nano-banana-2.1 to Sume, send POST https://api.sume.com/v1/images with model: "google/nano-banana-2.1" and rename four things: response_format.aspect_ratio becomes aspect_ratio, response_format.image_size becomes resolution, inline base64 inputs become public HTTPS URLs in input_references, and the base64 output becomes a URL in data[0].url. Google's example uses an uppercase image_size such as 2K; Sume's resolution takes 0.5K, 1K, 2K or 4K, so that value usually carries over unchanged.

What did Google ship, and what does Sume list?

Google's release notes (read 2026-10-11) date Nano Banana 2.1 to October 6, 2026, with model id gemini-nano-banana-2.1 and the extra wide ratios 1:4, 4:1, 1:8 and 8:1 at 1K, 2K and 4K. Google's model page (read 2026-10-11) adds up to 14 reference images, thinking levels and Google Search grounding.

Sume lists the same model as google/nano-banana-2.1 in its image catalog. The older google/nano-banana-2 id still works and runs as 2.1. Sume's ratio list for the model includes auto, 21:9, 16:9, 4:5, 9:16, 4:1, 1:4, 8:1 and 1:8, so the wide ratios are available.

Which field maps to which?

The table below is the whole translation for a plain text-to-image or edit call. Fields Sume does not list for a model return 400 unsupported_parameter instead of being dropped, so check the model's supported_parameters in GET /v1/images/models before you send an optional one.

Google image request fields against Sume /v1/images fields, read 2026-10-11
Google (docs example)Sume /v1/imagesNote
model: gemini-nano-banana-2.1model: google/nano-banana-2.1The bare id nano-banana-2.1 also resolves
input (text)promptRequired, non-empty
response_format.aspect_ratioaspect_ratioPer-model list; 4:5 is native on this model
response_format.image_sizeresolution0.5K, 1K, 2K, 4K
Base64 inline image inputinput_references: [{type, image_url: {url}}]Public HTTPS URL, not bytes
Base64 output imagedata[].urlHosted file plus media_type
generation_config.thinking_levelnoneNot a Sume request field

What does the call look like in Python?

Sume waits up to 30 seconds by default and answers 200 with the images, or 202 with a job envelope if the render is slower. Branch on the status code, not on the body shape.

import os
import requests

body = {
    "model": "google/nano-banana-2.1",
    "prompt": "Wide banner of a coastal trail at dawn",
    "aspect_ratio": "4:1",
    "resolution": "2K",
}
resp = requests.post(
    "https://api.sume.com/v1/images",
    headers={"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"},
    json=body,
    timeout=60,
)
if resp.status_code == 200:
    print(resp.json()["data"][0]["url"])
elif resp.status_code == 202:
    print("slow render, read the job result")
else:
    resp.raise_for_status()

What changes in your code besides names?

Three behaviors differ and are worth a test before you switch traffic.

  • Output is a URL, so replace the base64 decode and file write with a download of data[0].url.
  • Inputs must be reachable by URL. Upload local files first, or host them, then pass them in input_references.
  • Thinking levels and Search grounding are Google request features; the Sume image request has no field for them, so drop them from the port rather than sending them.

Where do I check the live list?

Call GET /v1/images/models/google/nano-banana-2.1/endpoints for the definitive parameter set and price lines for the model. Sume's Image API page documents the request schema, the 200 and 202 handling and the model discovery routes.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume