Nano Banana 2.1 4K batch: handle 200 and 202, reuse the key
A 4K Nano Banana 2.1 call can return 200 with the image or 202 with a job. A short Python handler, the retry rule, and what 4K costs: $0.20 per image on Sume.

When you request 4K from Nano Banana 2.1 on Sume, check the HTTP status, not the body. POST /v1/images returns 200 with the image if it finishes within 30 seconds and 202 with a job envelope if it does not. The Sume docs name 4K, high quality and large n as the settings most likely to become 202. A 4K image bills $0.20.
The handler
This sends one request and returns either image URLs or the job's result URL. The Idempotency-Key is built from your own item id, so a retry after a client timeout returns the original job and does not bill a second one.
import os, requests
URL = "https://api.sume.com/v1/images"
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
def make(item_id, prompt):
body = {"model": "google/nano-banana-2.1", "prompt": prompt, "resolution": "4K"}
r = requests.post(URL, json=body, timeout=60,
headers={**H, "Idempotency-Key": f"hero-{item_id}"})
if r.status_code == 200:
return [d["url"] for d in r.json()["data"]]
if r.status_code == 202:
return r.json()["data"]["result_url"]
r.raise_for_status()
raise RuntimeError(r.text)
print(make("sku-001", "Matte black kettle on oak, window light"))Cost of a batch
Prices are Sume list as of 2026-10-08; 4K is the provider's $0.16 times 1.25.
| Images | Arithmetic | Cost |
|---|---|---|
| 50 | 50 x $0.20 | $10.00 |
| 250 | 250 x $0.20 | $50.00 |
| 1,000 | 1,000 x $0.20 | $200.00 |
Rules for retries
Use the same key again only for the same operation and payload, as the Jobs and results page says. Change the key when you change the prompt. A 202 is not a failure: fetch the result URL after the job is terminal, or use mode: "webhook" with a public HTTPS webhook_url and let Sume call you.
Wiring a webhook instead
For a large batch, polling is wasteful. Send mode: "webhook" with a public HTTPS webhook_url, and Sume returns the 202 job envelope straight away, then calls you when the job is terminal. Verify the callback before you trust it, and refuse to run the verifier if the secret is empty.
Store the result_url or job id against your item id. If your service restarts, you can resume from that map without re-submitting, and the idempotency key protects you from a double bill when you do resubmit by mistake.
Start with 10 items before you launch 1,000. At $0.20 each, 10 items is $2.00, and it will show you how often 4K returns 200 and how often 202 in your region and at your prompt length.
What 200 versus 202 means for cost
Nothing, in itself. Both outcomes bill the same image at the same tier. The difference is only whether you hold a connection open while the job runs. For a script that makes hundreds of 4K calls, treating 202 as normal removes the retry storms that come from treating it as a failure.
Do not resubmit a 202 job as a new request. Use the job's status and result URLs. If you do resubmit by mistake, the same Idempotency-Key means the retry returns the original job.
One more habit that pays off on 4K batches: write the item id, the prompt and the returned job id to a log line before you move to the next item. If the process stops half way, you can read the log, skip the finished items and resume with the same keys. For a 250-item run at $0.20 each ($50.00), a resume that skips 120 finished items avoids $24.00 of repeat spend, as long as the repeat would have been a new job rather than a keyed retry.
Sources
Related posts
More in Developers
- Nano Banana 2.1 PDF and video grounding: Sume takes image URLs
fal's Nano Banana 2.1 Edit page lists video and PDF grounding. Sume's Image API takes public HTTPS image URLs only, so render pages first.
- Nano Banana 2.1 resolution: send 512 or 0.5K, $0.075 per draft
Sume's catalog publishes the smallest Nano Banana tier as 512, and requests may send 512 or 0.5K. A draft bills $0.075; 1K, 2K and 4K bill $0.10, $0.15, $0.20.
- Nano Banana 2 is retired on Sume: the old id still works, as 2.1
google/nano-banana-2 and nano-banana-2 still work on Sume and run as Nano Banana 2.1. The job stores the 2.1 id, and the catalog lists only 2.1.
- Edit a photo with Nano Banana: aspect_ratio auto and the cost of 100
Send a product photo as input_references to Nano Banana 2.1 or Pro and set aspect_ratio auto to keep its shape. Python request and cost of 100 edits.
Written by Sume