Bỏ qua

Nano Banana Pro API Documentation

Generate content using the Nano Banana Pro model Pricing: Nano Banana : 8 credits (~$0.02) Pricing: Nano Banana Edit: 8 credits (~$0.02) Pricing: Nano Banana Pro: 25 credits (~$0.09) for 1K/2K and 35 credits (~$0.12) for 4K

Overview

This document describes how to use the Nano Banana Pro model for content generation. The process consists of two steps:

  1. Create a generation task

  2. Query task status and results

Authentication

All API requests require a Token in the request header:

x-api-key: YOUR_API_KEY

Get API Key:

  1. Visit API Key to get your API Key

  2. Add to request header: x-api-key:YOUR_API_KEY


1. Create Generation Task

API Information

  • URL: POST https://api.revidapi.com/paid/nano/banana/create
  • Content-Type: application/json

Request Parameters

Parameter Type Required Description
model string Yes Model name, format: nano-banana-pro
input object Yes Input parameters object
callBackUrl string No Callback URL for task completion notifications. If provided, the system will send POST requests to this URL when the task completes (success or fail). If not provided, no callback notifications will be sent. Example: "https://your-domain.com/api/callback"

Model Parameter

The model parameter specifies which AI model to use for content generation.

Model Price Description
google/nano-banana 8 credit The exact model identifier for this API
google/nano-banana-edit 8 credit The exact model identifier for this API
nano-banana-pro 25 credit High-quality 1K and 2K resolution images
nano-banana-pro 35 credit Ultra-sharp 4K resolution images

Type string Must be passed as a string value Required yes This parameter is mandatory for all requests

Note: The model parameter must match exactly as shown above. Different models have different capabilities and parameter requirements.

Callback URL Parameter

The callBackUrl parameter allows you to receive automatic notifications when your task completes.

Property Value Description
Purpose Task completion notification Receive real-time updates when your task finishes
Method POST request The system sends POST requests to your callback URL
Timing When task completes Notifications sent for both success and failure states
Content Query Task API response Callback content structure is identical to the Query Task API response
Parameters Complete request data The param field contains the complete Create Task request parameters, not just the input section
Optional Yes If not provided, no callback notifications will be sent

Important Notes: - The callback content structure is identical to the Query Task API response - The param field contains the complete Create Task request parameters, not just the input section
- If callBackUrl is not provided, no callback notifications will be sent

Input Object Parameters

prompt

  • Type: string
  • Required: Yes
  • Description: A text description of the image you want to generate
  • Max Length: 10000 characters
  • Default Value: "Comic poster: cool banana hero in shades leaps from sci-fi pad. Six panels: 1) 4K mountain landscape, 2) banana holds page of long multilingual text with auto translation, 3) Gemini 3 hologram for search/knowledge/reasoning, 4) camera UI sliders for angle focus color, 5) frame trio 1:1-9:16, 6) consistent banana poses. Footer shows Google icons. Tagline: Nano Banana Pro now on Revidapi.com."

image_input

  • Type: array
  • Required: No
  • Description: Input images to transform or use as reference (supports up to 8 images)
  • Max File Size: 30MB
  • Accepted File Types: image/jpeg, image/png, image/webp
  • Multiple Files: Yes
  • Default Value: []

aspect_ratio

  • Type: string
  • Required: No
  • Description: Aspect ratio of the generated image
  • Options:
  • 1:1: 1:1
  • 2:3: 2:3
  • 3:2: 3:2
  • 3:4: 3:4
  • 4:3: 4:3
  • 4:5: 4:5
  • 5:4: 5:4
  • 9:16: 9:16
  • 16:9: 16:9
  • 21:9: 21:9
  • auto: Auto
  • Default Value: "1:1"

Resolution ( only For nano-banana-pro Model )

  • Type: string
  • Required: No
  • Description: Resolution of the generated image
  • Options:
  • 1K: 1K
  • 2K: 2K
  • 4K: 4K
  • Default Value: "1K"

output_format

  • Type: string
  • Required: No
  • Description: Format of the output image
  • Options:
  • png: PNG
  • jpg: JPG
  • Default Value: "png"

Request Example google/nano-banana Model

curl -X POST "https://api.revidapi.com/paid/nano/banana/create" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "model": "google/nano-banana",
    "callBackUrl": "https://your-domain.com/api/callback",
    "input": {
      "prompt": "A surreal painting of a giant banana floating in space, stars and galaxies in the background, vibrant colors, digital art",
      "output_format": "png",
      "image_size": "1:1"
    }
}'

Request Example google/nano-banana-edit Model

curl -X POST "https://api.revidapi.com/paid/nano/banana/create" \
  -H "x-api-key: YOUR_API_KEY" \
 -d '{
    "model": "google/nano-banana-edit",
    "callBackUrl": "https://your-domain.com/api/callback",
    "input": {
      "prompt": "turn this photo into a character figure. Behind it, place a box with the character’s image printed on it, and a computer showing the Blender modeling process on its screen. In front of the box, add a round plastic base with the character figure standing on it. set the scene indoors if possible",
      "image_urls": [
        "https://file.aiquickdraw.com/custom-page/akr/section-images/1756223420389w8xa2jfe.png"
      ],
      "output_format": "png",
      "image_size": "1:1"
    }
}

Request Example nano-banana-pro Model

curl -X POST "https://api.revidapi.com/paid/nano/banana/create" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "model": "nano-banana-pro",
    "callBackUrl": "https://your-domain.com/api/callback",
    "input": {
      "prompt": "Comic poster: cool banana hero in shades leaps from sci-fi pad. Six panels: 1) 4K mountain landscape, 2) banana holds page of long multilingual text with auto translation, 3) Gemini 3 hologram for search/knowledge/reasoning, 4) camera UI sliders for angle focus color, 5) frame trio 1:1-9:16, 6) consistent banana poses. Footer shows Google icons. Tagline: Nano Banana Pro now on Revid API.",
      "aspect_ratio": "1:1",
      "resolution": "1K",
      "output_format": "png"
    }
}'

Response Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "281e5b0*********************f39b9"
  }
}

Response Parameters

Parameter Type Description
code integer Response status code, 200 indicates success
msg string Response message
data.taskId string Task ID for querying task status

2. Query Task Status

API Information

  • URL: https://api.revidapi.com/paid/get/taskid
  • Method: POST
  • Parameter: taskId (passed via URL parameter)

Request Example

Post https://api.revidapi.com/paid/get/taskid?taskId=281e5b0*********************f39b9

Response Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "281e5b0*********************f39b9",
    "model": "nano-banana-pro",
    "state": "waiting",
    "param": "{\"model\":\"nano-banana-pro\",\"input\":{\"prompt\":\"Comic poster: cool banana hero in shades leaps from sci-fi pad. Six panels: 1) 4K mountain landscape, 2) banana holds page of long multilingual text with auto translation, 3) Gemini 3 hologram for search/knowledge/reasoning, 4) camera UI sliders for angle focus color, 5) frame trio 1:1-9:16, 6) consistent banana poses. Footer shows Google icons. Tagline: Nano Banana Pro now on Revidapi.com.\",\"image_input\":[],\"aspect_ratio\":\"1:1\",\"resolution\":\"1K\",\"output_format\":\"png\"}}",
    "resultJson": "{\"resultUrls\":[\"https://static.aiquickdraw.com/tools/example/1763662100739_DlBXJvdR.png\"]}",
    "failCode": null,
    "failMsg": null,
    "costTime": null,
    "completeTime": null,
    "createTime": 1757584164490
  }
}

Response Parameters

Parameter Type Description
code integer Response status code, 200 indicates success
msg string Response message
data.taskId string Task ID
data.model string Model name used
data.state string Task status: waiting(waiting), success(success), fail(fail)
data.param string Task parameters (JSON string)
data.resultJson string Task result (JSON string, available when task is success). Structure depends on outputMediaType: {resultUrls: []} for image/media/video, {resultObject: {}} for text
data.failCode string Failure code (available when task fails)
data.failMsg string Failure message (available when task fails)
data.costTime integer Task duration in milliseconds (available when task is success)
data.completeTime integer Completion timestamp (available when task is success)
data.createTime integer Creation timestamp

Usage Flow

  1. Create Task: Call POST https://api.revidapi.com/paid/banana/pro/create to create a generation task
  2. Get Task ID: Extract taskId from the response
  3. Wait for Results:
  4. If you provided a callBackUrl, wait for the callback notification
  5. If no callBackUrl, poll status by calling POST https://api.revidapi.com/paid/get/taskid
  6. Get Results: When state is success, extract generation results from resultJson

Error Codes

Status Code Description
200 Request successful
400 Invalid request parameters
401 Authentication failed, please check API Key
402 Insufficient account balance
404 Resource not found
422 Parameter validation failed
429 Request rate limit exceeded
500 Internal server error