import requests r = requests.post( "https://api.aimlapi.com/v1/images/generations", headers={"Authorization": "Bearer " + AIMLAPI_KEY}, json={ "model": "google/nano-banana-2.1/edit", "prompt": "Replace the background with a studio backdrop", "image_urls": ["https://example.com/photo.jpg"], "resolution": "2K" }, ) print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer " + process.env.AIMLAPI_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ "model": "google/nano-banana-2.1/edit", "prompt": "Replace the background with a studio backdrop", "image_urls": ["https://example.com/photo.jpg"], "resolution": "2K" }), }); console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/images/generations \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"google/nano-banana-2.1/edit","prompt":"Replace the background with a studio backdrop","image_urls":["https://example.com/photo.jpg"],"resolution":"2K"}'
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Output | |
Coming soon — not yet available on AI/ML API. Prices are listed ahead of launch and are not billable until the model goes live. 2K output is charged at 1.5x the standard rate, 4K at 2x, and 0.5K at 0.75x.
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
Nano Banana 2.1 Edit This page | Image editing | |||
| Image generation | ||||
| Reference-guided image editing | ||||
| Fast, high-volume image generation |
Nano Banana 2.1 Edit transforms reference images using text instructions, with output resolutions up to 4K. It is the editing endpoint of Google's Nano Banana 2.1.
A text prompt and one or more reference image URLs. Video, audio or PDF context can be supplied as well.
0.5K (512px), 2K and 4K, set through the resolution parameter.
$0.104 per generation at the standard rate, the same as Nano Banana 2.1. 2K output is charged at 1.5x that rate, 4K at 2x, and 0.5K at 0.75x.
Changing an image that already exists: swapping a background, adjusting a detail on an approved asset, or applying an instruction across a set of reference shots.