Google: Nano Banana 2 (Gemini 3.1 Flash Image)
Image Generationgoogle/gemini-3.1-flash-imageGemini 3.1 Flash Image, a.k.a. "Nano Banana 2," is Google's state of the art image generation and editing model, delivering Pro-level visual quality at Flash speed. GA release of gemini-3.1-flash-image-preview, combining advanced contextual understanding with fast, cost-efficient inference.
Context Window
131K
Max Output Tokens
64K
Released
2026-06-18
Capabilities
VisionWeb Search
Available Providers
Vertex
Supported Protocols
openaigemini
Providers
Vertex
Input Tokens
$0.5/M
Output Tokens
$3/M
Output Image
$60/M
Web Search
$0.014/R
Protocols
openai
/v1/chat/completions/v1/images/generationsgemini
Code Examples
from google import genaiclient = genai.Client(api_key="YOUR_OFOX_API_KEY",http_options={"api_version": "v1beta", "base_url": "https://api.ofox.ai/gemini"},)response = client.models.generate_content(model="google/gemini-3.1-flash-image",contents="Generate an image of a beautiful sunset over mountains",)print(response.text)
Related Models
More from google
Frequently Asked Questions
Google: Nano Banana 2 (Gemini 3.1 Flash Image) on Ofox.ai costs $0.5/M per million input tokens and $3/M per million output tokens. Pay-as-you-go, no monthly fees.
Google: Nano Banana 2 (Gemini 3.1 Flash Image) supports a context window of 131K tokens with max output of 64K tokens, allowing you to process large documents and maintain long conversations.
Simply set your base URL to https://api.ofox.ai/v1 and use your Ofox API key. The API is OpenAI-compatible — just change the base URL and API key in your existing code.
Google: Nano Banana 2 (Gemini 3.1 Flash Image) supports the following capabilities: Vision, Web Search. Access all features through the Ofox.ai unified API.