Nano Banana API - Developer Guide
Integrate Nano Banana's powerful AI image editing capabilities into your applications. Access nano banana API for text replacement, scene transformation, and advanced image editing.
Quick Start Guide
Get up and running with Nano Banana API in minutes
1. Get Your API Key
Sign up for a free account and get your API key from the dashboard.
Get API Key2. Make Your First Request
import requests import base64 # Nano Banana API Example def edit_image_with_nano_banana(image_path, prompt): # Read and encode image with open(image_path, 'rb') as f: image_data = base64.b64encode(f.read()).decode() # API request response = requests.post( 'https://api.nano-banana.run/v1/edit', headers={ 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, json={ 'image': image_data, 'prompt': prompt, 'model': 'nano-banana-v1' } ) return response.json() # Usage result = edit_image_with_nano_banana( 'input.jpg', 'Replace "Old Text" with "New Text"' ) print(result['edited_image_url'])
3. Response Format
{ "success": true, "edited_image_url": "https://cdn.nano-banana.run/result.jpg", "processing_time": 2.3, "model_used": "nano-banana-v1", "request_id": "req_123456789" }
Pro Tip
Use specific prompts for better results. Instead of "change the text", use "Replace 'Old Text' with 'New Text' while keeping the background identical".
Code Examples
python
import requests import base64 # Nano Banana API Example def edit_image_with_nano_banana(image_path, prompt): # Read and encode image with open(image_path, 'rb') as f: image_data = base64.b64encode(f.read()).decode() # API request response = requests.post( 'https://api.nano-banana.run/v1/edit', headers={ 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, json={ 'image': image_data, 'prompt': prompt, 'model': 'nano-banana-v1' } ) return response.json() # Usage result = edit_image_with_nano_banana( 'input.jpg', 'Replace "Old Text" with "New Text"' ) print(result['edited_image_url'])
javascript
// Nano Banana API Example const editImageWithNanoBanana = async (imageFile, prompt) => { // Convert image to base64 const base64 = await new Promise((resolve) => { const reader = new FileReader(); reader.onload = () => resolve(reader.result.split(',')[1]); reader.readAsDataURL(imageFile); }); // API request const response = await fetch('https://api.nano-banana.run/v1/edit', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ image: base64, prompt: prompt, model: 'nano-banana-v1' }) }); return await response.json(); }; // Usage const result = await editImageWithNanoBanana( imageFile, 'Replace "Old Text" with "New Text"' ); console.log(result.edited_image_url);
curl
# Nano Banana API Example curl -X POST https://api.nano-banana.run/v1/edit \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "image": "base64_encoded_image_data", "prompt": "Replace "Old Text" with "New Text"", "model": "nano-banana-v1" }'
API Endpoints
/v1/edit
Edit an image with text replacement or scene transformation
Parameters
Name | Type | Required | Description |
---|---|---|---|
image | string | Required | Base64 encoded image data |
prompt | string | Required | Natural language editing instruction |
model | string | Optional | Model version (default: nano-banana-v1) |
/v1/batch
Process multiple images with the same prompt
Parameters
Name | Type | Required | Description |
---|---|---|---|
images | array | Required | Array of base64 encoded images |
prompt | string | Required | Natural language editing instruction |
model | string | Optional | Model version (default: nano-banana-v1) |
/v1/models
List available models and their capabilities
Nano Banana API Pricing
Free Tier
100/month
- 100 API requests per month
- Basic image editing
- Community support
- Standard processing time
Pro
10,000/month
- 10,000 API requests per month
- Advanced image editing
- Priority support
- Faster processing
- Batch processing
Enterprise
Unlimited
- Unlimited API requests
- Custom model training
- Dedicated support
- SLA guarantee
- Custom integrations
API Features
Fast Processing
Average response time under 3 seconds
Secure & Reliable
Enterprise-grade security and 99.9% uptime
24/7 Support
Round-the-clock technical support
Easy Integration
Simple REST API with comprehensive documentation
Ready to Get Started?
Start building with Nano Banana API today. Get your free API key and begin creating amazing image editing applications.