Mage API · Image model
Nano Banana 2 API
Crisp, readable text, up to 4K
POST https://api.mage.space/v1/nano_banana_v2/generateAt a glance
The Nano Banana 2 API runs Nano Banana 2.1 and 1 other variant through Mage at POST https://api.mage.space/v1/nano_banana_v2/generate. A request at the default settings costs 51 Gems (about $0.051), with no subscription. Nano Banana 2 takes saved characters, references by @handle in the prompt.
- ImageOutput
- 2Variants
- 51Gems per image, default
- $0.051About, in USD
Overview
What the Nano Banana 2 API does
Google's image models for graphics and marketing content with legible text. Nano Banana 2.1 leads the family; both generate or edit from up to 14 reference images at up to 4K. Google's safety filter applies.
Google's Nano Banana models, for graphics with readable text and edits from up to 14 reference images, up to 4K. Nano Banana 2.1 (`nano-banana-v2.1`), the default, costs less; Nano Banana 2 (`nano-banana-v2`) also renders at 512. Google's safety filter applies.
It accepts image, additional_images as inputs.
Quick start
Call the Nano Banana 2 API
Set MAGE_API_KEY, submit to /nano_banana_v2/generate, and poll status_url until the request completes.
cURL
STATUS_URL=$(curl --request POST 'https://api.mage.space/v1/nano_banana_v2/generate' \
--header "Authorization: Bearer $MAGE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Editorial portrait in soft daylight, 35mm film look",
"aspect_ratio": "1:1",
"model_id": "nano-banana-v2.1"
}' | jq -r '.status_url')
# Repeat until status is "completed"; result.url is the file
curl "$STATUS_URL" --header "Authorization: Bearer $MAGE_API_KEY"TypeScript
// npm install @mage-space/sdk
import Mage from '@mage-space/sdk';
const mage = new Mage(); // reads MAGE_API_KEY
const request = await mage.run('nano_banana_v2', {
prompt: 'Editorial portrait in soft daylight, 35mm film look',
aspect_ratio: '1:1',
model_id: 'nano-banana-v2.1',
});
console.log(request.result.url);Python
# pip install mage-space
from mage_space import Mage
mage = Mage() # reads MAGE_API_KEY
request = mage.run("nano_banana_v2", {
"prompt": "Editorial portrait in soft daylight, 35mm film look",
"aspect_ratio": "1:1",
"model_id": "nano-banana-v2.1",
})
print(request["result"]["url"])Models
Nano Banana 2 model_id values
Send model_id to pick a variant. A request without one runs the default.
| model_id | Name | Default |
|---|---|---|
| nano-banana-v2 | Nano Banana 2 | |
| nano-banana-v2.1 | Nano Banana 2.1 | Yes |
Options
Nano Banana 2 parameters
Allowed values across all variants; a variant may offer fewer. The docs list the options per variant.
| Field | Values |
|---|---|
| aspect_ratio | 1:1, 3:2, 2:3, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9 |
| resolution | 512, 1K, 2K, 4K |
Inputs
Media inputs Nano Banana 2 accepts
Send each as an https URL, a data URL, or an upload of up to 100 MB.
| Field | Role |
|---|---|
| image | The reference image. |
| additional_images | Additional reference images. |
More image models
Other image generation APIs on Mage
SDXL Plus API
SDXL with faces and hands fixed
Seedream API
Seedream, with a strict filter
Stable Diffusion v1.5 API
The classic, on a budget
Stable Diffusion v3.5 Large API
The Stable Diffusion that listens best
Stable Diffusion XL API
Photoreal-tuned SDXL
Z-Image API
The fastest image model on Mage
FAQ
Frequently asked questions
How much does the Nano Banana 2 API cost?
What is the Nano Banana 2 API endpoint?
Which Nano Banana 2 models can I call?
Does Nano Banana 2 support reference images or characters?
Can I use Nano Banana 2 from Claude or ChatGPT?
How long are Nano Banana 2 results kept?
Start building with Mage
One account, one Gems balance, every model. Pay only for what you generate.