Model Overview
Gemini 2.5 Flash Image (gemini-2.5-flash-image) is Google’s official release image generation model, more stable and reliable than the preview version (gemini-2.5-flash-image-preview). Supports both OpenAI-compatible format and Google native format.
🎉 Official Release
- ✅ Stable and reliable, recommended for production
- 🎨 Supports custom aspect ratios (16:9, 9:16, and 10 other ratios)
- ⚡ Generates high-quality images in ~10 seconds
- 💰 Great value: $0.025/image (37.5% cheaper than official)
🔀 Two Calling Methods
Gemini Flash Image supports two API endpoints, each with advantages:| Feature | OpenAI Compatible Mode | Google Native Format |
|---|---|---|
| Endpoint | /v1/chat/completions | /v1beta/models/gemini-2.5-flash-image:generateContent |
| Model Name | gemini-2.5-flash-image | Specified in URL |
| Image Size | Fixed 1:1 | Supports 10 aspect ratios |
| Compatibility | Perfect OpenAI SDK compatibility | Requires native calling |
| Return Format | Base64 | Base64 |
| Use Case | Quick migration, simple needs | Custom dimensions needed |
| Aspect Ratio | ❌ No | ✅ 21:9, 16:9, 4:3, 3:2, 1:1, 9:16, 3:4, 2:3, 5:4, 4:5 |
💡 How to Choose?
- If you only need square (1:1) images, use OpenAI Compatible Mode for simplicity
- If you need widescreen (16:9), portrait (9:16), or other specific ratios, use Google Native Format
🌟 Key Features
- ⚡ Fast Response: ~10 seconds generation, significantly faster than OpenAI series
- 💰 Great Value: 0.04/image)
- 🔄 Dual Compatibility: Supports both OpenAI SDK and Google native format
- 📐 Flexible Sizes: Google native format supports 10 aspect ratios
- 📦 Base64 Output: Returns base64-encoded image data directly, no secondary download needed
- 🎨 Google Technology: Based on Google’s latest image generation technology, excellent quality
📋 Model Comparison
| Model | Model ID | Billing | LaoZhang Price | Official Price | Savings | Speed |
|---|---|---|---|---|---|---|
| Gemini Flash Image | gemini-2.5-flash-image | Per Request | $0.025/image | $0.04/image | 37.5% | ~10s |
| GPT-Image-1 | gpt-image-1 | Per Token | 40 output per M | - | - | Medium |
| Flux Kontext Pro | flux-kontext-pro | Per Request | $0.035/image | $0.04/image | 12.5% | Fast |
| Sora Image | sora_image | Per Request | $0.01/image | - | - | Slower |
💡 Pricing Advantage
- 37.5% cheaper than official price
- Top up $100 get +10% bonus, combined with exchange rate advantage, total ~73% of official price
- Transparent and predictable pricing, no need to worry about token consumption
🚀 Quick Start
Prerequisites
1
Create Token
Log in to LaoZhang API Token Management and create a per-request billing token

2
Select Billing Method
Important: Must select “Per-Request Billing” type, not “Pay-As-You-Go”
3
Save Token
Copy the generated token, format is
sk-xxxxxx💰 Detailed Pricing Advantage
- LaoZhang API Price: $0.025/image (37.5% cheaper than official)
- Official Price: $0.04/image
- Top-up Bonus: Top up $100 get +10% bonus
- Exchange Rate Advantage: Combined advantage equals ~73% of official price
Method 1: OpenAI Compatible Mode (1:1 Images)
Basic Example - Curl
Python SDK Example
Method 2: Google Native Format (Custom Aspect Ratios)
Supported Aspect Ratios
| Type | Aspect Ratio Options |
|---|---|
| Landscape | 21:9 (ultra-wide), 16:9 (widescreen), 4:3, 3:2 |
| Square | 1:1 |
| Portrait | 9:16 (vertical), 3:4, 2:3 |
| Other | 5:4, 4:5 |
Simple Curl Example
Complete Python Tool Script
Expand to view complete Python script (with aspect ratio support)
Expand to view complete Python script (with aspect ratio support)
Bash Script Example
Expand to view complete Bash script (with aspect ratio support)
Expand to view complete Bash script (with aspect ratio support)
💡 Best Practices
Prompt Optimization
Clear Description
Use specific, detailed descriptions including subject, style, colors, lighting, etc.
Reference Styles
Specify art styles: “oil painting style”, “watercolor”, “cyberpunk style”, etc.
Avoid Ambiguity
Avoid overly abstract or vague terms
English Preferred
English prompts usually work better, though Chinese is also supported
Aspect Ratio Selection Guide
| Use Case | Recommended Ratio |
|---|---|
| Social media landscape | 16:9 |
| Phone wallpaper/portrait | 9:16 |
| Instagram square | 1:1 |
| Print photos | 4:3 or 3:2 |
| Movie poster | 2:3 |
| Banner ads | 21:9 |
❓ FAQ
How to choose calling method?
How to choose calling method?
- If you only need 1:1 square images, use OpenAI Compatible Mode for simplicity and perfect compatibility with existing code
- If you need specific aspect ratios (like 16:9 widescreen), use Google Native Format
- Both methods have the same price of $0.025/image
What aspect ratios are supported?
What aspect ratios are supported?
Google native format supports 10 aspect ratios:
- Landscape: 21:9, 16:9, 4:3, 3:2
- Square: 1:1
- Portrait: 9:16, 3:4, 2:3
- Other: 5:4, 4:5
What's the difference from Preview version?
What's the difference from Preview version?
- Official Release (
gemini-2.5-flash-image): Stable and reliable, recommended for production - Preview (
gemini-2.5-flash-image-preview): Being deprecated, migration recommended - Price, speed, and quality are identical, just update the model name to migrate
How to get better generation results?
How to get better generation results?
- Detailed Description: Provide specific details (colors, style, scene, etc.)
- English Prompts: English usually works better
- Reference Styles: Specify art styles (e.g., “oil painting style”, “watercolor”)
- Multiple Attempts: Try different prompts, prices are affordable
How to use returned Base64 data?
How to use returned Base64 data?
Base64 data can be displayed directly in web pages:Or decode and save as a file (refer to code examples above)