Image GenerationNano Banana
Nano Banana 2
High-efficiency image generation with accurate text rendering, Google Search grounding, and resolutions up to 4K.
POST /v2/images/generate — model: "nano-banana-2"
Google's latest high-efficiency image generation model built on Gemini 3.1 Flash Image. Combines Pro-level visual quality with Flash-level speed. Supports accurate text rendering, up to 14 reference images, resolutions up to 4K, and optional Google Search grounding for real-time context.
See Image Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Description |
|---|---|---|
nanoBananaParams.aspect_ratio | string | "match_input_image" or "W:H" format (e.g. "16:9") |
nanoBananaParams.output_format | string | "jpg" (default) or "png" |
nanoBananaParams.image_input | string[] | Up to 14 reference image URLs |
nanoBananaParams.resolution | string | "512px", "1K" (default), "2K", or "4K" |
nanoBananaParams.google_search | boolean | Use Google Web Search grounding for real-time information |
nanoBananaParams.image_search | boolean | Use Google Image Search for visual context |
Credit cost
| Resolution | Credits |
|---|---|
| 512px / 1K | 5 |
| 2K | 7 |
| 4K | 10 |
Code examples
Text-to-image
curl -X POST https://api.apiframe.ai/v2/images/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a photorealistic cityscape at golden hour",
"model": "nano-banana-2",
"nanoBananaParams": {
"resolution": "2K",
"output_format": "png"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "a photorealistic cityscape at golden hour",
"model": "nano-banana-2",
"nanoBananaParams": {
"resolution": "2K",
"output_format": "png",
},
},
)
print(response.json())const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "a photorealistic cityscape at golden hour",
model: "nano-banana-2",
nanoBananaParams: {
resolution: "2K",
output_format: "png",
},
}),
});
console.log(await response.json());With Google Search grounding
curl -X POST https://api.apiframe.ai/v2/images/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "infographic of today's weather in Paris",
"model": "nano-banana-2",
"nanoBananaParams": {
"google_search": true,
"resolution": "1K"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/images/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "infographic of today's weather in Paris",
"model": "nano-banana-2",
"nanoBananaParams": {
"google_search": True,
"resolution": "1K",
},
},
)const response = await fetch("https://api.apiframe.ai/v2/images/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "infographic of today weather in Paris",
model: "nano-banana-2",
nanoBananaParams: {
google_search: true,
resolution: "1K",
},
}),
});Try it
POST
/v2/images/generateTry it