EggAPI/docs / models/google/nano-banana-pro/edit

Nano Banana Pro Image Edit

Nano Banana Pro Image Edit on EggAPI: model ID, pricing, request parameters, and code samples for creating tasks, polling, and webhooks.

Model

FieldValue
NameNano Banana Pro Image Edit
Model IDgoogle/nano-banana-pro/edit
Kindimage
CapabilityImage Edit
Task typeimage_edit
Price$0.022 per call or output unit shown by EggAPI
Price by resolution1k $0.022, 2k $0.022, 4k $0.034; the price above applies when resolution is omitted or not listed
Tagsimage, nano banana
DescriptionGoogle Nano Banana

Endpoint and Auth

  • Base URL: https://api.eggapi.ai
  • Create task: POST https://api.eggapi.ai/v1/generate
  • Poll task: GET https://api.eggapi.ai/v1/tasks/{id}
  • Auth header: Authorization: Bearer <EGGAPI_API_KEY>
  • Content header: Content-Type: application/json
  • Processing model: asynchronous task. The create endpoint returns a pending task; poll until completed or failed, or provide webhook_url.

Request Parameters

ParameterRequirement
modelstring · required
promptstring · required
negative_promptstring · optional
image_urlsarray<string> · required
aspect_ratio16:9 | 9:16 | 4:3 | 3:4 | 1:1 | 21:9
resolution1k | 2k | 4k
parametersprovider fields · optional

Example Payload

json
{
  "model": "google/nano-banana-pro/edit",
  "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
  "parameters": {
    "output_format": "png"
  },
  "aspect_ratio": "16:9",
  "image_urls": [
    "https://file.eggapi.ai/uploads/input.png"
  ],
  "resolution": "1k"
}

Generate Examples

Python

python
import requests

response = requests.post(
  "https://api.eggapi.ai/v1/generate",
  headers={"Authorization": "Bearer sk_live_..."},
  json={
         "model": "google/nano-banana-pro/edit",
         "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
         "parameters": {
           "output_format": "png"
         },
         "aspect_ratio": "16:9",
         "image_urls": [
           "https://file.eggapi.ai/uploads/input.png"
         ],
         "resolution": "1k"
       }
)
print(response.json())

TypeScript

typescript
const response = await fetch("https://api.eggapi.ai/v1/generate", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_live_...",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
      "model": "google/nano-banana-pro/edit",
      "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
      "parameters": {
        "output_format": "png"
      },
      "aspect_ratio": "16:9",
      "image_urls": [
        "https://file.eggapi.ai/uploads/input.png"
      ],
      "resolution": "1k"
    })
})
const result = await response.json()

cURL

bash
curl https://api.eggapi.ai/v1/generate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "google/nano-banana-pro/edit",
  "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
  "parameters": {
    "output_format": "png"
  },
  "aspect_ratio": "16:9",
  "image_urls": [
    "https://file.eggapi.ai/uploads/input.png"
  ],
  "resolution": "1k"
}'

Create Response Example

json
{
  "data": {
    "id": "gen_abc123def456",
    "status": "pending",
    "model": "google/nano-banana-pro/edit",
    "type": "image_edit",
    "cost": "$0.00",
    "created_at": "2026-05-08T10:30:00Z"
  },
  "error": null
}

Polling

After creating a task, read data.id and poll GET /v1/tasks/{id}. Treat completed as success and failed as a terminal error.

Polling Examples

Python

python
import time
import requests

headers = {"Authorization": "Bearer sk_live_..."}
create = requests.post(
  "https://api.eggapi.ai/v1/generate",
  headers={**headers, "Content-Type": "application/json"},
  json={
         "model": "google/nano-banana-pro/edit",
         "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
         "parameters": {
           "output_format": "png"
         },
         "aspect_ratio": "16:9",
         "image_urls": [
           "https://file.eggapi.ai/uploads/input.png"
         ],
         "resolution": "1k"
       }
).json()
task_id = create["data"]["id"]

while True:
  task = requests.get(
    f"https://api.eggapi.ai/v1/tasks/{task_id}",
    headers=headers,
  ).json()["data"]
  if task["status"] in ["completed", "failed"]:
    print(task)
    break
  time.sleep(2)

TypeScript

typescript
const headers = {
  "Authorization": "Bearer sk_live_...",
  "Content-Type": "application/json"
}

const create = await fetch("https://api.eggapi.ai/v1/generate", {
  method: "POST",
  headers,
  body: JSON.stringify({
      "model": "google/nano-banana-pro/edit",
      "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
      "parameters": {
        "output_format": "png"
      },
      "aspect_ratio": "16:9",
      "image_urls": [
        "https://file.eggapi.ai/uploads/input.png"
      ],
      "resolution": "1k"
    })
})
const taskId = (await create.json()).data.id

while (true) {
  const response = await fetch(`https://api.eggapi.ai/v1/tasks/${taskId}`, { headers })
  const task = (await response.json()).data
  if (["completed", "failed"].includes(task.status)) {
    console.log(task)
    break
  }
  await new Promise((resolve) => setTimeout(resolve, 2000))
}

cURL

bash
CREATE=$(curl -s https://api.eggapi.ai/v1/generate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "google/nano-banana-pro/edit",
  "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
  "parameters": {
    "output_format": "png"
  },
  "aspect_ratio": "16:9",
  "image_urls": [
    "https://file.eggapi.ai/uploads/input.png"
  ],
  "resolution": "1k"
}')

TASK_ID=$(echo "$CREATE" | jq -r '.data.id')
STATUS="pending"

until [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ]; do
  TASK=$(curl -s "https://api.eggapi.ai/v1/tasks/$TASK_ID" \
    -H "Authorization: Bearer sk_live_...")
  STATUS=$(echo "$TASK" | jq -r '.data.status')
  sleep 2
done

echo "$TASK"

Completed task example:

json
{
  "data": {
    "id": "gen_abc123def456",
    "status": "completed",
    "model": "google/nano-banana-pro/edit",
    "type": "image_edit",
    "output": {
      "url": "https://file.eggapi.ai/images/gen_abc123def456/0.png",
      "urls": [
        "https://file.eggapi.ai/images/gen_abc123def456/0.png"
      ],
      "width": 1024,
      "height": 576
    },
    "cost": "$0.022",
    "created_at": "2026-05-08T10:30:00Z",
    "started_at": "2026-05-08T10:30:01Z",
    "completed_at": "2026-05-08T10:30:10Z"
  },
  "error": null
}

Webhook

Add webhook_url to the create payload to receive task.completed or task.failed callbacks when the worker finishes.

Webhook Examples

Python

python
import requests
from fastapi import FastAPI, Request

# 1. Submit the task with webhook_url
requests.post(
  "https://api.eggapi.ai/v1/generate",
  headers={
    "Authorization": "Bearer sk_live_...",
    "Content-Type": "application/json",
  },
  json={
         "model": "google/nano-banana-pro/edit",
         "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
         "parameters": {
           "output_format": "png"
         },
         "aspect_ratio": "16:9",
         "image_urls": [
           "https://file.eggapi.ai/uploads/input.png"
         ],
         "resolution": "1k",
         "webhook_url": "https://example.com/api/eggapi-webhook"
       }
)

# 2. Receive EggAPI task callbacks
app = FastAPI()

@app.post("/api/eggapi-webhook")
async def eggapi_webhook(request: Request):
  event = await request.json()
  print(event["task_id"], event["type"], event["status"])
  return {"ok": True}

# Unified callback body:
# {
#   "event": "task.completed",
#   "task_id": "gen_abc123def456",
#   "status": "completed",
#   "model": "google/nano-banana-pro/edit",
#   "type": "image_edit",
#   "output": {
#     "url": "https://file.eggapi.ai/images/gen_abc123def456/0.png",
#     "urls": [
#       "https://file.eggapi.ai/images/gen_abc123def456/0.png"
#     ],
#     "width": 1024,
#     "height": 576
#   },
#   "cost": "0.002300",
#   "timestamp": 1778217000
# }

TypeScript

typescript
import express from "express"

// 1. Submit the task with webhook_url
await fetch("https://api.eggapi.ai/v1/generate", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_live_...",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
      "model": "google/nano-banana-pro/edit",
      "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
      "parameters": {
        "output_format": "png"
      },
      "aspect_ratio": "16:9",
      "image_urls": [
        "https://file.eggapi.ai/uploads/input.png"
      ],
      "resolution": "1k",
      "webhook_url": "https://example.com/api/eggapi-webhook"
    })
})

// 2. Receive EggAPI task callbacks
const app = express()
app.use(express.json())

app.post("/api/eggapi-webhook", (req, res) => {
  const event = req.body
  console.log(event.task_id, event.type, event.status, event.output)
  res.status(200).json({ ok: true })
})

// Unified callback body:
// {
//   "event": "task.completed",
//   "task_id": "gen_abc123def456",
//   "status": "completed",
//   "model": "google/nano-banana-pro/edit",
//   "type": "image_edit",
//   "output": {
//     "url": "https://file.eggapi.ai/images/gen_abc123def456/0.png",
//     "urls": [
//       "https://file.eggapi.ai/images/gen_abc123def456/0.png"
//     ],
//     "width": 1024,
//     "height": 576
//   },
//   "cost": "0.002300",
//   "timestamp": 1778217000
// }

cURL

bash
curl https://api.eggapi.ai/v1/generate \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "google/nano-banana-pro/edit",
  "prompt": "a cobalt-blue perfume bottle on a white stone pedestal, soft morning light, studio product shot, 85mm",
  "parameters": {
    "output_format": "png"
  },
  "aspect_ratio": "16:9",
  "image_urls": [
    "https://file.eggapi.ai/uploads/input.png"
  ],
  "resolution": "1k",
  "webhook_url": "https://example.com/api/eggapi-webhook"
}'

# EggAPI will POST this unified JSON to your webhook_url:
# {
#   "event": "task.completed",
#   "task_id": "gen_abc123def456",
#   "status": "completed",
#   "model": "google/nano-banana-pro/edit",
#   "type": "image_edit",
#   "output": {
#     "url": "https://file.eggapi.ai/images/gen_abc123def456/0.png",
#     "urls": [
#       "https://file.eggapi.ai/images/gen_abc123def456/0.png"
#     ],
#     "width": 1024,
#     "height": 576
#   },
#   "cost": "0.002300",
#   "timestamp": 1778217000
# }

Webhook callback body example:

json
{
  "event": "task.completed",
  "task_id": "gen_abc123def456",
  "status": "completed",
  "model": "google/nano-banana-pro/edit",
  "type": "image_edit",
  "output": {
    "url": "https://file.eggapi.ai/images/gen_abc123def456/0.png",
    "urls": [
      "https://file.eggapi.ai/images/gen_abc123def456/0.png"
    ],
    "width": 1024,
    "height": 576
  },
  "cost": "0.022",
  "timestamp": 1778217000
}

Notes for AI Assistants

  • Always use the exact model ID: google/nano-banana-pro/edit.
  • Do not expose the EggAPI API key in client-side code, logs, or prompts.
  • The create endpoint is asynchronous; do not expect final media output in the initial response.
  • Use image_urls only for image/video capabilities that require uploaded source images.
  • Use provider-specific optional fields under parameters when needed.
connected
mcp https://api.eggapi.ai/mcp
models ...
Claude Code · Codex · MCP
█