Image GenerationNano Banana
Nano Banana
Fast image generation with image-to-image support using Nano Banana.
POST /v2/images/generate — model: "nano-banana"
Fast image generation with support for image-to-image.
See Image Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Description |
|---|---|---|
nanoBananaParams.aspect_ratio | string | Aspect ratio in "W:H" format |
nanoBananaParams.output_format | string | Output format: "jpg", "png", or "webp" |
nanoBananaParams.image_input | string[] | Up to 14 reference image URLs for image-to-image generation |
Credit cost
| Credits per generation |
|---|
| 8 |
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 serene mountain lake at dawn",
"model": "nano-banana",
"nanoBananaParams": {
"aspect_ratio": "16:9",
"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 serene mountain lake at dawn",
"model": "nano-banana",
"nanoBananaParams": {
"aspect_ratio": "16:9",
"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 serene mountain lake at dawn",
model: "nano-banana",
nanoBananaParams: {
aspect_ratio: "16:9",
output_format: "png",
},
}),
});
console.log(await response.json());Image-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": "transform into oil painting style",
"model": "nano-banana",
"nanoBananaParams": {
"image_input": ["https://example.com/photo.jpg"],
"output_format": "png"
}
}'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": "transform into oil painting style",
"model": "nano-banana",
"nanoBananaParams": {
"image_input": ["https://example.com/photo.jpg"],
"output_format": "png",
},
},
)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: "transform into oil painting style",
model: "nano-banana",
nanoBananaParams: {
image_input: ["https://example.com/photo.jpg"],
output_format: "png",
},
}),
});Try it
POST
/v2/images/generateTry it