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.

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 (docs example) | Sume /v1/images | Note |
|---|---|---|
| model: gemini-nano-banana-2.1 | model: google/nano-banana-2.1 | The bare id nano-banana-2.1 also resolves |
| input (text) | prompt | Required, non-empty |
| response_format.aspect_ratio | aspect_ratio | Per-model list; 4:5 is native on this model |
| response_format.image_size | resolution | 0.5K, 1K, 2K, 4K |
| Base64 inline image input | input_references: [{type, image_url: {url}}] | Public HTTPS URL, not bytes |
| Base64 output image | data[].url | Hosted file plus media_type |
| generation_config.thinking_level | none | Not 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
- Gleam: verify a Sume webhook with gleam_crypto and secure_compare
Verify a Sume webhook in Gleam: crypto.hmac over timestamp.raw_body as a BitArray, lower-cased base16, secure_compare, rotation entries, and a 300 s window.
- Go Fiber v3: BodyRaw for Sume webhooks, and copy it before you queue
Sign-check a Sume webhook in Go Fiber with c.BodyRaw() and hmac.Equal, then copy the bytes before handing them to a goroutine, since Fiber reuses them.
- Grok Imagine Video 1.5 Lite on Vercel AI Gateway vs Sume /v1/videos
Vercel added Grok Imagine Video 1.5 Lite to AI Gateway on Oct 8. What generateVideo gives you, and the equivalent text-to-video call on Sume's /v1/videos.
- Grok Imagine Video 1.5 Lite batch API: what xAI documents
xAI's Lite page lists a $0.02 per second price, 10 requests per second, batch support and two regions. Sume jobs are async instead; here is how they differ.
Written by Sume