Skip to main content

Overview

nanobanana is a fast, efficient image generation model for general use cases.
  • Type: Image Generation
  • Processing: Asynchronous
  • Aspect ratio: 16:9 or 9:16
  • Price: $0.01 per image

Parameters

model
string
required
nanobanana
prompt
string
required
Description of the image to generate (max 2000 characters)
negative_prompt
string
What to avoid in the image (max 1000 characters)
aspect_ratio
string
Aspect ratio: 16:9, 9:16 (default: 16:9)
num_outputs
integer
Number of images to generate (1-4, default: 1)
image_urls
string[]
Image URLs for image-to-image editing (supports up to 9 images)
webhook_url
string
Webhook callback URL for task completion or failure notifications

Example

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 futuristic cityscape at sunset",
    "aspect_ratio": "16:9",
    "num_outputs": 1,
    "webhook_url": "https://webhook.site/your-webhook-id"
  }'

Response

{
  "data": {
    "id": "gen_abc123def456",
    "status": "pending",
    "model": "nanobanana",
    "type": "image_generate",
    "cost": "$0.00",
    "created_at": "2025-12-25T21:03:47.879577+08:00"
  },
  "error": null
}
Image generation is asynchronous. Use the Tasks API to poll for results.

Failure Response

{
  "data": {
    "id": "gen_abc123def456",
    "status": "failed",
    "model": "nanobanana",
    "type": "image_generate",
    "error": "Content moderation: prompt contains prohibited content",
    "cost": "$0.00",
    "created_at": "2025-12-25T21:03:47.879577+08:00",
    "started_at": "2025-12-25T21:03:50.000000+08:00",
    "completed_at": "2025-12-25T21:04:10.000000+08:00"
  },
  "error": null
}

Image Editing Mode

nanobanana also supports image editing, allowing you to modify existing images using natural language prompts. Simply provide the image_urls parameter in your request.
  • Endpoint: POST /v1/generate (same as image generation)
  • Content Type: application/json
  • Max Images: 9 images per request
  • Processing: Asynchronous

Image Editing Parameters

model
string
required
nanobanana
prompt
string
required
Description of how to edit the image (max 2000 characters)
image_urls
string[]
required
URLs of images to edit (supports up to 9 URLs)
webhook_url
string
Webhook callback URL for task completion or failure notifications

Image Editing Example

curl -X POST https://api.eggapi.ai/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nanobanana",
    "prompt": "Change the background to a sunset beach",
    "image_urls": ["https://example.com/image.jpg"]
  }'

Image Editing Response

{
  "data": {
    "id": "gen_abc123def456",
    "status": "pending",
    "model": "nanobanana",
    "type": "image_edit",
    "cost": "$0.00",
    "created_at": "2025-12-26T10:30:00.000000+08:00"
  },
  "error": null
}
Image editing is asynchronous. Use the Tasks API to poll for results.