Nano Banana Pro API Documentation

Generate Request - Request Code

POST https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "prompt": "make a photo of the man driving the car down the california coastline", "image_urls": [ "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png", "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png" ] }
import requests url = "https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "prompt": "make a photo of the man driving the car down the california coastline", "image_urls": [ "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png", "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png" ] } response = requests.post(url, json=data, headers=headers) print(response.json())
const url = 'https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { prompt: 'make a photo of the man driving the car down the california coastline', image_urls: [ 'https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png', 'https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png' ] }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "prompt": "make a photo of the man driving the car down the california coastline", "image_urls": [ "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png", "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png" ] }'
import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class NanoBananaProExample { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request"; String json = """ { "prompt": "make a photo of the man driving the car down the california coastline", "image_urls": [ "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png", "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png" ] } """; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
<?php $url = 'https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request'; $headers = [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]; $data = json_encode([ 'prompt' => 'make a photo of the man driving the car down the california coastline', 'image_urls' => [ 'https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png', 'https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png' ] ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo "Response: " . $response . "\n"; echo "HTTP Code: " . $httpCode . "\n"; ?>

Output

Successful API response:

{ "status": "IN_QUEUE", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" }

Request Body - Generate Request

Parameters for /nano-banana-pro-request:

ParameterRequiredTypeDescription
promptYesstringText prompt describing the desired visual transformation or generation. Should include details about style, composition, lighting, and subject matter.
image_urlsYesarray of stringsArray of HTTPS URLs pointing to input images used for image-to-image transformation or multi-image synthesis. Supports up to 14 images. Images must be publicly accessible.

Example Request - Generate Request

JSON
{ "prompt": "make a photo of the man driving the car down the california coastline", "image_urls": [ "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png", "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png" ] }

Response - Generate Request

JSON
{ "status": "IN_QUEUE", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" }

Request Headers

HeaderDescription
Content-TypeMust be set to application/json
Cache-ControlMust be set to no-cache
Ocp-Apim-Subscription-KeyYour API subscription key for authentication

Response Handling

The Nano Banana Pro returns specific HTTP status codes and response bodies to indicate the success or failure of a request. Developers should implement error handling in their applications to manage these responses effectively.

Common Status Codes and Responses

Status CodeDescriptionResponse Body
200Success - The request was successfully processed.{ "success": true, ... }
Bad Request - The request contains invalid parameters or missing fields.{ "error": "Invalid request parameters" }
401Unauthorized - The provided subscription key is missing or invalid.{ "error": "Invalid or missing authentication" }
403Forbidden - The subscription does not have access to this API or action.{ "error": "Access denied for this operation" }
404Not Found - The requested resource or endpoint could not be found.{ "error": "Endpoint not found" }
Too Many Requests - The request rate limit has been exceeded.{ "error": "Rate limit exceeded, please retry later" }
500Internal Server Error - An unexpected error occurred on the server.{ "error": "An unexpected error occurred, please try again later" }

Example Error Response

{ "error": "Invalid parameters" }

Retrieving Results

After submitting your request, use this endpoint to check status and retrieve results.

Endpoint

POST https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request-result

Request Body

{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" }

Code Examples

POST https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request-result Content-Type: application/json Cache-Control: no-cache Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" }
import requests url = "https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request-result" headers = { "Content-Type": "application/json", "Cache-Control": "no-cache", "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY" } data = { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } response = requests.post(url, json=data, headers=headers) print(response.json())
const url = 'https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request-result'; const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY' }; const data = { request_id: 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8' }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request-result" \ -H "Content-Type: application/json" \ -H "Cache-Control: no-cache" \ -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \ --data-raw '{ "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" }'
import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; public class PollResultExample { public static void main(String[] args) throws Exception { String url = "https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request-result"; String json = """ { "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" } """; HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(10)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Content-Type", "application/json") .header("Cache-Control", "no-cache") .header("Ocp-Apim-Subscription-Key", "YOUR_SUBSCRIPTION_KEY") .POST(HttpRequest.BodyPublishers.ofString(json)) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } }
<?php $url = 'https://gateway.pixazo.ai/nano-banana-pro-770/v1/nano-banana-pro-request-result'; $headers = [ 'Content-Type: application/json', 'Cache-Control: no-cache', 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' ]; $data = json_encode([ 'request_id' => 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo "Response: " . $response . "\n"; echo "HTTP Code: " . $httpCode . "\n"; ?>

Response Examples

IN_PROGRESS Status

{ "status": "IN_PROGRESS", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "queue_position": 2, "estimated_remaining_seconds": 8 }

COMPLETED Status

{ "status": "COMPLETED", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "images": [ { "url": "https://storage.googleapis.com/output/image_1.png", "width": 1024, "height": 1024, "content_type": "image/png" } ], "metadata": { "processing_time_seconds": 12.4, "input_image_count": 2 } }

FAILED Status

{ "status": "FAILED", "request_id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8", "error": "Invalid image URL" }

Nano Banana Pro API Pricing

Resolution Price (USD)
All Resolution$0.045