Skip to main content

Overview

nanobanana-pro is a professional-grade image generation model with enhanced detail.
  • Type: Image Generation
  • Processing: Asynchronous
  • Aspect ratio: 16:9 or 9:16
  • Resolution: 1K / 2K / 4K (optional)
  • Price: 0.016perimage(4K:0.016 per image (4K: 0.032)

Parameters

model
string
required
nanobanana-pro
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)
resolution
string
Image resolution: 1k, 2k, 4k. 4K resolution costs double ($0.032). If not provided, default resolution is used.
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-pro",
    "prompt": "A futuristic cityscape at night, cyberpunk style",
    "negative_prompt": "blurry, low quality",
    "aspect_ratio": "16:9",
    "resolution": "2k",
    "num_outputs": 2,
    "webhook_url": "https://webhook.site/your-webhook-id"
  }'

Response

{
  "data": {
    "id": "gen_abc123def456",
    "status": "pending",
    "model": "nanobanana-pro",
    "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-pro",
    "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-pro also supports image editing, allowing you to modify existing images using natural language prompts with professional-grade quality. 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-pro
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-pro",
    "prompt": "Transform into a professional studio portrait",
    "image_urls": ["https://example.com/image.jpg"]
  }'

Image Editing Response

{
  "data": {
    "id": "gen_abc123def456",
    "status": "pending",
    "model": "nanobanana-pro",
    "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.