Overview
🔥 Latest Release: Google launched Nano Banana 2 (
gemini-3.1-flash-image-preview) on February 26, 2026 — Pro-level quality at Flash-tier speed, only $0.03/image! View Nano Banana 2 DocumentationLatest Versions
- Nano Banana 2:
gemini-3.1-flash-image-preview(🔥 Launched February 26, 2026) — View Details - Nano Banana Pro:
gemini-3-pro-image-preview(Launched November 20, 2025)
Previous Versions
- Official Release:
gemini-2.5-flash-image(Stable version, supports 10 aspect ratios) - Preview Version:
gemini-2.5-flash-image-preview(⚠️ Discontinued on October 30, 2025)
📚 Latest Documentation
Feishu Complete Usage Guide - Fastest updates, supports comment interactionVisit Feishu documentation for latest tutorials, tips sharing, and Q&A. Documentation continuously updated, questions can be discussed directly in Feishu comments.
Core Advantages
-
🔥 Nano Banana Pro New Features:
- 🎯 4K High-Resolution Support: Supports 1K, 2K, 4K three resolutions, up to 4096×4096
- 📝 Text Rendering King: Clear and readable text in images, perfect for posters and ads
- ✨ Local Editing: Supports camera angle, focus, color grading, scene lighting adjustments
- 🧠 Smart Reasoning: Based on Gemini 3 Pro, better understanding of complex prompts
-
🚀 Universal Advantages:
- ⚡ Generation Speed: Nano Banana Pro ~20 seconds, previous version ~10 seconds
- 💰 Affordable Pricing: Combined with top-up bonuses, extremely cost-effective
- 🔄 Full Compatibility: Supports both Google native format and OpenAI compatibility mode
- 🎨 Google Technology: Based on Google’s latest and strongest image generation/editing technology
Calling Methods
Correct Endpoint ✅
Incorrect Endpoint ❌
Compatibility Notes
If you’ve previously used the following models, simply replace the model name:Upgrade to Latest Version
- Any old version →
gemini-3-pro-image-preview(🔥 Recommended, Nano Banana Pro)- Supports 4K high-resolution output
- Strongest text rendering capabilities
- Local editing features
Use Stable Version
gpt-4o-image→gemini-2.5-flash-imagesora_image→gemini-2.5-flash-image- Old Nano Banana →
gemini-2.5-flash-image
Python Example Code
Complete Python example code with automatic local saving of base64 images:Usage Steps
- Replace API Key: Replace
API_KEYin code with your actual API key - Modify Prompt: Modify
PROMPTvariable as needed - Run Script: Execute Python script, image will be automatically saved locally
Price Comparison
| Model | Pricing | Advantage |
|---|---|---|
| Nano Banana Pro (4K) | $0.050/image (~¥0.29 with bonuses) | 🔥 4K support, 17% of official price |
| Nano Banana Pro (1K-2K) | $0.050/image (~¥0.29 with bonuses) | 🔥 High-res output, 30% of official price |
| Nano Banana | $0.025/image (~¥0.15 with bonuses) | ⭐ Fast generation, 52% of official price |
| gpt-image-1 | Higher | - |
| flux-kontext-pro | $0.035/image | On par |
| sora_image | Lower | Reverse-engineered model, moderate stability |
Feature Comparison
Speed Comparison
- Nano Banana: Average 10 seconds
- OpenAI Series: 15-30 seconds
- Other Models: Varies by model
Compatibility
- ✅ Fully compatible with
gpt-4o-imagecalling method - ✅ Fully compatible with
sora_imagecalling method - ✅ Supports chat completion endpoint
- ❌ Does not support traditional image generation endpoint
API Error Handling Guide
Nano Banana Pro has strict content safety controls and may reject non-compliant requests at multiple levels. Understanding error types and handling methods helps you better diagnose issues and provide a friendly user experience.Core Error Detection Indicators
candidatesTokenCount
Highest PriorityWhen value is 0, content was rejected during review stage with no candidate content generated. This is the strictest rejection.
finishReason
Secondary PriorityWhen value is not
STOP (like PROHIBITED_CONTENT, SAFETY), indicates rejection during generation process.API Text Response
Rejection ExplanationWhen API returns rejection explanation text instead of image data, these explanations should be displayed to users.
Common Error Scenarios
Content Review Rejection (candidatesTokenCount = 0)
Content Review Rejection (candidatesTokenCount = 0)
Detection Condition:
response.usageMetadata.candidatesTokenCount === 0Reason: Prompt or reference image contains inappropriate content (such as sexual content, violence, sensitive topics, etc.), rejected during content review stage.Recommendations:- Check prompt to ensure no sensitive content
- If using reference images, ensure image content is appropriate
- Avoid descriptions of violence, sexual content, or other inappropriate content
Safety Policy Rejection (finishReason abnormal)
Safety Policy Rejection (finishReason abnormal)
Detection Condition:
finishReason is not STOPCommon Values:PROHIBITED_CONTENT- Prohibited contentSAFETY- Triggered safety filterRECITATION- May involve copyright issuesMAX_TOKENS- Token limit exceeded
- Use healthy, positive descriptions
- Avoid sensitive topics
- Adjust prompt and retry
Feature Limitation Rejection
Feature Limitation Rejection
Common Situations:
- Watermark Removal: Violates content policy, cannot process
- Face Swap: Involves privacy and ethical issues, cannot process
- Knowledge Base Limitation: Mentions future years (2026+) or unreleased products
- Avoid referencing future products or concepts
- Use professional image editing software for special needs
- Ensure requested content is within model knowledge scope (knowledge cutoff January 2025)
Error Handling Best Practices
Check candidatesTokenCount
First check
usageMetadata.candidatesTokenCount, if 0 then directly indicate content review failure.Check finishReason
If
finishReason is not STOP, provide corresponding friendly prompts based on specific value.Handle Text Response
If API returns text explanation instead of image, directly display these explanations to users to help understand rejection reason.
Complete Error Handling DocumentationFor detailed error handling workflows, code implementation examples, and best practices, visit the complete documentation:
https://xinqikeji.feishu.cn/wiki/Rslqw724YiBwlokHmRLcMVKHnRfDocumentation includes: complete error detection flowcharts, code examples for each scenario, user-friendly message templates for C-side/B-side users, and more.FAQ
Why use chat completion endpoint instead of image generation endpoint?
Why use chat completion endpoint instead of image generation endpoint?
To maintain compatibility with existing image generation models (like gpt-4o-image, sora_image), making it convenient for users to seamlessly switch between different image generation models.
Should I choose Pro version or legacy version?
Should I choose Pro version or legacy version?
Recommended for new projects: Nano Banana Pro (
gemini-3-pro-image-preview)✅ Pro Version Advantages:- Supports 4K ultra-high resolution (1K, 2K, 4K)
- Industry-leading text rendering quality
- Advanced local editing features
- Only 17-30% of official pricing
gemini-2.5-flash-image) suitable for:- Budget-sensitive scenarios (~$0.025/image vs $0.050/image)
- Need fast generation (10s vs 20s)
- Existing project migration
How to switch from other image models to Nano Banana?
How to switch from other image models to Nano Banana?
Simply change the model name from
gpt-4o-image or sora_image to gemini-3-pro-image-preview (recommended Pro) or gemini-2.5-flash-image (legacy), keeping other parameters unchanged.What's the difference between official and preview versions?
What's the difference between official and preview versions?
Official version
gemini-2.5-flash-image supports 10 aspect ratios and custom resolution features, while preview version gemini-2.5-flash-image-preview has fewer features but works normally. Both have identical pricing and calling methods, official version recommended.What format are generated images?
What format are generated images?
The model returns base64-encoded image data, typically in PNG or JPEG format. Code automatically detects format and saves to corresponding file type.
Does it support image editing features?
Does it support image editing features?
Yes, Nano Banana supports not only image generation but also image editing features. Please refer to detailed documentation for specific usage methods.
Related Documentation
- Detailed Usage Guide
- Image Generation Comparison Testing
- Other Image Generation Models
- API Usage Manual
For more technical details and use cases, check the detailed usage guide link above.