nanobanana is the API model ID for the public nano-banana catalog model. It supports asynchronous image generation and image editing through the same POST /v1/generate endpoint.
| Field | Value |
|---|---|
| Public catalog name | nano-banana |
| API model ID | nanobanana |
| Processing | Async task |
| Generate task type | image_generate |
| Edit task type | image_edit |
| Base cost | $0.0100 per output image |
Generate an Image
curl -X POST https://api.eggapi.ai/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nanobanana",
"prompt": "A clean editorial photo of a lemon tart on a steel table",
"aspect_ratio": "16:9",
"num_outputs": 1
}'
import requests
response = requests.post(
"https://api.eggapi.ai/v1/generate",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"model": "nanobanana",
"prompt": "A clean editorial photo of a lemon tart on a steel table",
"aspect_ratio": "16:9",
"num_outputs": 1,
},
)
task = response.json()["data"]
print(task["id"])
const response = await fetch("https://api.eggapi.ai/v1/generate", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "nanobanana",
prompt: "A clean editorial photo of a lemon tart on a steel table",
aspect_ratio: "16:9",
num_outputs: 1
})
});
const { data: task } = await response.json();
console.log(task.id);
{
"data": {
"id": "gen_abc123def456",
"status": "pending",
"model": "nanobanana",
"type": "image_generate",
"cost": "$0.00",
"created_at": "2026-05-08T10:30:00Z"
},
"error": null
}
GET /v1/tasks/{id} for the final output.
Edit an Image
Sendimage_urls to switch into image editing mode:
curl -X POST https://api.eggapi.ai/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nanobanana",
"prompt": "Replace the background with a quiet marble kitchen",
"image_urls": ["https://example.com/input.png"]
}'
{
"data": {
"id": "gen_edit123456",
"status": "pending",
"model": "nanobanana",
"type": "image_edit",
"cost": "$0.00",
"created_at": "2026-05-08T10:30:00Z"
},
"error": null
}
Completed Output
{
"data": {
"id": "gen_abc123def456",
"status": "completed",
"model": "nanobanana",
"type": "image_generate",
"output": {
"url": "https://file.eggapi.ai/images/gen_abc123def456/0.png",
"urls": ["https://file.eggapi.ai/images/gen_abc123def456/0.png"]
},
"cost": "$0.0100",
"created_at": "2026-05-08T10:30:00Z",
"started_at": "2026-05-08T10:30:01Z",
"completed_at": "2026-05-08T10:30:10Z"
},
"error": null
}